Package org.glassfish.api.invocation

Examples of org.glassfish.api.invocation.ComponentInvocation


    public void injectClass(Class clazz,
                            String componentId,
                            boolean invokePostConstruct ) throws InjectionException {

      ComponentInvocation inv = invocationMgr.getCurrentInvocation();

      if( inv != null ) {
        JndiNameEnvironment componentEnv =
          compEnvManager.getJndiNameEnvironment(componentId);
View Full Code Here


        invokeInstancePreDestroy(instance, true);
    }

    public void invokeInstancePreDestroy(Object instance, boolean validate)
        throws InjectionException {
        ComponentInvocation inv = invocationMgr.getCurrentInvocation();
       
        //if ComponentInv is null and validate is true, throw InjectionException;
        //if component JndiNameEnvironment is null and validate is true, throw InjectionException;
        //if validate is false, the above 2 null conditions are basically ignored,
        //except that when fine logging is enabled, fine-log a message.
        if( inv != null ) {
            JndiNameEnvironment componentEnv = compEnvManager.getJndiNameEnvironment(inv.getComponentId());

            if (componentEnv != null) {
                invokePreDestroy(instance.getClass(), instance, componentEnv);
            } else if (validate || _logger.isLoggable(Level.FINE)) {
                String msg1 = localStrings.getLocalString(
View Full Code Here

    }

    public void injectInstance(Object instance, boolean invokePostConstruct)
        throws InjectionException {

        ComponentInvocation inv = invocationMgr.getCurrentInvocation();

        if( inv != null ) {

            JndiNameEnvironment componentEnv = compEnvManager.getJndiNameEnvironment(inv.getComponentId());

            if( componentEnv != null ) {
                inject(instance.getClass(), instance, componentEnv, null, invokePostConstruct);
            } else {
                throw new InjectionException(localStrings.getLocalString(
View Full Code Here

    public void injectInstance(Object instance,
                               String componentId,
                               boolean invokePostConstruct)
        throws InjectionException {

        ComponentInvocation inv = invocationMgr.getCurrentInvocation();

        if( inv != null ) {

            JndiNameEnvironment componentEnv =
                compEnvManager.getJndiNameEnvironment(componentId);
View Full Code Here

    }

    public void invokeInstancePreDestroy(Object instance)
        throws InjectionException {

        ComponentInvocation inv = invocationMgr.getCurrentInvocation();
       
        if( inv != null ) {

            JndiNameEnvironment componentEnv = compEnvManager.getJndiNameEnvironment(inv.getComponentId());

            if( componentEnv != null ) {
                invokePreDestroy(instance.getClass(), instance, componentEnv);
            } else {
                throw new InjectionException(localStrings.getLocalString(
View Full Code Here

        return rj == null ? null : rj.env;
    }

    public JndiNameEnvironment getCurrentJndiNameEnvironment() {
        JndiNameEnvironment desc = null;
        ComponentInvocation inv = invMgr.getCurrentInvocation();
        if (inv != null) {
            if (inv.componentId != null) {
                desc = getJndiNameEnvironment(inv.componentId);
                if (_logger.isLoggable(Level.FINEST)) {
                    _logger.finest("ComponentEnvManagerImpl: " +
View Full Code Here

        } else {

            // EXTENDED Persitence Context

            if( extendedEntityManager == null ) {
                ComponentInvocation ci = invMgr.getCurrentInvocation();
                if (ci != null) {
                    Object cc = ci.getContainer();
                    if (cc instanceof JavaEEContainer) {
                        extendedEntityManager = ((JavaEEContainer) cc).lookupExtendedEntityManager(
                                entityManagerFactory);
                    }
                }  
View Full Code Here

        ComponentEnvManager compEnvManager = serviceLocator.getService(ComponentEnvManager.class);
        String componentId = compEnvManager.getComponentEnvId(jndiNameEnvironment);
        String appName = bundleContext.getApplication().getAppName();
        String moduleName = bundleContext.getModuleName();

        ComponentInvocation componentInvocation = null;

        InjectionInfo injectionInfo = jndiNameEnvironment.getInjectionInfoByClass(annotatedClass);
        List<InjectionCapable> injectionResources = injectionInfo.getInjectionResources();
        if ( injectionResources.size() > 0 ) {
        }
View Full Code Here

                                                           String appName,
                                                           String moduleName) {
        ComponentInvocation.ComponentInvocationType componentInvocationType =
            ComponentInvocation.ComponentInvocationType.SERVLET_INVOCATION;

        ComponentInvocation componentInvocation =
            new ComponentInvocation( componentId,
                                     componentInvocationType,
                                     null,
                                     appName,
                                     moduleName);
        componentInvocation.setJNDIEnvironment( bundleContext );
        return componentInvocation;
    }
View Full Code Here

    }

    public EntityManager lookupExtendedEntityManager(EntityManagerFactory emf) {
        EntityManager em = null;

        ComponentInvocation inv = invMgr.getCurrentInvocation();
        if( (inv != null) &&
            (inv.getInvocationType() == ComponentInvocation.ComponentInvocationType.EJB_INVOCATION )) {
            Object obj = inv.getContainer();
            if (obj instanceof JavaEEContainer) {
                em = ((JavaEEContainer) obj).lookupExtendedEntityManager(emf);
            }
        }
View Full Code Here

TOP

Related Classes of org.glassfish.api.invocation.ComponentInvocation

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.