public void detachHandler() { executionContext.removeAttribute(DefaultHandler2.class); }
public void detachHandler() { executionContext.removeAttribute(DefaultHandler2.class); }
public void detachHandler() { executionContext.removeAttribute(DefaultHandler2.class); }
public void detachHandler() { executionContext.removeAttribute(DefaultHandler2.class); }
public static void setSource(ExecutionContext executionContext, Source source) { if(source != null) { executionContext.setAttribute(CONTEXT_KEY, source); } else { executionContext.removeAttribute(CONTEXT_KEY); } }
public static void setResults(ExecutionContext executionContext, Result... results) { if(results != null) { executionContext.setAttribute(CONTEXT_KEY, results); } else { executionContext.removeAttribute(CONTEXT_KEY); } }
public static void setSource(ExecutionContext executionContext, Source source) { if(source != null) { executionContext.setAttribute(CONTEXT_KEY, source); } else { executionContext.removeAttribute(CONTEXT_KEY); } }
public static void setSource(ExecutionContext executionContext, Source source) { if(source != null) { executionContext.setAttribute(CONTEXT_KEY, source); } else { executionContext.removeAttribute(CONTEXT_KEY); } }
public static void setResults(ExecutionContext executionContext, Result... results) { if(results != null) { executionContext.setAttribute(CONTEXT_KEY, results); } else { executionContext.removeAttribute(CONTEXT_KEY); } }
public static void setResults(ExecutionContext executionContext, Result... results) { if(results != null) { executionContext.setAttribute(CONTEXT_KEY, results); } else { executionContext.removeAttribute(CONTEXT_KEY); } }
public static void setSource(ExecutionContext executionContext, Source source) { if(source != null) { executionContext.setAttribute(CONTEXT_KEY, source); } else { executionContext.removeAttribute(CONTEXT_KEY); } }
public static void setResults(ExecutionContext executionContext, Result... results) { if(results != null) { executionContext.setAttribute(CONTEXT_KEY, results); } else { executionContext.removeAttribute(CONTEXT_KEY); } }
/** * Close the resource output stream. * <p/> * Classes overriding this method must call super on this method. This will * probably need to be done before performing any aditional cleanup. * * @param executionContext Smooks ExecutionContext */ protected void closeResource( final ExecutionContext executionContext ) { try { Closeable output = (Closeable) executionContext.getAttribute( OUTPUTSTREAM_CONTEXT_KEY_PREFIX + getResourceName() ); close( output ); } finally { executionContext.removeAttribute( OUTPUTSTREAM_CONTEXT_KEY_PREFIX + getResourceName() ); executionContext.removeAttribute( RESOURCE_CONTEXT_KEY_PREFIX + getResourceName() ); } }
/** * Close the resource output stream. * <p/> * Classes overriding this method must call super on this method. This will * probably need to be done before performing any aditional cleanup. * * @param executionContext Smooks ExecutionContext */ protected void closeResource( final ExecutionContext executionContext ) { try { Closeable output = (Closeable) executionContext.getAttribute( OUTPUTSTREAM_CONTEXT_KEY_PREFIX + getResourceName() ); close( output ); } finally { executionContext.removeAttribute( OUTPUTSTREAM_CONTEXT_KEY_PREFIX + getResourceName() ); executionContext.removeAttribute( RESOURCE_CONTEXT_KEY_PREFIX + getResourceName() ); } }
/** * Close the resource output stream. * * Classes overriding this method must call super on this method. This will * probably need to be done before performing any aditional cleanup. * * @param executionContext Smooks ExecutionContext */ protected void closeResource( final ExecutionContext executionContext ) { try { Closeable output = (Closeable) executionContext.getAttribute( OUTPUTSTREAM_CONTEXT_KEY_PREFIX + getResourceName() ); close( output ); } finally { executionContext.removeAttribute( OUTPUTSTREAM_CONTEXT_KEY_PREFIX + getResourceName() ); executionContext.removeAttribute( RESOURCE_CONTEXT_KEY_PREFIX + getResourceName() ); } }
/** * Close the resource output stream. * <p/> * Classes overriding this method must call super on this method. This will * probably need to be done before performing any aditional cleanup. * * @param executionContext Smooks ExecutionContext */ protected void closeResource( final ExecutionContext executionContext ) { try { Closeable output = (Closeable) executionContext.getAttribute( OUTPUTSTREAM_CONTEXT_KEY_PREFIX + getResourceName() ); close( output ); } finally { executionContext.removeAttribute( OUTPUTSTREAM_CONTEXT_KEY_PREFIX + getResourceName() ); executionContext.removeAttribute( RESOURCE_CONTEXT_KEY_PREFIX + getResourceName() ); } }
public void executeVisitLifecycleCleanup(Fragment fragment, ExecutionContext executionContext) { try { ExecutionContext nestedExecutionContext = (ExecutionContext) executionContext.getAttribute(NestedExecutionVisitor.class); try { if(nestedExecutionContext != null) { BeanContext parentBeanContext = executionContext.getBeanContext(); BeanContext nestedBeanContext = nestedExecutionContext.getBeanContext(); for(BeanId beanId : mapBeanIds) { Object bean = nestedBeanContext.getBean(beanId.getName()); // Add the bean from the nested context onto the parent context and then remove // it again. This is enough to fire the wiring and end events... parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.START_FRAGMENT, beanId, bean)); parentBeanContext.addBean(beanId, bean); parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.END_FRAGMENT, beanId, bean)); parentBeanContext.removeBean(beanId, null); } } } finally { executionContext.removeAttribute(NestedExecutionVisitor.class); } } finally { AbstractParser.detachXMLReader(executionContext); } } }
public void executeVisitLifecycleCleanup(Fragment fragment, ExecutionContext executionContext) { try { ExecutionContext nestedExecutionContext = (ExecutionContext) executionContext.getAttribute(NestedExecutionVisitor.class); try { if(nestedExecutionContext != null) { BeanContext parentBeanContext = executionContext.getBeanContext(); BeanContext nestedBeanContext = nestedExecutionContext.getBeanContext(); for(BeanId beanId : mapBeanIds) { Object bean = nestedBeanContext.getBean(beanId.getName()); // Add the bean from the nested context onto the parent context and then remove // it again. This is enough to fire the wiring and end events... parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.START_FRAGMENT, beanId, bean)); parentBeanContext.addBean(beanId, bean); parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.END_FRAGMENT, beanId, bean)); parentBeanContext.removeBean(beanId, null); } } } finally { executionContext.removeAttribute(NestedExecutionVisitor.class); } } finally { AbstractParser.detachXMLReader(executionContext); } } }
public void executeVisitLifecycleCleanup(Fragment fragment, ExecutionContext executionContext) { try { ExecutionContext nestedExecutionContext = (ExecutionContext) executionContext.getAttribute(NestedExecutionVisitor.class); try { if(nestedExecutionContext != null) { BeanContext parentBeanContext = executionContext.getBeanContext(); BeanContext nestedBeanContext = nestedExecutionContext.getBeanContext(); for(BeanId beanId : mapBeanIds) { Object bean = nestedBeanContext.getBean(beanId.getName()); // Add the bean from the nested context onto the parent context and then remove // it again. This is enough to fire the wiring and end events... parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.START_FRAGMENT, beanId, bean)); parentBeanContext.addBean(beanId, bean); parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.END_FRAGMENT, beanId, bean)); parentBeanContext.removeBean(beanId, null); } } } finally { executionContext.removeAttribute(NestedExecutionVisitor.class); } } finally { AbstractParser.detachXMLReader(executionContext); } } }
public void executeVisitLifecycleCleanup(Fragment fragment, ExecutionContext executionContext) { try { ExecutionContext nestedExecutionContext = (ExecutionContext) executionContext.getAttribute(NestedExecutionVisitor.class); try { if(nestedExecutionContext != null) { BeanContext parentBeanContext = executionContext.getBeanContext(); BeanContext nestedBeanContext = nestedExecutionContext.getBeanContext(); for(BeanId beanId : mapBeanIds) { Object bean = nestedBeanContext.getBean(beanId.getName()); // Add the bean from the nested context onto the parent context and then remove // it again. This is enough to fire the wiring and end events... parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.START_FRAGMENT, beanId, bean)); parentBeanContext.addBean(beanId, bean); parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.END_FRAGMENT, beanId, bean)); parentBeanContext.removeBean(beanId, null); } } } finally { executionContext.removeAttribute(NestedExecutionVisitor.class); } } finally { AbstractParser.detachXMLReader(executionContext); } } }