Package org.jboss.as.managedbean.component

Examples of org.jboss.as.managedbean.component.ManagedBeanComponentDescription


            final String beanClassName = classInfo.name().toString();

            // Get the managed bean name from the annotation
            final AnnotationValue nameValue = instance.value();
            final String beanName = nameValue == null || nameValue.asString().isEmpty() ? beanClassName : nameValue.asString();
            final ManagedBeanComponentDescription componentDescription = new ManagedBeanComponentDescription(beanName,beanClassName,moduleDescription.getModuleName(),applicationName);
            final ServiceName baseName = deploymentUnit.getServiceName().append("component").append(beanName);

            // Add the view
            componentDescription.getViewClassNames().add(beanClassName);

            // Bind the view to its two JNDI locations
            // TODO - this should be a bit more elegant
            final BindingDescription moduleBinding = new BindingDescription();
            moduleBinding.setAbsoluteBinding(true);
            moduleBinding.setBindingName("java:module/" + beanName);
            moduleBinding.setBindingType(beanClassName);
            moduleBinding.setReferenceSourceDescription(new ServiceBindingSourceDescription(baseName.append("VIEW").append(beanClassName)));
            componentDescription.getBindings().add(moduleBinding);
            final BindingDescription appBinding = new BindingDescription();
            appBinding.setAbsoluteBinding(true);
            appBinding.setBindingName("java:app/" + moduleDescription.getModuleName() + "/" + beanName);
            appBinding.setBindingType(beanClassName);
            appBinding.setReferenceSourceDescription(new ServiceBindingSourceDescription(baseName.append("VIEW").append(beanClassName)));
            componentDescription.getBindings().add(appBinding);
            moduleDescription.addComponent(componentDescription);
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.managedbean.component.ManagedBeanComponentDescription

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.