private void removeCounter() { log.trace("Removing ThreadLocal counter"); count.remove(); }
private void decrementCounterValue() { AtomicInteger i = count.get(); if (i == null) { log.trace("OOps, something removed counter befor end of request!"); // we should never get here... throw new IllegalStateException("Counter for nested ContextualHttpServletRequest was removed before it should be!"); } if (i.intValue() > 0) { i.decrementAndGet(); log.trace("Decrementing to " + count.get()); } }
private void incrementCounterValue() { AtomicInteger i = count.get(); if (i == null || i.intValue() < 0) { i = new AtomicInteger(0); count.set(i); } i.incrementAndGet(); log.trace("Incrementing to " + count.get()); }
private DeploymentHandler instantiateDeploymentHandler(String className) { try { Class<DeploymentHandler> clazz = (Class<DeploymentHandler>) getClassLoader().loadClass(className); return clazz.newInstance(); } catch (ClassNotFoundException e) { log.trace("Unable to use " + className + " as a deployment handler (class not found)", e); } catch (NoClassDefFoundError e) { log.trace("Unable to use " + className + " as a deployment handler (dependency not found)", e); } catch (InstantiationException e) { log.trace("Unable to instantiate deployment handler " + className, e); } catch (IllegalAccessException e) { log.trace("Unable to instantiate deployment handler " + className, e); } return null; }
protected boolean handle() { log.trace("found " + name); boolean handled = false; for (Entry<String, DeploymentHandler> entry: deploymentHandlers) { if (handle(entry.getValue())) { handled = true; } } return handled; }
@Override protected void process() { Object target = Component.getInstance(componentName); try { Method method = target.getClass().getMethod("handleAsynchronousException", Exception.class); log.trace("Using asynchronous exception handler " + componentName + ".handleAsynchronsException;"); method.invoke(target, exception); } catch (Exception e) { log.trace("Using default asynchronous exception handler"); AsynchronousExceptionHandler.instance().handleException(exception); } } }.run();
private void addHandler(String className) { DeploymentHandler deploymentHandler = instantiateDeploymentHandler(className); if (deploymentHandler != null) { log.trace("Adding " + deploymentHandler + " as a deployment handler"); deploymentHandlers.put(deploymentHandler.getName(), deploymentHandler); } }
private void handleArchiveByFile(File file) throws IOException { try { log.trace("archive: " + file); touchTimestamp(file); ZipFile zip = new ZipFile(file); Enumeration<? extends ZipEntry> entries = zip.entries(); while ( entries.hasMoreElements() ) { ZipEntry entry = entries.nextElement(); String name = entry.getName(); handle(name); } } catch (ZipException e) { throw new RuntimeException("Error handling file " + file, e); } }
public void trace(Object object, Object... params) { if ( isTraceEnabled() ) { log.trace( interpolate(object, params) ); } } public void trace(Object object, Throwable t, Object... params)
@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; } }
public void trace(Object object, Throwable t, Object... params) { if ( isTraceEnabled() ) { log.trace( interpolate(object, params), t ); } } public void debug(Object object, Object... params)
public void initialize(Object bean) throws Exception { if ( log.isTraceEnabled() ) log.trace("initializing new instance of: " + name); injectLog(bean); for ( Map.Entry<Method, InitialValue> me: initializerSetters.entrySet() ) { Method method = me.getKey(); Object initialValue = me.getValue().getValue( method.getParameterTypes()[0] ); setPropertyValue(bean, method, method.getName(), initialValue ); } for ( Map.Entry<Field, InitialValue> me: initializerFields.entrySet() ) { Field field = me.getKey(); Object initialValue = me.getValue().getValue( field.getType() ); setFieldValue(bean, field, field.getName(), initialValue ); } if ( log.isTraceEnabled() ) log.trace("done initializing: " + name); }
protected void initScanner() { List<String> scanners = new SeamDeploymentProperties(getClassLoader()).getPropertyValues(SCANNERS_KEY); for ( String className : scanners ) { Scanner scanner = instantiateScanner(className); if (scanner != null) { log.trace("Using " + scanner.toString()); this.scanner = scanner; return; } } log.trace("Using default URLScanner"); this.scanner = new URLScanner(this); }
/** * 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); }
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); } } }
/** * Outject context variable values from @Out attributes * of a component instance. * * @param bean a Seam component instance * @param enforceRequired should we enforce required=true? */ public void outject(Object bean, boolean enforceRequired) { if ( log.isTraceEnabled() ) { log.trace("outjecting dependencies of: " + getName()); } outjectAttributes(bean, enforceRequired); outjectDataModels(bean); }
private InvocationContext createInvocationContext(InvocationContext invocation, EventType eventType) throws Exception { if ( isProcessInterceptors( invocation.getMethod(), invocation.getTarget() ) ) { if ( log.isTraceEnabled() ) { log.trace( "intercepted: " + getInterceptionMessage(invocation, eventType) ); } return createSeamInvocationContext(invocation, eventType); } else { if ( log.isTraceEnabled() ) { log.trace( "not intercepted: " + getInterceptionMessage(invocation, eventType) ); } return invocation; } }
private void restorePageContextConversationId() { if ( Contexts.isPageContextActive() && isMissing(conversationId) ) { //checkPageContext is a workaround for a bug in MySQL server-side state saving //if it is not passed as a request parameter, //try to get it from the page context org.jboss.seam.faces.FacesPage page = org.jboss.seam.faces.FacesPage.instance(); conversationId = page.getConversationId(); parentConversationId = null; validateLongRunningConversation = page.isConversationLongRunning(); } else { log.trace("Found conversation id in request parameter: " + conversationId); } }
/** * Inject context variable values into @In attributes * of a component instance. * * @param bean a Seam component instance * @param enforceRequired should we enforce required=true? */ public void inject(Object bean, boolean enforceRequired) { if ( log.isTraceEnabled() ) { log.trace("injecting dependencies of: " + getName()); } //injectLog(bean); injectAttributes(bean, enforceRequired); injectDataModelSelections(bean); injectParameters(bean); }