public void log(final String level, final String message) { final String levelLowerCase = level.toLowerCase(Locale.ENGLISH); if ("info".equals(levelLowerCase)) { info(message); } else if ("debug".equals(levelLowerCase)) { debug(message); } else if ("warning".equals(levelLowerCase)) { warning(message); } else if ("fatal".equals(levelLowerCase)) { fatal(message); } else if ("error".equals(levelLowerCase)) { error(message); } }
@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); } } };
private static void logExclusions(final String[] exclusionArray) { if (logger.isDebugEnabled()) { logger.debug("Exclusion prefixes: ["); for (final String ex : exclusionArray) { logger.debug("-" + ex); } 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); } } };
public String debug(final String message, final Throwable t, final Object... args) { if (isDebugEnabled()) { String msg = getMessage(message, baseName); msg = formatMessage(msg, args); logStream.debug(msg, t); return msg; } return message; }
public static void configurationParsingError(final String messageType, final String message, final String line, final String column) { _logger.error("as0001", messageType, message, line, column); /* * An error broadcasting system is under development. * At this point an appropriate error would be broadcast to all listeners. */ }
private EJBResponse setResponseError(final EJBResponse res, final byte version, final Throwable error, final String message) { //This is fatal for the client, but not the server. if (logger.isInfoEnabled()) { logger.info(message + " - Enable DEBUG for stacktrace: " + error); } else if (logger.isDebugEnabled()) { logger.debug(message, error); } final RemoteException re = new RemoteException(message, error); res.setResponse(version, ResponseCodes.EJB_ERROR, new ThrowableArtifact(re)); return res; } }
@Override public void run() { for (final String mapping : mappings) { try { addFilterMethod.invoke(null, clazz.getName(), webContext, mapping, config); deployedWebObjects.filterMappings.add(mapping); } catch (final Exception e) { LOGGER.warning(e.getMessage(), e); } } } });
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); }
protected void setRollbackOnly(Transaction tx) { try { if (tx != null && tx.getStatus() == Status.STATUS_ACTIVE) { tx.setRollbackOnly(); txLogger.debug("TX {0}: setRollbackOnly() on transaction {1}", transactionType, tx); } } catch (Exception e) { txLogger.error("Exception during setRollbackOnly()", e); throw new IllegalStateException("No transaction active", e); } }
public void afterCompletion(final int i) { entityManager.close(); logger.debug("Closed EntityManager(unit=" + unitName + ", hashCode=" + entityManager.hashCode() + ")"); } }
private static void loadOASISCatalog(Bus bus, URL catalogURL) { OASISCatalogManager catalog = new OASISCatalogManager(); try { catalog.loadCatalog(catalogURL); logger.debug("Loaded " + catalogURL + " catalog."); bus.setExtension(catalog, OASISCatalogManager.class); } catch (IOException e) { logger.warning("Failed to load catalog file: " + catalogURL, 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); }
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 String info(String message, Object... args) { if (isInfoEnabled()) { String msg = getMessage(message, baseName); msg = formatMessage(msg, args); logStream.info(msg); return msg; } return message; }
public String debug(final String message, final Throwable t) { if (isDebugEnabled()) { final String msg = getMessage(message, baseName); logStream.debug(msg, t); return msg; } return message; }
private void tomeeConfig(final BrokerService broker) { //Notify when an error occurs on shutdown. broker.setUseLoggingForShutdownErrors(Logger.getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQ5Factory.class).isErrorEnabled()); }
public String info(final String message, final Throwable t) { if (isInfoEnabled()) { final String msg = getMessage(message, baseName); logStream.info(msg, t); return msg; } return message; }