Examples of ManagedReferenceFactory


Examples of org.jboss.as.naming.ManagedReferenceFactory

                throw new RuntimeException(e);
            } catch (NoSuchMethodException e) {
                throw new RuntimeException(e);
            }

            ManagedReferenceFactory factory = new ValueManagedObject(getObjectInstanceValue);
            serviceBuilder.addInjection(injector, factory);
        }
View Full Code Here

Examples of org.jboss.as.naming.ManagedReferenceFactory

                userAroundTimeoutsByInterceptorClass = null;
            }


            // Primary instance
            final ManagedReferenceFactory instanceFactory = configuration.getInstanceFactory();
            if (instanceFactory != null) {
                instantiators.addFirst(new ManagedReferenceInterceptorFactory(instanceFactory, instanceKey));
            } else {
                //use the default constructor if no instanceFactory has been set
                final Constructor<Object> constructor = (Constructor<Object>) componentClassIndex.getConstructor(EMPTY_CLASS_ARRAY);
View Full Code Here

Examples of org.jboss.as.naming.ManagedReferenceFactory

            }
        } else {
            type = null;
        }

        injector.inject(new ManagedReferenceFactory() {
            @Override
            public ManagedReference getReference() {
                try {
                    final Object value = new InitialContext().lookup(lookup);
View Full Code Here

Examples of org.jboss.as.naming.ManagedReferenceFactory

            if (server.getOutgoingSocketBinding() != null) {
                addOutboundSocketDependency(service, mailSessionBuilder, server);
            }
        }

        final ManagedReferenceFactory valueManagedReferenceFactory = new MailSessionManagedReferenceFactory(service);
        final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(jndiName);
        final BinderService binderService = new BinderService(bindInfo.getBindName());
        final ServiceBuilder<?> binderBuilder = serviceTarget
                .addService(bindInfo.getBinderServiceName(), binderService)
                .addInjection(binderService.getManagedObjectInjector(), valueManagedReferenceFactory)
View Full Code Here

Examples of org.jboss.as.naming.ManagedReferenceFactory

    public Object newInstance(String className) throws IllegalAccessException, InvocationTargetException, NamingException, InstantiationException, ClassNotFoundException {
        return newInstance(classloader.loadClass(className));
    }

    public Object newInstance(Class<?> clazz) throws IllegalAccessException, InvocationTargetException, NamingException, InstantiationException {
        final ManagedReferenceFactory factory = componentRegistry.createInstanceFactory(clazz);
        ManagedReference reference = factory.getReference();
        if (reference != null) {
            instanceMap.put(reference.getInstance(), reference);
            return reference.getInstance();
        }
        return clazz.newInstance();
View Full Code Here

Examples of org.jboss.as.naming.ManagedReferenceFactory

                    targetInjector.uninject();
                }
                @Override
                public void inject(final NamingStore value) throws InjectionException {
                    final NamingContext storeBaseContext = new NamingContext(value, null);
                    final ManagedReferenceFactory factory = new ManagedReferenceFactory() {
                        @Override
                        public ManagedReference getReference() {
                            try {
                                return new ImmediateManagedReference(storeBaseContext.lookup(getBindName()));
                            } catch (NamingException e) {
View Full Code Here

Examples of org.jboss.as.naming.ManagedReferenceFactory

            @Override
            public void getResourceValue(ResolutionContext resolutionContext, ServiceBuilder<?> serviceBuilder, DeploymentPhaseContext phaseContext, Injector<ManagedReferenceFactory> injector) throws DeploymentUnitProcessingException {
                final InjectedValue<ManagedReferenceFactory> delegateInjection = new InjectedValue<>();
                delegate.getResourceValue(resolutionContext, serviceBuilder, phaseContext, delegateInjection);
                injector.inject(new ManagedReferenceFactory() {
                    @Override
                    public ManagedReference getReference() {
                        ControlPoint cp = controlPointInjectedValue.getValue();
                        try {
                            RunResult res = cp.beginRequest();
View Full Code Here

Examples of org.jboss.as.naming.ManagedReferenceFactory

            bindingMap.put(bindingName, bindingName);
        }

        for (String refKey : bindingMap.keySet()) {
            String refName = bindingMap.get(refKey);
            ManagedReferenceFactory factory = WebServiceReferences.createWebServiceFactory(unit, type, annotation, target, refName, refKey);
            final EEModuleClassDescription classDescription = moduleDescription.addOrGetLocalClassDescription(classInfo.name().toString());
            // Create the binding from whence our injection comes.
            final InjectionSource serviceRefSource = new FixedInjectionSource(factory, factory);
            final BindingConfiguration bindingConfiguration = new BindingConfiguration(refName, serviceRefSource);
            classDescription.getBindingConfigurations().add(bindingConfiguration);
View Full Code Here

Examples of org.jboss.as.naming.ManagedReferenceFactory

        final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(name);
        ServiceController<?> bindingService = container.getService(bindInfo.getBinderServiceName());
        if (bindingService == null) {
            return null;
        }
        ManagedReferenceFactory managedReferenceFactory = ManagedReferenceFactory.class.cast(bindingService.getValue());
        return managedReferenceFactory.getReference().getInstance();
    }
View Full Code Here

Examples of org.jboss.as.naming.ManagedReferenceFactory

        final ContextNames.BindInfo ejbBindInfo = getBindInfo(result);

        /*
         * Try to obtain ManagedReferenceFactory and validate the resource type
         */
        final ManagedReferenceFactory factory = getManagedReferenceFactory(ejbBindInfo);
        validateResourceInjectionPointType(factory, injectionPoint);

        if (factory != null) {
            return new ManagedReferenceFactoryToResourceReferenceFactoryAdapter<Object>(factory);
        } else {
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.