Search in sources :

Example 1 with ComponentFactory

use of org.jboss.as.ee.component.ComponentFactory in project wildfly by wildfly.

the class ApplicationClientComponentDescription method createConfiguration.

@Override
public ComponentConfiguration createConfiguration(final ClassReflectionIndex classIndex, final ClassLoader moduleClassLoader, final ModuleLoader moduleLoader) {
    final ComponentConfiguration configuration = super.createConfiguration(classIndex, moduleClassLoader, moduleLoader);
    configuration.setInstanceFactory(new ComponentFactory() {

        @Override
        public ManagedReference create(final InterceptorContext context) {
            return new ManagedReference() {

                @Override
                public void release() {
                }

                @Override
                public Object getInstance() {
                    return null;
                }
            };
        }
    });
    return configuration;
}
Also used : ComponentConfiguration(org.jboss.as.ee.component.ComponentConfiguration) ComponentFactory(org.jboss.as.ee.component.ComponentFactory) InterceptorContext(org.jboss.invocation.InterceptorContext) ManagedReference(org.jboss.as.naming.ManagedReference)

Example 2 with ComponentFactory

use of org.jboss.as.ee.component.ComponentFactory in project wildfly by wildfly.

the class ServiceComponentDescription method createConfiguration.

@Override
public ComponentConfiguration createConfiguration(final ClassReflectionIndex classIndex, final ClassLoader moduleClassLoader, final ModuleLoader moduleLoader) {
    final ComponentConfiguration configuration = super.createConfiguration(classIndex, moduleClassLoader, moduleLoader);
    // will not be used, but if instance factory is not set then components must have default constructor, which is not a
    // requirement for MBeans
    configuration.setInstanceFactory(new ComponentFactory() {

        @Override
        public ManagedReference create(final InterceptorContext context) {
            return new ManagedReference() {

                @Override
                public void release() {
                }

                @Override
                public Object getInstance() {
                    return null;
                }
            };
        }
    });
    return configuration;
}
Also used : ComponentConfiguration(org.jboss.as.ee.component.ComponentConfiguration) ComponentFactory(org.jboss.as.ee.component.ComponentFactory) InterceptorContext(org.jboss.invocation.InterceptorContext) ManagedReference(org.jboss.as.naming.ManagedReference)

Aggregations

ComponentConfiguration (org.jboss.as.ee.component.ComponentConfiguration)2 ComponentFactory (org.jboss.as.ee.component.ComponentFactory)2 ManagedReference (org.jboss.as.naming.ManagedReference)2 InterceptorContext (org.jboss.invocation.InterceptorContext)2