public synchronized void init() { final InterceptorFactoryContext context = new SimpleInterceptorFactoryContext(); context.getContextData().put(Component.class, this); createInterceptors(context); }
@Override public synchronized void start(final StartContext context) throws StartException { SimpleInterceptorFactoryContext factoryContext = new SimpleInterceptorFactoryContext(); factoryContext.getContextData().put(Component.class, ejbComponent.getValue()); Map<Method, Interceptor> interceptors = new HashMap<Method, Interceptor>(); for(Map.Entry<Method, InterceptorFactory> entry : ejbComponent.getValue().getTimeoutInterceptors().entrySet()) { interceptors.put(entry.getKey(), entry.getValue().create(factoryContext)); } this.timeoutInterceptors = interceptors; started = true; }
void initializeInterceptors() { final SimpleInterceptorFactoryContext factoryContext = new SimpleInterceptorFactoryContext(); final Map<Method, InterceptorFactory> viewInterceptorFactories = ViewService.this.viewInterceptorFactories; final Map<Method, Interceptor> viewEntryPoints = viewInterceptors; factoryContext.getContextData().put(Component.class, component); //we don't have this code in the constructor so we avoid passing around //a half constructed instance factoryContext.getContextData().put(ComponentView.class, this); for (Method method : viewInterceptorFactories.keySet()) { viewEntryPoints.put(method, viewInterceptorFactories.get(method).create(factoryContext)); methods.put(new MethodDescription(method.getName(), DescriptorUtils.methodDescriptor(method)), method); } }
public void start(final StartContext context) throws StartException { // Construct the view View view = new View(privateData); view.initializeInterceptors(); this.view = view; final SimpleInterceptorFactoryContext factoryContext = new SimpleInterceptorFactoryContext(); final Component component = view.getComponent(); factoryContext.getContextData().put(Component.class, component); factoryContext.getContextData().put(ComponentView.class, view); clientPostConstructInterceptor = clientPostConstruct.create(factoryContext); clientPreDestroyInterceptor = clientPreDestroy.create(factoryContext); final Map<Method, InterceptorFactory> clientInterceptorFactories = ViewService.this.clientInterceptorFactories; clientInterceptors = new IdentityHashMap<Method, Interceptor>(clientInterceptorFactories.size()); for (Method method : clientInterceptorFactories.keySet()) { clientInterceptors.put(method, clientInterceptorFactories.get(method).create(factoryContext)); } }
/** * {@inheritDoc} */ public ComponentInstance createInstance() { BasicComponentInstance instance = constructComponentInstance(null, true, new SimpleInterceptorFactoryContext()); return instance; }
public synchronized void init() { final InterceptorFactoryContext context = new SimpleInterceptorFactoryContext(); context.getContextData().put(Component.class, this); createInterceptors(context); }
public synchronized void init() { final InterceptorFactoryContext context = new SimpleInterceptorFactoryContext(); context.getContextData().put(Component.class, this); createInterceptors(context); }
protected Interceptor createInterceptor(final InterceptorFactory factory) { if (factory == null) return null; final InterceptorFactoryContext context = new SimpleInterceptorFactoryContext(); context.getContextData().put(Component.class, this); return factory.create(context); }
@Override public synchronized void start(final StartContext context) throws StartException { SimpleInterceptorFactoryContext factoryContext = new SimpleInterceptorFactoryContext(); factoryContext.getContextData().put(Component.class, ejbComponent.getValue()); Map<Method, Interceptor> interceptors = new HashMap<Method, Interceptor>(); for(Map.Entry<Method, InterceptorFactory> entry : ejbComponent.getValue().getTimeoutInterceptors().entrySet()) { interceptors.put(entry.getKey(), entry.getValue().create(factoryContext)); } this.timeoutInterceptors = interceptors; started = true; }
void initializeInterceptors() { final SimpleInterceptorFactoryContext factoryContext = new SimpleInterceptorFactoryContext(); final Map<Method, InterceptorFactory> viewInterceptorFactories = ViewService.this.viewInterceptorFactories; final Map<Method, Interceptor> viewEntryPoints = viewInterceptors; factoryContext.getContextData().put(Component.class, component); //we don't have this code in the constructor so we avoid passing around //a half constructed instance factoryContext.getContextData().put(ComponentView.class, this); for (Method method : viewInterceptorFactories.keySet()) { viewEntryPoints.put(method, viewInterceptorFactories.get(method).create(factoryContext)); methods.put(new MethodDescription(method.getName(), DescriptorUtils.methodDescriptor(method)), method); } }
void initializeInterceptors() { final SimpleInterceptorFactoryContext factoryContext = new SimpleInterceptorFactoryContext(); final Map<Method, InterceptorFactory> viewInterceptorFactories = ViewService.this.viewInterceptorFactories; final Map<Method, Interceptor> viewEntryPoints = viewInterceptors; factoryContext.getContextData().put(Component.class, component); //we don't have this code in the constructor so we avoid passing around //a half constructed instance factoryContext.getContextData().put(ComponentView.class, this); for (Method method : viewInterceptorFactories.keySet()) { viewEntryPoints.put(method, viewInterceptorFactories.get(method).create(factoryContext)); methods.put(new MethodDescription(method.getName(), DescriptorUtils.methodDescriptor(method)), method); } }
void initializeInterceptors() { final SimpleInterceptorFactoryContext factoryContext = new SimpleInterceptorFactoryContext(); final Map<Method, InterceptorFactory> viewInterceptorFactories = ViewService.this.viewInterceptorFactories; final Map<Method, Interceptor> viewEntryPoints = viewInterceptors; factoryContext.getContextData().put(Component.class, component); //we don't have this code in the constructor so we avoid passing around //a half constructed instance factoryContext.getContextData().put(ComponentView.class, this); for (Method method : viewInterceptorFactories.keySet()) { viewEntryPoints.put(method, viewInterceptorFactories.get(method).create(factoryContext)); methods.put(new MethodDescription(method.getName(), DescriptorUtils.methodDescriptor(method)), method); } }
public void start(final StartContext context) throws StartException { // Construct the view View view = new View(privateData); view.initializeInterceptors(); this.view = view; final SimpleInterceptorFactoryContext factoryContext = new SimpleInterceptorFactoryContext(); final Component component = view.getComponent(); factoryContext.getContextData().put(Component.class, component); factoryContext.getContextData().put(ComponentView.class, view); clientPostConstructInterceptor = clientPostConstruct.create(factoryContext); clientPreDestroyInterceptor = clientPreDestroy.create(factoryContext); final Map<Method, InterceptorFactory> clientInterceptorFactories = ViewService.this.clientInterceptorFactories; clientInterceptors = new IdentityHashMap<Method, Interceptor>(clientInterceptorFactories.size()); for (Method method : clientInterceptorFactories.keySet()) { clientInterceptors.put(method, clientInterceptorFactories.get(method).create(factoryContext)); } }
public void start(final StartContext context) throws StartException { // Construct the view View view = new View(privateData); view.initializeInterceptors(); this.view = view; final SimpleInterceptorFactoryContext factoryContext = new SimpleInterceptorFactoryContext(); final Component component = view.getComponent(); factoryContext.getContextData().put(Component.class, component); factoryContext.getContextData().put(ComponentView.class, view); clientPostConstructInterceptor = clientPostConstruct.create(factoryContext); clientPreDestroyInterceptor = clientPreDestroy.create(factoryContext); final Map<Method, InterceptorFactory> clientInterceptorFactories = ViewService.this.clientInterceptorFactories; clientInterceptors = new IdentityHashMap<Method, Interceptor>(clientInterceptorFactories.size()); for (Method method : clientInterceptorFactories.keySet()) { clientInterceptors.put(method, clientInterceptorFactories.get(method).create(factoryContext)); } }
private Object readResolve() throws ObjectStreamException { ServiceName name = ServiceName.parse(serviceName); ServiceController<?> service = currentServiceContainer().getRequiredService(name); StatefulSessionComponent component = (StatefulSessionComponent) service.getValue(); final InterceptorFactoryContext context = new SimpleInterceptorFactoryContext(); for(final Map.Entry<Object, Object> entry : serializableInterceptors.entrySet()) { AtomicReference<ManagedReference> referenceReference = new AtomicReference<ManagedReference>(new ValueManagedReference(new ImmediateValue<Object>(entry.getValue()))); context.getContextData().put(entry.getKey(), referenceReference); } context.getContextData().put(SessionID.class, sessionID); return component.constructComponentInstance(instance, false, context); }
/** * Wraps an existing object instance in a ComponentInstance, and run the post construct interceptor chain on it. * @param instance The instance to wrap * @return The new ComponentInstance */ public ComponentInstance createInstance(Object instance) { BasicComponentInstance obj = constructComponentInstance(new ValueManagedReference(new ImmediateValue<Object>(instance)), true, new SimpleInterceptorFactoryContext()); return obj; }
public ManagedReference createViewInstance(final ComponentView componentView, final Map<Object, Object> contextData) throws Exception { final SimpleInterceptorFactoryContext factoryContext = new SimpleInterceptorFactoryContext(); final Component component = componentView.getComponent(); factoryContext.getContextData().put(Component.class, component);