Package org.jboss.invocation

Examples of org.jboss.invocation.SimpleInterceptorFactoryContext


    /**
     * {@inheritDoc}
     */
    public ComponentInstance createInstance() {
        BasicComponentInstance instance = constructComponentInstance(null, true, new SimpleInterceptorFactoryContext());
        return instance;
    }
View Full Code Here


     * 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;
    }
View Full Code Here

        this.relationInterceptorFactory = ejbComponentCreateService.getRelationInterceptorFactory();
        this.transactionEntityMap = ejbComponentCreateService.getTransactionEntityMap();
    }

    protected BasicComponentInstance instantiateComponentInstance(final AtomicReference<ManagedReference> instanceReference, final Interceptor preDestroyInterceptor, final Map<Method, Interceptor> methodInterceptors, final InterceptorFactoryContext interceptorContext) {
        final SimpleInterceptorFactoryContext factoryContext = new SimpleInterceptorFactoryContext();
        factoryContext.getContextData().put(Component.class, this);
        final Interceptor interceptor = relationInterceptorFactory.create(factoryContext);
        return new CmpEntityBeanComponentInstance(this, instanceReference, preDestroyInterceptor, methodInterceptors, interceptor);
    }
View Full Code Here

//    }

    protected Interceptor createInterceptor(final InterceptorFactory factory) {
        if (factory == null)
            return null;
        final SimpleInterceptorFactoryContext context = new SimpleInterceptorFactoryContext();
        context.getContextData().put(Component.class, this);
        return factory.create(context);
    }
View Full Code Here

     * @param instance An instance to be wrapped, or null if a new instance should be created
     * @return the component instance
     */
    protected final BasicComponentInstance constructComponentInstance(ManagedReference instance) {
        // Interceptor factory context
        final SimpleInterceptorFactoryContext context = new SimpleInterceptorFactoryContext();
        context.getContextData().put(Component.class, this);

        // Create the post-construct interceptors for the ComponentInstance
        final Interceptor componentInstancePostConstructInterceptor = this.getPostConstruct().create(context);
        // create the pre-destroy interceptors
        final Interceptor componentInstancePreDestroyInterceptor = this.getPreDestroy().create(context);

        final AtomicReference<ManagedReference> instanceReference = (AtomicReference<ManagedReference>) context.getContextData().get(BasicComponentInstance.INSTANCE_KEY);

        instanceReference.set(instance);

        final Map<Method, InterceptorFactory> interceptorFactoryMap = this.getInterceptorFactoryMap();
        // This is an identity map.  This means that only <b>certain</b> {@code Method} objects will
View Full Code Here

            this.viewInterceptors = new IdentityHashMap<Method, Interceptor>();
            this.methods = new HashMap<MethodDescription, 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);
            }
View Full Code Here

    }

    private class DefaultViewInstanceFactory implements ViewInstanceFactory {

        public ManagedReference createViewInstance(final ComponentView componentView, final Map<Object, Object> contextData) {
            final SimpleInterceptorFactoryContext factoryContext = new SimpleInterceptorFactoryContext();
            final Component component = componentView.getComponent();
            factoryContext.getContextData().put(Component.class, component);
            factoryContext.getContextData().put(ComponentView.class, componentView);
            factoryContext.getContextData().putAll(contextData);

            final Interceptor clientPostConstructInterceptor = clientPostConstruct.create(factoryContext);
            final Interceptor clientPreDestroyInterceptor = clientPreDestroy.create(factoryContext);

            final Map<Method, InterceptorFactory> clientInterceptorFactories = ViewService.this.clientInterceptorFactories;
View Full Code Here

        this.relationInterceptorFactory = ejbComponentCreateService.getRelationInterceptorFactory();
        this.transactionEntityMap = ejbComponentCreateService.getTransactionEntityMap();
    }

    protected BasicComponentInstance instantiateComponentInstance(final AtomicReference<ManagedReference> instanceReference, final Interceptor preDestroyInterceptor, final Map<Method, Interceptor> methodInterceptors, final InterceptorFactoryContext interceptorContext) {
        final SimpleInterceptorFactoryContext factoryContext = new SimpleInterceptorFactoryContext();
        factoryContext.getContextData().put(Component.class, this);
        final Interceptor interceptor = relationInterceptorFactory.create(factoryContext);

        return new CmpEntityBeanComponentInstance(this, instanceReference, preDestroyInterceptor, methodInterceptors, interceptor);
    }
View Full Code Here

        this.transactionEntityMap = ejbComponentCreateService.getTransactionEntityMap();
        this.cmp10 = ejbComponentCreateService.getEntityMetaData().isCMP1x();
    }

    protected BasicComponentInstance instantiateComponentInstance(final AtomicReference<ManagedReference> instanceReference, final Interceptor preDestroyInterceptor, final Map<Method, Interceptor> methodInterceptors, final InterceptorFactoryContext interceptorContext) {
        final InterceptorFactoryContext context = new SimpleInterceptorFactoryContext();
        context.getContextData().put(Component.class, this);
        final Interceptor interceptor = relationInterceptorFactory.create(context);
        return new CmpEntityBeanComponentInstance(this, instanceReference, preDestroyInterceptor, methodInterceptors, interceptor);
    }
View Full Code Here

//    }

    protected Interceptor createInterceptor(final InterceptorFactory factory) {
        if (factory == null)
            return null;
        final SimpleInterceptorFactoryContext context = new SimpleInterceptorFactoryContext();
        context.getContextData().put(Component.class, this);
        return factory.create(context);
    }
View Full Code Here

TOP

Related Classes of org.jboss.invocation.SimpleInterceptorFactoryContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.