use of lucee.loader.engine.CFMLEngine in project Lucee by lucee.
the class MappingImpl method loadArchive.
private void loadArchive() {
if (archive == null || archMod == archive.lastModified())
return;
CFMLEngine engine = ConfigWebUtil.getEngine(config);
BundleContext bc = engine.getBundleContext();
try {
archiveBundle = OSGiUtil.installBundle(bc, archive, true);
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
archMod = archive.lastModified();
config.getLog("application").log(Log.LEVEL_ERROR, "OSGi", t);
archive = null;
}
}
use of lucee.loader.engine.CFMLEngine in project Lucee by lucee.
the class CFMLEngineImpl method isRunning.
public boolean isRunning() {
try {
CFMLEngine other = CFMLEngineFactory.getInstance();
// FUTURE patch, do better impl when changing loader
if (other != this && controlerState.active() && !(other instanceof CFMLEngineWrapper)) {
SystemOut.printDate("CFMLEngine is still set to true but no longer valid, " + lucee.runtime.config.Constants.NAME + " disable this CFMLEngine.");
controlerState.setActive(false);
reset();
return false;
}
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
}
return controlerState.active();
}
use of lucee.loader.engine.CFMLEngine in project Lucee by lucee.
the class XMLConfigAdmin method updateCore.
public static void updateCore(ConfigServerImpl config, Resource core, boolean reload) throws PageException {
try {
// get patches directory
CFMLEngine engine = ConfigWebUtil.getEngine(config);
File f = engine.getCFMLEngineFactory().getResourceRoot();
Resource res = ResourcesImpl.getFileResourceProvider().getResource(f.getAbsolutePath());
Resource pd = res.getRealResource("patches");
if (!pd.exists())
pd.mkdirs();
Resource pf = pd.getRealResource(core.getName());
// move to patches directory
core.moveTo(pf);
core = pf;
//
XMLConfigAdmin admin = new XMLConfigAdmin(config, null);
admin.restart(config);
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
DeployHandler.moveToFailedFolder(config.getDeployDirectory(), core);
throw Caster.toPageException(t);
}
}
use of lucee.loader.engine.CFMLEngine in project Lucee by lucee.
the class XMLConfigAdmin method installBundle.
private static BundleFile installBundle(Config config, BundleFile bf) throws IOException, BundleException {
// does this bundle already exists
BundleFile _bf = OSGiUtil.getBundleFile(bf.getSymbolicName(), bf.getVersion(), null, false, null);
if (_bf != null)
return _bf;
CFMLEngine engine = CFMLEngineFactory.getInstance();
CFMLEngineFactory factory = engine.getCFMLEngineFactory();
// copy to jar directory
File jar = new File(factory.getBundleDirectory(), bf.getSymbolicName() + "-" + bf.getVersion().toString() + (".jar"));
InputStream is = bf.getInputStream();
OutputStream os = new FileOutputStream(jar);
try {
IOUtil.copy(is, os, false, false);
} finally {
IOUtil.closeEL(is, os);
}
return new BundleFile(jar);
}
use of lucee.loader.engine.CFMLEngine in project Lucee by lucee.
the class XMLConfigAdmin method _reload.
private synchronized void _reload() throws PageException, SAXException, ClassException, IOException, TagLibException, FunctionLibException, BundleException {
// if(storeInMemoryData)XMLCaster.writeTo(doc,config.getConfigFile());
CFMLEngine engine = ConfigWebUtil.getEngine(config);
if (config instanceof ConfigServerImpl) {
ConfigServerImpl cs = (ConfigServerImpl) config;
XMLConfigServerFactory.reloadInstance(engine, cs);
ConfigWeb[] webs = cs.getConfigWebs();
for (int i = 0; i < webs.length; i++) {
XMLConfigWebFactory.reloadInstance(engine, (ConfigServerImpl) config, (ConfigWebImpl) webs[i], true);
}
} else {
ConfigServerImpl cs = ((ConfigWebImpl) config).getConfigServerImpl();
XMLConfigWebFactory.reloadInstance(engine, cs, (ConfigWebImpl) config, false);
}
}
Aggregations