private static Logger logger() { // don't trigger init too eagerly to be sure to be configured if (logger == null) { logger = Logger.getInstance(LogCategory.OPENEJB_STARTUP, OpenEjbContainer.class); } return logger; }
private static Logger logger() { // don't trigger init too eagerly to be sure to be configured if (logger == null) { logger = Logger.getInstance(LogCategory.OPENEJB_STARTUP, OpenEjbContainer.class); } return logger; }
public HsqlPrintWriter(final boolean errorWriter) { super(System.err); logger = Logger.getInstance(LogCategory.OPENEJB_HSQL, HsqlPrintWriter.class); this.errorWriter = errorWriter; }
private static Logger logger() { // don't trigger init too eagerly to be sure to be configured if (logger == null) { logger = Logger.getInstance(LogCategory.OPENEJB_STARTUP, OpenEjbContainer.class); } return logger; }
private static Logger logger() { // don't trigger init too eagerly to be sure to be configured if (logger == null) { logger = Logger.getInstance(LogCategory.OPENEJB_STARTUP, OpenEjbContainer.class); } return logger; }
public OpenEJBCommonsLog(final String category) { this.category = category; logger = Logger.getInstance(LogCategory.OPENEJB, category); }
public LoggingPrintWriter(final String category) { super(System.err); logger = Logger.getInstance(LogCategory.OPENEJB.createChild(category), LoggingPrintWriter.class.getName()); }
public void release() { for (final CreationalContext<?> cc : creationalContexts.values()) { try { cc.release(); } catch (final RuntimeException re) { Logger.getInstance(LogCategory.OPENEJB, WebContext.class.getName()) .warning("Can't release properly a creational context", re); } } creationalContexts.clear(); }
@Override public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { try { return method.invoke(findBm(), args); } catch (final InvocationTargetException ite) { Logger.getInstance(LogCategory.OPENEJB_JPA, EntityManagerFactoryCallable.class) .warning("Exception calling CDI, if a lifecycle issue you should maybe set tomee.jpa.factory.lazy=true", ite.getCause()); throw ite.getCause(); } }
@Override public void run() { try { //Force a shutdown without waiting for jobs to complete. s.shutdown(false); Logger.getInstance(LogCategory.OPENEJB, "org.apache.openejb.util.resources").warning("Forced Quartz stop - Jobs may be incomplete"); } catch (final Throwable e) { QuartzResourceAdapter.this.ex.set(e); } } };
@Override public void run() { try { //Force a shutdown without waiting for jobs to complete. s.shutdown(false); Logger.getInstance(LogCategory.OPENEJB, "org.apache.openejb.util.resources").warning("Forced Quartz stop - Jobs may be incomplete"); } catch (final Throwable e) { QuartzResourceAdapter.this.ex.set(e); } } };
@PostConstruct public void PostConstruct(final InvocationContext invocationContext) throws Exception { final long start = System.nanoTime(); record(invocationContext, PostConstruct()); final long end = System.nanoTime(); Logger.getInstance(LogCategory.MONITORING, "org.apache.openejb.monitoring") .debug("instance.created", invocationContext.getTarget().getClass().getName(), end - start); }
@PreDestroy public void PreDestroy(final InvocationContext invocationContext) throws Exception { final long start = System.nanoTime(); record(invocationContext, PreDestroy()); final long end = System.nanoTime(); Logger.getInstance(LogCategory.MONITORING, "org.apache.openejb.monitoring") .debug("instance.discarded", invocationContext.getTarget().getClass().getName(), end - start); }
@Override public void run() { try { stopImpl(); } catch (final Throwable t) { Logger.getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQResourceAdapter.class).getChildLogger("service").error("ActiveMQ shutdown failed", t); } } };
public Tracker build() { logger = Logger.getInstance(LogCategory.OPENEJB_SERVER.createChild("discovery"), Tracker.class); return new Tracker(group, heartRate, maxMissedHeartbeats, reconnectDelay, maxReconnectDelay, maxReconnectAttempts, exponentialBackoff, logger, debug); } }
@Override public void run() { try { stopImpl(); } catch (final Throwable t) { Logger.getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQResourceAdapter.class).getChildLogger("service").error("ActiveMQ shutdown failed", t); } } };
private void tomeeConfig(final BrokerService broker) { //Notify when an error occurs on shutdown. broker.setUseLoggingForShutdownErrors(Logger.getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQ5Factory.class).isErrorEnabled()); }
private ScheduledExecutorService createScheduledExecutorService() { ManagedThreadFactory managedThreadFactory; try { managedThreadFactory = ThreadFactories.findThreadFactory(threadFactory); } catch (final Exception e) { Logger.getInstance(LogCategory.OPENEJB, ManagedScheduledExecutorServiceImplFactory.class).warning("Unable to create configured thread factory: " + threadFactory, e); managedThreadFactory = new ManagedThreadFactoryImpl(); } return new ScheduledThreadPoolExecutor(core, managedThreadFactory, CURejectHandler.INSTANCE); }
@Override public void init(final Properties props) throws Exception { this.logger = Logger.getInstance(LogCategory.OPENEJB_SERVER.createChild("service." + getName()), "org.apache.openejb.server.util.resources"); this.debug = this.logger.isDebugEnabled(); super.init(props); }
public LiveReloadEndpoint() { this.watcher = Instances.get().getWatcher(); this.mapper = Instances.get().getMapper(); this.logger = Logger.getInstance(Instances.get().getLogCategory(), LiveReloadEndpoint.class); }