public static InitialContext getInitialContext(Hashtable<String, String> props) throws NamingException { if (props==null) { throw new IllegalStateException("JNDI properties not initialized, Seam was not started correctly"); } if (log.isDebugEnabled()) { log.debug("JNDI InitialContext properties:" + props); } try { return props.size()==0 ? new InitialContext() : new InitialContext(props); } catch (NamingException e) { log.debug("Could not obtain initial context"); throw e; } }
/** * Null out any @In attributes of a component instance. * * @param bean a Seam component instance */ public void disinject(Object bean) { if ( log.isTraceEnabled() ) { log.trace("disinjecting dependencies of: " + getName()); } disinjectAttributes(bean); }
@Override public void afterCompletion(int status) { //Close the seam call we started if it is still active. if(ScopeType.APPLICATION.isContextActive()) { log.debug("Ending Transactional Seam Call"); Lifecycle.endCall(); } else { log.warn("Spring started a transactional Seam call but somebody else closed before it before the transaction committed."); } } }
public void setReplaceNull(Boolean replaceNull) { if (replaceNull == null) return; log.debug("Setting replace null: " + replaceNull); this.replaceNull = replaceNull; }
public SeamPhaseListener() { if (exists) { log.warn("There should only be one Seam phase listener per application"); } exists=true; }
log.debug("could not get transaction status while destroying persistence context"); log.warn("could not get transaction while destroying persistence context. (called during session expiration ?)"); if ( log.isDebugEnabled() ) log.debug("destroying seam managed persistence context for persistence unit: " + persistenceUnitJndiName);
private void removeCounter() { log.trace("Removing ThreadLocal counter"); count.remove(); }
private Properties loadFromResource(String resource) { Properties props = new Properties(); InputStream stream = Resources.getResourceAsStream(resource, servletContext); if (stream != null) { try { log.info("reading properties from: " + resource); try { props.load(stream); } catch (IOException ioe) { log.error("could not read " + resource, ioe); } } finally { Resources.closeStream(stream); } } else { log.debug("not found: " + resource); } return props; }
if ( log.isTraceEnabled() ) log.trace("Seam component not found: " + name); log.warn("Cannot create Seam component, scope is not active: " + name + "(" + component.getScope().name() + ")");
public void handleException(Exception throwable) { log.error("Exception thrown whilst executing asynchronous call", throwable); }
@Create public void startup() throws Exception { try { log.trace("GWT14Service starting up"); Class policyProviderClass = Class.forName(SERIALIZATION_POLICY_PROVIDER_CLASS); Class serializationPolicyClass = Class.forName(SERIALIZATION_POLICY_CLASS); streamReaderConstructor = ServerSerializationStreamReader.class.getConstructor( new Class[] { ClassLoader.class, policyProviderClass } ); streamWriterConstructor = ServerSerializationStreamWriter.class.getConstructor( new Class[] { serializationPolicyClass } ); Class legacySerializationPolicyClass = Class.forName(LEGACY_SERIALIZATION_POLICY_CLASS); Method m = legacySerializationPolicyClass.getDeclaredMethod("getInstance"); legacySerializationPolicy = m.invoke(null); } catch (Exception ex) { log.error("Error initializing GWT14Service. Please ensure " + "the GWT 1.4 libraries are in the classpath."); throw ex; } }
protected void handle(Set<String> paths) { for ( String urlPath: paths ) { try { log.trace("scanning: " + urlPath); File file = new File(urlPath); if ( file.isDirectory() ) { handleDirectory(file, null); } else { handleArchiveByFile(file); } } catch (IOException ioe) { log.warn("could not read entries", ioe); } } }
public boolean isTraceEnabled() { return log.isTraceEnabled(); } public boolean isWarnEnabled()
public boolean isDebugEnabled() { return log.isDebugEnabled(); } public boolean isErrorEnabled()
public static void endTest() { Lifecycle.clearThreadlocals(); log.debug( "<<< End test" ); }
public void setSearchScope(String value) { if ("OBJECT_SCOPE".equals(value)) { searchScope = SearchControls.OBJECT_SCOPE; } else if ("ONELEVEL_SCOPE".equals(value)) { searchScope = SearchControls.ONELEVEL_SCOPE; } else { searchScope = SearchControls.SUBTREE_SCOPE; if (!"SUBTREE_SCOPE".equals(value)) { log.warn("Invalid search scope specified (" + value + ") - search scope set to SUBTREE_SCOPE"); } } }
protected void rollbackTransactionIfNecessary() { try { UserTransaction transaction = Transaction.instance(); if ( transaction.isActiveOrMarkedRollback() || transaction.isRolledBack() ) { log.debug("killing transaction"); transaction.rollback(); } } catch (Exception te) { log.error("could not roll back transaction", te); } } }