Package org.jboss.as.naming

Examples of org.jboss.as.naming.ValueManagedReference


    private final InjectedValue<Object> adminObjectValue = new InjectedValue<Object>();

    private ManagedReference reference;

    public synchronized void start(StartContext startContext) throws StartException {
        reference = new ValueManagedReference(new ImmediateValue<Object>(adminObjectValue.getValue()));
    }
View Full Code Here


    private final InjectedValue<Object> connectionFactoryValue = new InjectedValue<Object>();

    private ManagedReference reference;

    public synchronized void start(StartContext startContext) throws StartException {
        reference = new ValueManagedReference(new ImmediateValue<Object>(connectionFactoryValue.getValue()));
    }
View Full Code Here

                } catch (IllegalAccessException e) {
                    throw MESSAGES.cannotGetSessionFactory(e);
                } catch (InvocationTargetException e) {
                    throw MESSAGES.cannotGetSessionFactory(e);
                }
                return new ValueManagedReference(new ImmediateValue<Object>(targetValueToInject));
            }

            return new ValueManagedReference(new ImmediateValue<Object>(emf));
        }
View Full Code Here

                                );

                if (JPA_LOGGER.isDebugEnabled())
                    JPA_LOGGER.debugf("injecting entity manager into a '%s' (unit name=%s)", extensionClass.getName(), unitName);

                return new ValueManagedReference(new ImmediateValue<Object>(proxyForUnwrappedObject));
            }

            return new ValueManagedReference(new ImmediateValue<Object>(entityManager));
        }
View Full Code Here

        final ManagedReferenceFactory valueManagedReferenceFactory = new ManagedReferenceFactory() {

            @Override
            public ManagedReference getReference() {
                return new ValueManagedReference(new ImmediateValue<Object>(service.getValue()));
            }
        };
        final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(jndiName);
        final BinderService binderService = new BinderService(bindInfo.getBindName());
        final ServiceBuilder<?> binderBuilder = serviceTarget
View Full Code Here

    }

    @Override
    public ManagedReference createViewInstance(final ComponentView componentView, final Map<Object, Object> contextData) {
        Object value = EJBClient.createProxy(new EJBHomeLocator(componentView.getViewClass(), applicationName, moduleName, beanName, distinctName));
        return new ValueManagedReference(new ImmediateValue(value));
    }
View Full Code Here

    }

    @Override
    public ManagedReference createViewInstance(final ComponentView componentView, final Map<Object, Object> contextData) {
        Object value = EJBClient.createProxy(new StatelessEJBLocator(componentView.getViewClass(), applicationName, moduleName, beanName, distinctName));
        return new ValueManagedReference(new ImmediateValue(value));
    }
View Full Code Here

        } else {
            ejbLocator = new StatelessEJBLocator(viewClass, appName, moduleName, beanName, distinctName);
        }
        final Object proxy = EJBClient.createProxy(ejbLocator);

        return new ValueManagedReference(new ImmediateValue<Object>(proxy));
    }
View Full Code Here

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

            final ConstructedValue interceptorInstanceValue = new ConstructedValue(interceptorConstructor, Collections.<Value<?>>emptyList());
            // we *don't* create multiple instances of the container-interceptor class, but we just reuse a single instance and it's *not*
            // tied to the EJB component instance lifecycle.
            final CachedValue cachedInterceptorInstanceValue = new CachedValue(interceptorInstanceValue);
            // ultimately create the managed reference which is backed by the CachedValue
            final ManagedReference interceptorInstanceRef = new ValueManagedReference(cachedInterceptorInstanceValue);
            // return the ContainerInterceptorMethodInterceptorFactory which is responsible for creating a Interceptor
            // which can invoke the container-interceptor's around-invoke/around-timeout methods
            return new ContainerInterceptorMethodInterceptorFactory(interceptorInstanceRef, method);
        }
View Full Code Here

TOP

Related Classes of org.jboss.as.naming.ValueManagedReference

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.