Examples of ValueManagedReferenceFactory


Examples of org.jboss.as.naming.ValueManagedReferenceFactory

                //use the default constructor if no instanceFactory has been set
                final Constructor<Object> constructor = (Constructor<Object>) componentClassIndex.getConstructor(EMPTY_CLASS_ARRAY);
                if (constructor == null) {
                    throw new DeploymentUnitProcessingException("Could not find default constructor for " + componentClassConfiguration.getModuleClass());
                }
                ValueManagedReferenceFactory factory = new ValueManagedReferenceFactory(new ConstructedValue<Object>(constructor, Collections.<Value<?>>emptyList()));
                instantiators.addFirst(new ManagedReferenceInterceptorFactory(factory, instanceKey));
            }
            destructors.addLast(new ManagedReferenceReleaseInterceptorFactory(instanceKey));

            new ClassDescriptionTraversal(componentClassConfiguration, applicationDescription) {
View Full Code Here

Examples of org.jboss.as.naming.ValueManagedReferenceFactory

        final ServiceTarget serviceTarget = context.getServiceTarget();
        final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(name);

        final BinderService binderService = new BinderService(name, bindValue);
        binderService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(new ImmediateValue<Object>(bindValue)));

        ServiceBuilder<ManagedReferenceFactory> builder = serviceTarget.addService(bindInfo.getBinderServiceName(), binderService)
                .addDependency(bindInfo.getParentContextServiceName(), ServiceBasedNamingStore.class, binderService.getNamingStoreInjector());

        if (verificationHandler != null) {
View Full Code Here

Examples of org.jboss.as.naming.ValueManagedReferenceFactory

                            serviceTarget.addService(bindingInfo.getBinderServiceName(), binderService)
                                    .addDependency(bindingInfo.getParentContextServiceName(), ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
                                    .addDependency(puServiceName, PersistenceUnitService.class, new Injector<PersistenceUnitService>() {
                                        @Override
                                        public void inject(final PersistenceUnitService value) throws InjectionException {
                                            binderService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(new ImmediateValue<Object>(value.getEntityManagerFactory())));
                                        }

                                        @Override
                                        public void uninject() {
                                            binderService.getNamingStoreInjector().uninject();
View Full Code Here

Examples of org.jboss.as.naming.ValueManagedReferenceFactory

        }
        final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(name);
        final BinderService binderService = new BinderService(bindInfo.getBindName());
        container.addService(bindInfo.getBinderServiceName(), binderService)
                .addDependency(bindInfo.getParentContextServiceName(), ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
                .addInjection(binderService.getManagedObjectInjector(), new ValueManagedReferenceFactory(Values.immediateValue(obj)))
                .setInitialMode(ServiceController.Mode.ACTIVE)
                .install();
        ROOT_LOGGER.boundJndiName(bindInfo.getAbsoluteJndiName());
        return true;
    }
View Full Code Here

Examples of org.jboss.as.naming.ValueManagedReferenceFactory

        serviceTarget.addService(moduleContextServiceName, contextService).install();

        final BinderService moduleNameBinder = new BinderService("ModuleName");

        serviceTarget.addService(moduleContextServiceName.append("ModuleName"), moduleNameBinder)
                .addInjection(moduleNameBinder.getManagedObjectInjector(), new ValueManagedReferenceFactory(Values.immediateValue(moduleDescription.getModuleName())))
                .addDependency(moduleContextServiceName, ServiceBasedNamingStore.class, moduleNameBinder.getNamingStoreInjector())
                .install();

        deploymentUnit.putAttachment(MODULE_CONTEXT_CONFIG, moduleContextServiceName);
View Full Code Here

Examples of org.jboss.as.naming.ValueManagedReferenceFactory

                    } catch (Exception e) {
                        logger.warn("Transactional datasource " + className + " could not be proxied and will not be enlisted in transactions automatically", e);
                    }
                }
            }
            injector.inject(new ValueManagedReferenceFactory(Values.immediateValue(object)));
        } catch (Exception e) {
            throw new DeploymentUnitProcessingException(e);
        }
    }
View Full Code Here

Examples of org.jboss.as.naming.ValueManagedReferenceFactory

     * @param contextServiceName The service name of the context to bind to
     */
    private void bindServices(LazyValidatorFactory factory, ServiceTarget serviceTarget, EEModuleDescription description, String componentName, ServiceName contextServiceName) {

        BinderService validatorFactoryBindingService = new BinderService("ValidatorFactory");
        validatorFactoryBindingService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(new ImmediateValue<Object>(factory)));
        serviceTarget.addService(contextServiceName.append("ValidatorFactory"), validatorFactoryBindingService)
            .addDependency(contextServiceName, ServiceBasedNamingStore.class, validatorFactoryBindingService.getNamingStoreInjector())
            .install();

        BinderService validatorBindingService = new BinderService("Validator");
View Full Code Here

Examples of org.jboss.as.naming.ValueManagedReferenceFactory

                //use the default constructor if no instanceFactory has been set
                final Constructor<Object> constructor = (Constructor<Object>) componentClassIndex.getConstructor(EMPTY_CLASS_ARRAY);
                if (constructor == null) {
                    throw new DeploymentUnitProcessingException("Could not find default constructor for " + componentClassConfiguration.getModuleClass());
                }
                ValueManagedReferenceFactory factory = new ValueManagedReferenceFactory(new ConstructedValue<Object>(constructor, Collections.<Value<?>>emptyList()));
                instantiators.addFirst(new ManagedReferenceInterceptorFactory(factory, instanceKey));
            }
            destructors.addLast(new ManagedReferenceReleaseInterceptorFactory(instanceKey));

            new ClassDescriptionTraversal(componentClassConfiguration, applicationDescription) {
View Full Code Here

Examples of org.jboss.as.naming.ValueManagedReferenceFactory

            ClassReflectionIndex<?> classIndex = index.getClassIndex(moduleClass);
            // Use the basic instantiator if none was set up
            if (configuration.getInstantiator() == null) {
                Constructor<?> constructor = classIndex.getConstructor(NO_CLASSES);
                if (constructor != null) {
                    configuration.setInstantiator(new ValueManagedReferenceFactory(createConstructedValue(constructor)));
                }
            }
        }
View Full Code Here

Examples of org.jboss.as.naming.ValueManagedReferenceFactory

     */
    public static void bindObject(final ServiceTarget target, final String contextName, final Object value) {
        final BinderService binderService = new BinderService(contextName);
        target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, contextName), binderService)
                .addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
                .addInjection(binderService.getManagedObjectInjector(), new ValueManagedReferenceFactory(
                        Values.immediateValue(value)))
                .setInitialMode(ServiceController.Mode.ACTIVE)
                .install();
    }
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.