Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.ManagedBeanDescriptor


        return eligible;
    }

    public <T> T createManagedBean(Class<T> managedBeanClass) throws Exception {
        ManagedBeanDescriptor managedBeanDesc = null;

        try {
            BundleDescriptor bundle = getBundle();
            managedBeanDesc = bundle.getManagedBeanByBeanClass(managedBeanClass.getName());
        } catch(Exception e) {
View Full Code Here


        return createManagedBean(managedBeanDesc, managedBeanClass);
    }

    public <T> T createManagedBean(Class<T> managedBeanClass, boolean invokePostConstruct) throws Exception {
        ManagedBeanDescriptor managedBeanDesc = null;

        try {
            BundleDescriptor bundle = getBundle();
            managedBeanDesc = bundle.getManagedBeanByBeanClass(managedBeanClass.getName());
        } catch(Exception e) {
View Full Code Here

            } catch(Exception e) {
                throw new IllegalArgumentException("invalid managed bean " + managedBean, e);
            }

            ManagedBeanDescriptor desc = bundle.getManagedBeanByBeanClass(
                    managedBeanInstance.getClass().getName());
           
            if( desc == null ) {
                throw new IllegalStateException("Could not retrieve managed bean descriptor for " +
                    managedBean + " of class " + managedBean.getClass());
            }
           
            InterceptorInvoker invoker = (InterceptorInvoker)
                desc.getSupportingInfoForBeanInstance(managedBeanInstance);

            try {
                invoker.invokePreDestroy();
            } catch(Exception e) {
                _logger.log(Level.FINE, "Managed bean " + desc.getBeanClassName() + " PreDestroy", e);
            }

            desc.clearBeanInstanceInfo(managedBeanInstance);
        }                     
    }
View Full Code Here

        return eligible;
    }

    public <T> T createManagedBean(Class<T> managedBeanClass) throws Exception {
        ManagedBeanDescriptor managedBeanDesc = null;

        try {
            BundleDescriptor bundle = getBundle();
            managedBeanDesc = bundle.getManagedBeanByBeanClass(managedBeanClass.getName());
        } catch(Exception e) {
View Full Code Here

        return createManagedBean(managedBeanDesc, managedBeanClass);
    }

    public <T> T createManagedBean(Class<T> managedBeanClass, boolean invokePostConstruct) throws Exception {
        ManagedBeanDescriptor managedBeanDesc = null;

        try {
            BundleDescriptor bundle = getBundle();
            managedBeanDesc = bundle.getManagedBeanByBeanClass(managedBeanClass.getName());
        } catch(Exception e) {
View Full Code Here

            } catch(Exception e) {
                throw new IllegalArgumentException("invalid managed bean " + managedBean, e);
            }

            ManagedBeanDescriptor desc = bundle.getManagedBeanByBeanClass(
                    managedBeanInstance.getClass().getName());
           
            if( desc == null ) {
                throw new IllegalStateException("Could not retrieve managed bean descriptor for " +
                    managedBean + " of class " + managedBean.getClass());
            }
           
            InterceptorInvoker invoker = (InterceptorInvoker)
                desc.getSupportingInfoForBeanInstance(managedBeanInstance);

            try {
                invoker.invokePreDestroy();
            } catch(Exception e) {
                _logger.log(Level.FINE, "Managed bean " + desc.getBeanClassName() + " PreDestroy", e);
            }

            desc.clearBeanInstanceInfo(managedBeanInstance);
        }                     
    }
View Full Code Here

            EjbContainerServices containerServices = h.getService(EjbContainerServices.class);

            JndiNameEnvironment componentEnv = compEnvManager.getCurrentJndiNameEnvironment();

            ManagedBeanDescriptor mbDesc = null;

            JndiNameEnvironment injectionEnv = (JndiNameEnvironment) bundleContext;
           
            Object target = injectionContext.getTarget();
            String targetClass = target.getClass().getName();

            if( componentEnv == null ) {
                //throw new IllegalStateException("No valid EE environment for injection of " + targetClass);
                System.err.println("No valid EE environment for injection of " + targetClass);
                injectionContext.proceed();
                return;
            }

            // Perform EE-style injection on the target.  Skip PostConstruct since
            // in this case 299 impl is responsible for calling it.

            if( componentEnv instanceof EjbDescriptor ) {

                EjbDescriptor ejbDesc = (EjbDescriptor) componentEnv;

                if( containerServices.isEjbManagedObject(ejbDesc, target.getClass())) {
                    injectionEnv = componentEnv;
                } else {

                    if( bundleContext instanceof EjbBundleDescriptor ) {

                        // Check if it's a @ManagedBean class within an ejb-jar.  In that case,
                        // special handling is needed to locate the EE env dependencies
                        mbDesc = bundleContext.getManagedBeanByBeanClass(targetClass);
                    }                   
                }
            }

            if( mbDesc != null ) {
                injectionManager.injectInstance(target, mbDesc.getGlobalJndiName(), false);
            } else {
                if( injectionEnv instanceof EjbBundleDescriptor ) {

                    // CDI-style managed bean that doesn't have @ManagedBean annotation but
                    // is injected within the context of an ejb.  Need to explicitly
View Full Code Here

            EjbContainerServices containerServices = h.getService(EjbContainerServices.class);

            JndiNameEnvironment componentEnv = compEnvManager.getCurrentJndiNameEnvironment();

            ManagedBeanDescriptor mbDesc = null;

            JndiNameEnvironment injectionEnv = (JndiNameEnvironment) bundleContext;
           
            Object target = injectionContext.getTarget();
            String targetClass = target.getClass().getName();

            if( componentEnv == null ) {
                //throw new IllegalStateException("No valid EE environment for injection of " + targetClass);
                System.err.println("No valid EE environment for injection of " + targetClass);
                injectionContext.proceed();
                return;
            }

            // Perform EE-style injection on the target.  Skip PostConstruct since
            // in this case 299 impl is responsible for calling it.

            if( componentEnv instanceof EjbDescriptor ) {

                EjbDescriptor ejbDesc = (EjbDescriptor) componentEnv;

                if( containerServices.isEjbManagedObject(ejbDesc, target.getClass())) {
                    injectionEnv = componentEnv;
                } else {

                    if( bundleContext instanceof EjbBundleDescriptor ) {

                        // Check if it's a @ManagedBean class within an ejb-jar.  In that case,
                        // special handling is needed to locate the EE env dependencies
                        mbDesc = bundleContext.getManagedBeanByBeanClass(targetClass);
                    }                   
                }
            }

            if( mbDesc != null ) {
                injectionManager.injectInstance(target, mbDesc.getGlobalJndiName(), false);
            } else {
                if( injectionEnv instanceof EjbBundleDescriptor ) {

                    // CDI-style managed bean that doesn't have @ManagedBean annotation but
                    // is injected within the context of an ejb.  Need to explicitly
View Full Code Here

            } else if( next.isValidatorFactory() ) {
                value = new ValidatorFactoryProxy();
            } else if( next.isCDIBeanManager() ) {
                value = namingUtils.createLazyNamingObjectFactory(name, "java:comp/BeanManager", false);
            } else if( next.isManagedBean() ) {
                ManagedBeanDescriptor managedBeanDesc = next.getManagedBeanDescriptor();
                if( processEnv.getProcessType().isServer() ) {
                    value = namingUtils.createLazyNamingObjectFactory(name, next.getJndiName(), false);
                } else {
                    value = namingUtils.createLazyNamingObjectFactory(name, managedBeanDesc.getAppJndiName(), false);
                }
            } else {
                // we lookup first in the InitialContext, if not found we look up in the habitat.
                value = new NamingObjectFactory() {
                    // It might be mapped to a managed bean, so turn off caching to ensure that a
View Full Code Here

          app = webEnv.getApplication();
        } else if (env instanceof ApplicationClientDescriptor) {
            ApplicationClientDescriptor appEnv = (ApplicationClientDescriptor) env;
          app=  appEnv.getApplication();
        } else if ( env instanceof ManagedBeanDescriptor ) {
            ManagedBeanDescriptor mb = (ManagedBeanDescriptor) env;
            app = mb.getBundle().getApplication();
        } else if ( env instanceof Application ) {
            app = ((Application)env);
        } else {
            throw new IllegalArgumentException("IllegalJndiNameEnvironment : env");
        }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.ManagedBeanDescriptor

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.