private void flushLine() { if (!errorWriter) logger.info(text.toString()); else logger.error(text.toString()); text.setLength(0); }
private void logDebug() { try { LOGGER.info("SQL " + sql); for (final Parameter parameter : parameters) { logParam(parameter); } } catch (final SQLException e) { e.printStackTrace(); } }
private void optionalService(Properties properties, String className) { try { Service service = (Service) getClass().getClassLoader().loadClass(className).newInstance(); service.init(properties); } catch (ClassNotFoundException e) { logger.info("Optional service not installed: " + className); } catch (Exception e) { logger.error("Failed to start: " + className, e); } }
public void start() { logger.info("Initializing network services"); final Method start = getMethod("start", boolean.class); invoke(start, serviceManager, false); }
public void stop() { logger.info("Stopping network services"); final Method stop = getMethod("stop"); invoke(stop, serviceManager); } }
public void rollback() throws IllegalStateException, SecurityException, SystemException { if (transactionLogger.isInfoEnabled()) { transactionLogger.info("Rolling back user transaction " + transactionManager().getTransaction()); } transactionManager().rollback(); }
public void start() { logger.info("Initializing network services"); final Method start = getMethod("start", boolean.class); invoke(start, serviceManager, false); }
public void stop() { logger.info("Stopping network services"); final Method stop = getMethod("stop"); invoke(stop, serviceManager); } }
public void begin() throws NotSupportedException, SystemException { transactionManager().begin(); if (transactionLogger.isInfoEnabled()) { transactionLogger.info("Started user transaction " + transactionManager().getTransaction()); } }
private void deploySingleton(final String web, final String contextRoot, final Object o, final Application appInstance, final ClassLoader classLoader, final Collection<Object> additionalProviders, final ServiceConfiguration configuration) { final String nopath = getAddress(contextRoot, o.getClass()); final RsHttpListener listener = createHttpListener(); final RsRegistry.AddressInfo address = rsRegistry.createRsHttpListener(web, listener, classLoader, nopath.substring(NOPATH_PREFIX.length() - 1), virtualHost, auth, realm); services.add(new DeployedService(address.complete, web, o.getClass().getName())); listener.deploySingleton(contextRoot, getFullContext(address.base, contextRoot), o, appInstance, additionalProviders, configuration); LOGGER.info("deployed REST singleton: " + o); }
private void tearDownOpenEJB() throws NamingException { if (factory.bootedOpenEJB()) { logger.info("Destroying container system"); factory.close(); context.close(); OpenEJB.destroy(); } }
private void setNonJtaDataSource(final PersistenceUnit unit, final String current) { final String previous = unit.getNonJtaDataSource(); if (!current.equals(previous)) { logger.info("Adjusting PersistenceUnit " + unit.getName() + " <non-jta-data-source> to Resource ID '" + current + "' from '" + previous + "'"); } unit.setNonJtaDataSource(current); }
private void setJtaDataSource(PersistenceUnit unit, String current) { String previous = unit.getJtaDataSource(); if (!current.equals(previous)) { logger.info("Adjusting PersistenceUnit " + unit.getName() + " <jta-data-source> to Resource ID '" + current + "' from '" + previous + "'"); } unit.setJtaDataSource(current); }
private void tearDownOpenEJB() throws NamingException { if (factory.bootedOpenEJB()) { logger.info("Destroying container system"); factory.close(); context.close(); OpenEJB.destroy(); } }
private void tearDownOpenEJB() throws NamingException { if (factory.bootedOpenEJB()){ logger.info("Destroying container system"); factory.close(); context.close(); OpenEJB.destroy(); } }
public int getStatus() throws SystemException { int status = transactionManager().getStatus(); if (transactionLogger.isInfoEnabled()) { transactionLogger.info("User transaction " + transactionManager().getTransaction() + " has status " + getStatus(status)); } return status; }
@Managed public void allowCoreThreadTimeOut(final boolean value) { getThreadPool().allowCoreThreadTimeOut(value); if (log.isInfoEnabled()) { log.info(String.format("Set ServicePool '" + ServicePool.this.getName() + "' allow core thread timeout to (%1$s)", value)); } }
private ThreadSingletonService initSingleton() { ThreadContext.addThreadContextListener(new RequestScopedThreadContextListener()); ThreadSingletonService singletonService = SystemInstance.get().getComponent(ThreadSingletonService.class); //TODO hack for tests. Currently initialized in OpenEJB line 90. cf alternative in AccessTimeoutTest which would //presumably have to be replicated in about 70 other tests. if (singletonService == null) { singletonService = initializeOWB(getClass().getClassLoader()); } else { logger.info("Existing thread singleton service in SystemInstance(): " + singletonService); } return singletonService; }
public void setRollbackOnly() throws javax.transaction.SystemException { if (transactionLogger.isInfoEnabled()) { transactionLogger.info("Marking user transaction for rollback: " + transactionManager().getTransaction()); } transactionManager().setRollbackOnly(); }
private ThreadSingletonService initSingleton() { ThreadContext.addThreadContextListener(new RequestScopedThreadContextListener()); ThreadSingletonService singletonService = SystemInstance.get().getComponent(ThreadSingletonService.class); //TODO hack for tests. Currently initialized in OpenEJB line 90. cf alternative in AccessTimeoutTest which would //presumably have to be replicated in about 70 other tests. if (singletonService == null) { singletonService = initializeOWB(); } else { logger.info("Existing thread singleton service in SystemInstance(): " + singletonService); } return singletonService; }