Package org.glassfish.ejb.deployment.descriptor

Examples of org.glassfish.ejb.deployment.descriptor.EjbSessionDescriptor


        this.traceInfoPrefix = "sfsb-" + ejbName + ": ";

        postConstructInvInfo = getLifecycleCallbackInvInfo(ejbDescriptor.getPostConstructDescriptors());
        preDestroyInvInfo = getLifecycleCallbackInvInfo(ejbDescriptor.getPreDestroyDescriptors());

        EjbSessionDescriptor sfulDesc = (EjbSessionDescriptor) ejbDescriptor;
        postActivateInvInfo = getLifecycleCallbackInvInfo(sfulDesc.getPostActivateDescriptors());
        prePassivateInvInfo = getLifecycleCallbackInvInfo(sfulDesc.getPrePassivateDescriptors());
    }
View Full Code Here


            _logger.log(Level.WARNING, "[SFSBContainer] Exception while "
                    + " initializing SessionSynchronization methods ", e);
          }
      } else {

            EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejbDescriptor;

          MethodDescriptor afterBeginMethodDesc = sessionDesc.getAfterBeginMethod();
            if( afterBeginMethodDesc != null ) {
                afterBeginMethod = afterBeginMethodDesc.getDeclaredMethod(sessionDesc);

                processSessionSynchMethod(afterBeginMethod);
            }

          MethodDescriptor beforeCompletionMethodDesc = sessionDesc.getBeforeCompletionMethod();
            if( beforeCompletionMethodDesc != null ) {
                beforeCompletionMethod = beforeCompletionMethodDesc.getDeclaredMethod(sessionDesc);

                processSessionSynchMethod(beforeCompletionMethod);
            }
           
          MethodDescriptor afterCompletionMethodDesc = sessionDesc.getAfterCompletionMethod();
            if( afterCompletionMethodDesc != null ) {
                afterCompletionMethod = afterCompletionMethodDesc.getDeclaredMethod(sessionDesc);
                if( afterCompletionMethod == null ) {
                    afterCompletionMethod =
                        afterCompletionMethodDesc.getDeclaredMethod(sessionDesc, new Class[] { Boolean.TYPE });
View Full Code Here

            isBeanManagedTran = ejbDescriptor.getTransactionType().equals("Bean");

            if( ejbDescriptor instanceof EjbSessionDescriptor)
            {
                isSession = true;
                EjbSessionDescriptor sd = (EjbSessionDescriptor) ejbDescriptor;
   
                if( !sd.isSessionTypeSet() ) {
                    throw new RuntimeException(localStrings.getLocalString(
                            "ejb.session_type_not_set",
                            "Invalid ejb Descriptor. Session type not set for {0}: {1}",
                            sd.getName(), sd));
                }
  
                if (sd.isSingleton()) {
                    isSingleton = true;
                } else {
                    isStatelessSession = sd.isStateless();
                    isStatefulSession  = !isStatelessSession;
 
                    if( isStatefulSession ) {
                        /**
                         * If bean class isn't explicitly marked Serializable, generate
                         * a subclass that is.   We do this with a generator that uses
                         * ASM directly instead of the CORBA codegen library since none
                         * of the corba .jars are part of the Web Profile.
                         */
                        if( !Serializable.class.isAssignableFrom(ejbClass) ) {

                            sfsbSerializedClass = EJBUtils.loadGeneratedSerializableClass(ejbClass.getClassLoader(),
                                    ejbClass.getName());
                        }

                    }
                }

                hasAsynchronousInvocations = sd.hasAsynchronousMethods();
            }

            if ( ejbDescriptor.isRemoteInterfacesSupported() ||
                     ejbDescriptor.isRemoteBusinessInterfacesSupported() ) {

View Full Code Here

        MethodLockInfo lockInfo = null;

        // Set READ/WRITE lock info.  Only applies to singleton beans.
        if( isSingleton ) {
            EjbSessionDescriptor singletonDesc = (EjbSessionDescriptor) ejbDescriptor;
            List<MethodDescriptor> readLockMethods = singletonDesc.getReadLockMethods();
            List<MethodDescriptor> writeLockMethods = singletonDesc.getWriteLockMethods();

            for(MethodDescriptor readLockMethodDesc : readLockMethods) {
                Method readLockMethod = readLockMethodDesc.getMethod(singletonDesc);
                if(implMethodMatchesInvInfoMethod(invInfoMethod, methodIntf, readLockMethod)) {

                    lockInfo = new MethodLockInfo();
                    lockInfo.setLockType(LockType.READ);
                    break;
                }
            }

            if( lockInfo == null ) {
                for(MethodDescriptor writeLockMethodDesc : writeLockMethods) {
                    Method writeLockMethod = writeLockMethodDesc.getMethod(singletonDesc);
                    if(implMethodMatchesInvInfoMethod(invInfoMethod, methodIntf, writeLockMethod)) {

                        lockInfo = new MethodLockInfo();
                        lockInfo.setLockType(LockType.WRITE);
                        break;
                    }
                }
            }
        }

        // Set AccessTimeout info
        if( isSingleton || isStatefulSession ) {

            EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejbDescriptor;
            List<EjbSessionDescriptor.AccessTimeoutHolder> accessTimeoutInfo =
                    sessionDesc.getAccessTimeoutInfo();


            for(EjbSessionDescriptor.AccessTimeoutHolder accessTimeoutHolder : accessTimeoutInfo) {
                MethodDescriptor accessTimeoutMethodDesc = accessTimeoutHolder.method;
                Method accessTimeoutMethod = accessTimeoutMethodDesc.getMethod(sessionDesc);
View Full Code Here

                // is decoupled from RemoteHome/LocalHome create().
            } else {

                Method initMethod = null;
                if( isSession ) {
                    EjbSessionDescriptor sessionDesc =
                        (EjbSessionDescriptor) ejbDescriptor;

                    for(EjbInitInfo next : sessionDesc.getInitMethods()) {
                        MethodDescriptor beanMethod = next.getBeanMethod();
                        Method m = beanMethod.getMethod(sessionDesc);
                        if( next.getCreateMethod().getName().equals(methodName)
                            &&
                            TypeUtil.sameParamTypes(m, invInfo.method) ) {
View Full Code Here

        this.traceInfoPrefix = "sfsb-" + ejbName + ": ";

        postConstructInvInfo = getLifecycleCallbackInvInfo(ejbDescriptor.getPostConstructDescriptors());
        preDestroyInvInfo = getLifecycleCallbackInvInfo(ejbDescriptor.getPreDestroyDescriptors());

        EjbSessionDescriptor sfulDesc = (EjbSessionDescriptor) ejbDescriptor;
        postActivateInvInfo = getLifecycleCallbackInvInfo(sfulDesc.getPostActivateDescriptors());
        prePassivateInvInfo = getLifecycleCallbackInvInfo(sfulDesc.getPrePassivateDescriptors());

        isPassivationCapable = sfulDesc.isPassivationCapable();
    }
View Full Code Here

          } catch(Exception e) {
            _logger.log(Level.WARNING, EXCEPTION_WHILE_INITIALIZING_SESSION_SYNCHRONIZATION, e);
          }
      } else {

            EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejbDescriptor;

          MethodDescriptor afterBeginMethodDesc = sessionDesc.getAfterBeginMethod();
            if( afterBeginMethodDesc != null ) {
                afterBeginMethod = afterBeginMethodDesc.getDeclaredMethod(sessionDesc);

                processSessionSynchMethod(afterBeginMethod);
            }

          MethodDescriptor beforeCompletionMethodDesc = sessionDesc.getBeforeCompletionMethod();
            if( beforeCompletionMethodDesc != null ) {
                beforeCompletionMethod = beforeCompletionMethodDesc.getDeclaredMethod(sessionDesc);

                processSessionSynchMethod(beforeCompletionMethod);
            }
           
          MethodDescriptor afterCompletionMethodDesc = sessionDesc.getAfterCompletionMethod();
            if( afterCompletionMethodDesc != null ) {
                afterCompletionMethod = afterCompletionMethodDesc.getDeclaredMethod(sessionDesc);
                if( afterCompletionMethod == null ) {
                    afterCompletionMethod =
                        afterCompletionMethodDesc.getDeclaredMethod(sessionDesc, new Class[] { Boolean.TYPE });
View Full Code Here

                descriptor.getPreDestroyDescriptors(), "PreDestroy", true);
        testInterceptorMethods(
                descriptor.getPostConstructDescriptors(), "PostConstruct", true);

        if(descriptor instanceof EjbSessionDescriptor) {
            EjbSessionDescriptor sessionDescriptor = (EjbSessionDescriptor)descriptor;
            testInterceptorMethods(
                    sessionDescriptor.getPrePassivateDescriptors(), "PrePassivate", true);
            testInterceptorMethods(
                    sessionDescriptor.getPostActivateDescriptors(), "PostActivate", true);
        }

        descriptor.getInterceptorClasses();
        for (EjbInterceptor interceptor : descriptor.getInterceptorClasses()) {
            testInterceptorMethods(
View Full Code Here

        if(descriptor.hasPreDestroyMethod())
            callbackDescs.addAll(descriptor.getPreDestroyDescriptors());
       
        // session descriptor has two extra interceptor methods.
        if(descriptor instanceof EjbSessionDescriptor) {
            EjbSessionDescriptor ejbSessionDescriptor = ((EjbSessionDescriptor)descriptor);
            if(ejbSessionDescriptor.hasPostActivateMethod())
                callbackDescs.addAll(ejbSessionDescriptor.getPostActivateDescriptors());
            if(ejbSessionDescriptor.hasPrePassivateMethod())
                callbackDescs.addAll(ejbSessionDescriptor.getPrePassivateDescriptors());
        }

        for (LifecycleCallbackDescriptor callbackDesc : callbackDescs) {
            try {
                Method method = callbackDesc.getLifecycleCallbackMethodObject(cl);
View Full Code Here

        this.traceInfoPrefix = "sfsb-" + ejbName + ": ";

        postConstructInvInfo = getLifecycleCallbackInvInfo(ejbDescriptor.getPostConstructDescriptors());
        preDestroyInvInfo = getLifecycleCallbackInvInfo(ejbDescriptor.getPreDestroyDescriptors());

        EjbSessionDescriptor sfulDesc = (EjbSessionDescriptor) ejbDescriptor;
        postActivateInvInfo = getLifecycleCallbackInvInfo(sfulDesc.getPostActivateDescriptors());
        prePassivateInvInfo = getLifecycleCallbackInvInfo(sfulDesc.getPrePassivateDescriptors());

        isPassivationCapable = sfulDesc.isPassivationCapable();
    }
View Full Code Here

TOP

Related Classes of org.glassfish.ejb.deployment.descriptor.EjbSessionDescriptor

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.