Package org.jboss.as.ee.component

Examples of org.jboss.as.ee.component.ComponentInstance


                final ServiceName handlerComponentName = getHandlerComponentServiceName(className);
                final ServiceController<BasicComponent> handlerComponentController = getComponentController(handlerComponentName);
                if (handlerComponentController != null) {
                    // we support initialization only on non system JAXWS handlers
                    final BasicComponent handlerComponent = handlerComponentController.getValue();
                    final ComponentInstance handlerComponentInstance = handlerComponent.createInstance(delegate.getInstance(className).getValue());
                    final Object handlerInstance = handlerComponentInstance.getInstance();
                    // mark reference as initialized because JBoss server initialized it
                    final Reference handlerReference = ReferenceFactory.newInitializedReference(handlerInstance);
                    return cacheAndGet(handlerReference);
                }
            }
View Full Code Here


    @Override
    public Object processInvocation(InterceptorContext interceptorContext) throws Exception {
        SingletonComponent singletonComponent = getComponent(interceptorContext, SingletonComponent.class);
        // get the component instance
        ComponentInstance singletonComponentInstance = singletonComponent.getComponentInstance();
        if (singletonComponent == null) {
            throw new Exception("Component instance isn't available for invocation: " + interceptorContext);
        }
        interceptorContext.putPrivateData(ComponentInstance.class, singletonComponentInstance);
        return interceptorContext.proceed();
View Full Code Here

    }

    @Override
    public Object processInvocation(InterceptorContext context) throws Exception {
        PooledComponent<ComponentInstance> component = getComponent(context, PooledComponent.class);
        ComponentInstance instance = component.getPool().get();
        context.putPrivateData(ComponentInstance.class, instance);
        try {
            return context.proceed();
        }
        finally {
View Full Code Here

        Component component = context.getPrivateData(Component.class);
        if (component == null) {
            throw new IllegalStateException("Component not set in InterceptorContext: " + context);
        }
        // TODO: should be getInstance()
        ComponentInstance componentInstance = component.createInstance();
        // add it to the interceptor context
        context.putPrivateData(ComponentInstance.class, componentInstance);

        // proceed
        return context.proceed();
View Full Code Here

    protected SFSBInvocationInterceptor() {
    }

    @Override
    public Object processInvocation(InterceptorContext context) throws Exception {
        ComponentInstance componentInstance = context.getPrivateData(ComponentInstance.class);
        if (componentInstance == null) {
            throw new IllegalStateException("componentInstance not set in InterceptorContext: " + context);
        }
        StatefulSessionComponentInstance sfsb = (StatefulSessionComponentInstance) componentInstance;
        SFSBContextHandleImpl sfsbContextHandle = new SFSBContextHandleImpl(sfsb);
View Full Code Here

            XBundle bundle = injectedBundle.getValue();
            Deployment deployment = depUnit.getAttachment(OSGiConstants.DEPLOYMENT_KEY);
            BundleManager bundleManager = depUnit.getAttachment(OSGiConstants.BUNDLE_MANAGER_KEY);
            Component activatorComponent = injectedComponent.getOptionalValue();
            if (activatorComponent != null && deployment.getAttachment(BundleActivator.class) == null) {
                ComponentInstance componentInstance = activatorComponent.createInstance();
                BundleActivator instance = (BundleActivator) componentInstance.getInstance();
                deployment.addAttachment(BundleActivator.class, instance);
            }
            OperationAssociation.INSTANCE.setAssociation(new ModelNode("deploy"));
            try {
                bundleManager.startBundle(bundle, Bundle.START_ACTIVATION_POLICY);
View Full Code Here

    /** {@inheritDoc} */
    @Override
    public Interceptor createClientInterceptor(final Class<?> viewClass) {
        // One instance per client lookup.
        final ComponentInstance instance = createInstance();
        return new Interceptor() {
            public Object processInvocation(final InterceptorContext context) throws Exception {
                context.putPrivateData(ComponentInstance.class, instance);
                return context.proceed();
            }
View Full Code Here

        final InterceptorContext context = CurrentInvocationContext.get();

        if (context == null) {
            return null;
        }
        final ComponentInstance instance = context.getPrivateData(ComponentInstance.class);
        if (instance instanceof EntityBeanComponentInstance) {
            return ((EntityBeanComponentInstance) instance).getPrimaryKey();
        }
        return null;
    }
View Full Code Here

        public InstanceMethodInvokingInterceptor(final Method componentMethod) {
            this.componentMethod = componentMethod;
        }

        public Object processInvocation(final InterceptorContext context) throws Exception {
            final ComponentInstance componentInstance = context.getPrivateData(ComponentInstance.class);
            if (componentInstance == null) {
                throw CmpMessages.MESSAGES.noComponentInstanceAssociated();
            }
            //for CMP beans we invoke directly on the instance, bypassing the interceptor chain
            return componentMethod.invoke(componentInstance.getInstance(), context.getParameters());
        }
View Full Code Here

TOP

Related Classes of org.jboss.as.ee.component.ComponentInstance

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.