Examples of ValueManagedReference


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

Examples of org.jboss.as.naming.ValueManagedReference

    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

Examples of org.jboss.as.naming.ValueManagedReference

        this.factory = factory;
    }

    @Override
    public ManagedReference getReference() {
        return new ValueManagedReference(new ImmediateValue<Object>(factory.getValidator()));
    }
View Full Code Here

Examples of org.jboss.as.naming.ValueManagedReference

                        //we need a newURI every time
                        bindingConfiguration = new BindingConfiguration(name, new FixedInjectionSource(new ManagedReferenceFactory() {
                            @Override
                            public ManagedReference getReference() {
                                try {
                                    return new ValueManagedReference(new ImmediateValue(new URI(resourceRef.getResUrl())));
                                } catch (URISyntaxException e) {
                                    throw new RuntimeException(e);
                                }
                            }
                        }, new URI(resourceRef.getResUrl())));
                    } catch (URISyntaxException e) {
                        throw MESSAGES.cannotParseResourceRefUri(e, resourceRef.getResUrl());
                    }
                } else {
                    try {
                        bindingConfiguration = new BindingConfiguration(name, new FixedInjectionSource(new ManagedReferenceFactory() {
                            @Override
                            public ManagedReference getReference() {
                                try {
                                    return new ValueManagedReference(new ImmediateValue(new URL(resourceRef.getResUrl())));
                                } catch (MalformedURLException e) {
                                    throw new RuntimeException(e);
                                }
                            }
                        }, new URL(resourceRef.getResUrl())));
View Full Code Here

Examples of org.jboss.as.naming.ValueManagedReference

        @Override
        public ManagedReference getReference() {
            try {
                Object value = new InitialContext().lookup(lookupName);
                return new ValueManagedReference(new ImmediateValue<Object>(value));
            } catch (NamingException e) {
                return null;
            }
        }
View Full Code Here

Examples of org.jboss.as.naming.ValueManagedReference

     * 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

Examples of org.jboss.as.naming.ValueManagedReference

    private final InjectedValue<DataSource> dataSourceValue = new InjectedValue<DataSource>();

    private ManagedReference reference;

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

Examples of org.jboss.as.naming.ValueManagedReference

            final AtomicReference<ManagedReference> reference = (AtomicReference<ManagedReference>) context.getContextData().get(interceptionType);
            if (reference != null) {
                return (org.jboss.invocation.Interceptor) reference.get().getInstance();
            } else {
                final Jsr299BindingsInterceptor interceptor =  new Jsr299BindingsInterceptor((BeanManagerImpl) weldContainer.getValue().getBeanManager(beanArchiveId), ejbName, context, interceptionType, classLoader);
                context.getContextData().put(interceptionType, new AtomicReference<ManagedReference>(new ValueManagedReference(new ImmediateValue<Object>(interceptor))));
                return interceptor;
            }
        }
View Full Code Here

Examples of org.jboss.as.naming.ValueManagedReference

            loader = SecurityActions.getModuleClassLoader();
        } catch (ModuleLoadException e) {
            throw new IllegalStateException("Unable to get module classloader", e);
        }
        Class<?>[] interfaces = { Context.class };
        return new ValueManagedReference(new ImmediateValue<Object>(Proxy.newProxyInstance(loader, interfaces, this)));
    }
View Full Code Here

Examples of org.jboss.as.naming.ValueManagedReference

            HashMap<String, ReferenceCountedEntityManager> entityManagers;
            if (context.getContextData().containsKey(SFSBInvocationInterceptor.CONTEXT_KEY)) {
                entityManagers = (HashMap<String, ReferenceCountedEntityManager>) ((AtomicReference<ManagedReference>) context.getContextData().get(SFSBInvocationInterceptor.CONTEXT_KEY)).get().getInstance();
            } else {
                entityManagers = new HashMap<String, ReferenceCountedEntityManager>();
                context.getContextData().put(SFSBInvocationInterceptor.CONTEXT_KEY, new AtomicReference<ManagedReference>(new ValueManagedReference(new ImmediateValue<Object>(entityManagers))));
            }
            return new SFSBCreateInterceptor(entityManagers);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.