public boolean isDebugEnabled() { return log.isDebugEnabled(); } public boolean isErrorEnabled()
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; } }
public void forward(ServletRequest request, ServletResponse response) { if (response.isCommitted()) { throw new IllegalStateException("Cannot perform forward - response is already committed"); } getMockHttpServletResponse(response).setForwardedUrl(this.url); if (logger.isDebugEnabled()) { logger.debug("MockRequestDispatcher: forwarding to URL [" + this.url + "]"); } }
public void include(ServletRequest request, ServletResponse response) { getMockHttpServletResponse(response).setIncludedUrl(this.url); if (logger.isDebugEnabled()) { logger.debug("MockRequestDispatcher: including URL [" + this.url + "]"); } }
private void initInterceptors() { initDefaultInterceptors(); for ( Annotation annotation: getBeanClass().getAnnotations() ) { if ( annotation.annotationType().isAnnotationPresent(INTERCEPTORS) ) { Class[] classes = value( annotation.annotationType().getAnnotation(INTERCEPTORS) ); addInterceptor( new Interceptor(classes, annotation, this) ); } if ( annotation.annotationType().isAnnotationPresent(Interceptors.class) ) { Class[] classes = annotation.annotationType().getAnnotation(Interceptors.class).value(); addInterceptor( new Interceptor(classes, annotation, this) ); } } newSort(interceptors); newSort(clientSideInterceptors); if ( log.isDebugEnabled() ) log.debug("interceptor stack: " + interceptors); }
private void deployProcess(JbpmContext jbpmContext, String definitionResource) { ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource(definitionResource); if (log.isDebugEnabled()) { log.debug( "deploying process definition : " + processDefinition.getName() ); } jbpmContext.deployProcessDefinition(processDefinition); }
@Override public void registerSynchronization(Synchronization sync) { if ( log.isDebugEnabled() ) { log.debug("registering synchronization: " + sync); } assertActive(); getDelegate().registerSynchronization(sync); }
private void close() { boolean transactionActive = false; try { transactionActive = Transaction.instance().isActive(); } catch (SystemException se) { log.debug("could not get transaction status while destroying persistence context"); } if ( transactionActive ) { throw new IllegalStateException("attempting to destroy the persistence context while an active transaction exists (try installing <transaction:ejb-transaction/>)"); } if ( log.isDebugEnabled() ) { log.debug("destroying seam managed session for session factory: " + sessionFactoryJndiName); } if (session!=null && session.isOpen()) { session.close(); } }
/** * Send an error. */ protected void error(int code, String message) { if ( log.isDebugEnabled() ) log.debug("sending error: " + code); org.jboss.seam.faces.HttpError httpError = org.jboss.seam.faces.HttpError.instance(); if (message==null) { httpError.send(code); } else { httpError.send(code, message); } }
/** * Redirect to the view id. */ protected void redirect(String viewId, Map<String, Object> parameters, boolean includePageParams) { if ( Strings.isEmpty(viewId) ) { viewId = Pages.getCurrentViewId(); } if ( log.isDebugEnabled() ) log.debug("redirecting to: " + viewId); FacesManager.instance().redirect(viewId, parameters, true, includePageParams); }
/** * Render the view id. */ protected void render(String viewId) { FacesContext facesContext = FacesContext.getCurrentInstance(); if ( !Strings.isEmpty(viewId) ) { UIViewRoot viewRoot = facesContext.getApplication().getViewHandler() .createView(facesContext, viewId); facesContext.setViewRoot(viewRoot); } else { viewId = Pages.getViewId(facesContext); //just for the log message } if ( log.isDebugEnabled() ) log.debug("rendering: " + viewId); facesContext.renderResponse(); }
public static Object enhance(Object bean, Set<Class> interfaces, IoCComponent component) throws Exception { Class beanClass = bean.getClass(); if (isProxy(beanClass)) { throw new RuntimeException("Seam cannot wrap JDK proxied IoC beans. Please use CGLib or Javassist proxying instead"); } // if (isCglibProxyClass(beanClass) || isJavassistProxyClass(beanClass)) { beanClass = beanClass.getSuperclass(); } if (log.isDebugEnabled()) { log.debug("Creating proxy for " + component.getIoCName() + " Seam component '" + component.getName() + "' using class: " + beanClass.getName()); } // create pojo proxy JavaBeanInterceptor interceptor = new JavaBeanInterceptor(bean, component); // Should probably create a Factory but required a lot of duplicated // code and there is potential for a spring bean to provide // different interfaces at different times in an application. If // need is great I can create a Factory and assume the same // interfaces all the time. ProxyObject po = Component.createProxyFactory(ComponentType.JAVA_BEAN, beanClass, interfaces).newInstance(); po.setHandler(interceptor); interceptor.postConstruct(); return po; }
private void initSession() throws Exception { session = getSessionFactoryFromJndiOrValueBinding().openSession(); setSessionFlushMode( PersistenceContexts.instance().getFlushMode() ); session = HibernatePersistenceProvider.proxySession(session); for (Filter f: filters) { if ( f.isFilterEnabled() ) { enableFilter(f); } } if ( log.isDebugEnabled() ) { log.debug("created seam managed session for session factory: "+ sessionFactoryJndiName); } }
@Override public void registerSynchronization(Synchronization sync) { if ( log.isDebugEnabled() ) { log.debug("registering synchronization: " + sync); } assertActive(); //try to register the synchronization directly with the //persistence provider, but if this fails, just hold //on to it myself if ( !PersistenceProvider.instance().registerSynchronization(sync, currentEntityManager) ) { getSynchronizations().registerSynchronization(sync); } }
if ( log.isDebugEnabled() ) if ( log.isDebugEnabled() )
/** * Begin executing a pageflow. * * @param pageflowDefinitionName the name of the pageflow definition */ public void begin(String pageflowDefinitionName) { if ( log.isDebugEnabled() ) { log.debug("beginning pageflow: " + pageflowDefinitionName); } processInstance = Pageflow.createInstance( getPageflowProcessDefinition(pageflowDefinitionName) ); //if ( Lifecycle.getPhaseId().equals(PhaseId.RENDER_RESPONSE) ) //{ //if a pageflow starts during the render response phase //(as a result of a @Create method), we know the navigation //handler will not get called, so we should force the //pageflow out of the start state immediately //TODO: this is not actually completely true, what about <s:actionLink/> //pi.signal(); //} setDirty(); raiseBeginEvent(pageflowDefinitionName); storePageflowToViewRootIfNecessary(); }
private void remove() { getComponent().getScope().getContext().remove( getComponent().getName() ); if ( log.isDebugEnabled() ) { log.debug( "Stateful component was removed: " + getComponent().getName() ); } }
private void redirect(String viewId, FacesContext context, String url) { url = Pages.instance().encodeScheme(viewId, context, url); if ( log.isDebugEnabled() ) { log.debug("redirecting to: " + url); } ExternalContext externalContext = context.getExternalContext(); controllingRedirect = true; try { Contexts.getEventContext().set(REDIRECT_FROM_MANAGER, ""); externalContext.redirect( externalContext.encodeActionURL(url) ); } catch (IOException ioe) { throw new RedirectException(ioe); } catch (IllegalStateException ise) { throw new RedirectException(ise.getMessage()); } finally { Contexts.getEventContext().remove(REDIRECT_FROM_MANAGER); controllingRedirect = false; } context.responseComplete(); }
private void initEntityManager() { entityManager = getEntityManagerFactoryFromJndiOrValueBinding().createEntityManager(); PersistenceProvider persistenceProvider = PersistenceProvider.instance(); entityManager = persistenceProvider.proxyEntityManager(entityManager); setEntityManagerFlushMode( PersistenceContexts.instance().getFlushMode() ); for (Filter f: filters) { if ( f.isFilterEnabled() ) { persistenceProvider.enableFilter(f, entityManager); } } if ( log.isDebugEnabled() ) { if (entityManagerFactory==null) { log.debug("created seam managed persistence context for persistence unit: "+ persistenceUnitJndiName); } else { log.debug("created seam managed persistence context from EntityManagerFactory"); } } }
if ( log.isDebugEnabled() ) log.debug( "selected row: " + selectedIndex );