use of lucee.commons.io.log.Log in project Lucee by lucee.
the class FDThreadImpl method stop.
@Override
public void stop() {
Log log = pc.getConfig().getLog("application");
SystemUtil.stop(pc, log, true);
}
use of lucee.commons.io.log.Log in project Lucee by lucee.
the class CFMLFactoryImpl method terminate.
public static void terminate(PageContextImpl pc, boolean async) {
Log log = ((ConfigImpl) pc.getConfig()).getLog("requesttimeout");
if (log != null)
LogUtil.log(log, Log.LEVEL_ERROR, "controler", "stop thread (" + pc.getId() + ") because run into a timeout " + getPath(pc) + "." + RequestTimeoutException.locks(pc), pc.getThread().getStackTrace());
pc.getConfig().getThreadQueue().exit(pc);
SystemUtil.stop(pc, log, async);
}
use of lucee.commons.io.log.Log in project Lucee by lucee.
the class CFMLFactoryImpl method stopThread.
public void stopThread(String threadId, String stopType) {
// synchronized (runningPcs) {
Iterator<PageContextImpl> it = runningPcs.values().iterator();
PageContext pc;
while (it.hasNext()) {
pc = it.next();
Log log = ((ConfigImpl) pc.getConfig()).getLog("application");
try {
String id = Hash.call(pc, pc.getId() + ":" + pc.getStartTime());
if (id.equals(threadId)) {
stopType = stopType.trim();
// Throwable t;
if ("abort".equalsIgnoreCase(stopType) || "cfabort".equalsIgnoreCase(stopType))
throw new RuntimeException("type [" + stopType + "] is no longer supported");
// t=new Abort(Abort.SCOPE_REQUEST);
// else t=new RequestTimeoutException(pc.getThread(),"request has been forced to stop.");
SystemUtil.stop(pc, log, true);
SystemUtil.sleep(10);
break;
}
} catch (PageException e1) {
}
}
// }
}
use of lucee.commons.io.log.Log in project Lucee by lucee.
the class ConfigWebUtil method loadLib.
static void loadLib(ConfigServerImpl configServer, ConfigImpl config) throws IOException {
// get lib and classes resources
Resource lib = config.getLibraryDirectory();
Resource[] libs = lib.listResources(ExtensionResourceFilter.EXTENSION_JAR_NO_DIR);
// get resources from server config and merge
if (configServer != null) {
ResourceClassLoader rcl = configServer.getResourceClassLoader();
libs = ResourceUtil.merge(libs, rcl.getResources());
}
CFMLEngine engine = ConfigWebUtil.getEngine(config);
BundleContext bc = engine.getBundleContext();
Log log = config.getLog("application");
BundleFile bf;
List<Resource> list = new ArrayList<Resource>();
for (int i = 0; i < libs.length; i++) {
try {
bf = BundleFile.newInstance(libs[i]);
// jar is not a bundle
if (bf == null) {
// convert to a bundle
BundleBuilderFactory factory = new BundleBuilderFactory(libs[i]);
factory.setVersion("0.0.0.0");
Resource tmp = SystemUtil.getTempFile("jar", false);
factory.build(tmp);
IOUtil.copy(tmp, libs[i]);
bf = BundleFile.newInstance(libs[i]);
}
OSGiUtil.start(OSGiUtil.installBundle(bc, libs[i], true));
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
list.add(libs[i]);
log.log(Log.LEVEL_ERROR, "OSGi", t);
}
}
// set classloader
ClassLoader parent = SystemUtil.getCoreClassLoader();
config.setResourceClassLoader(new ResourceClassLoader(list.toArray(new Resource[list.size()]), parent));
}
use of lucee.commons.io.log.Log in project Lucee by lucee.
the class StorageScopeDatasource method unstore.
@Override
public void unstore(PageContext pc) {
ConfigImpl ci = (ConfigImpl) ThreadLocalPageContext.getConfig(pc);
DatasourceConnection dc = null;
DatasourceConnectionPool pool = ci.getDatasourceConnectionPool();
Log log = ci.getLog("scope");
try {
// FUTURE change method interface
pc = ThreadLocalPageContext.get(pc);
DataSource ds;
if (pc != null)
ds = pc.getDataSource(datasourceName);
else
ds = ci.getDataSource(datasourceName);
dc = pool.getDatasourceConnection(null, ds, null, null);
SQLExecutor executor = SQLExecutionFactory.getInstance(dc);
executor.delete(ci, cfid, appName, dc, getType(), log);
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
ScopeContext.error(log, t);
} finally {
if (dc != null)
pool.releaseDatasourceConnection(dc);
}
}
Aggregations