Package org.glassfish.ejb.deployment.descriptor

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


                // 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());
    }
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

    }

    @Override
    public EjbSessionDescriptor getEjbDescriptor() {
        if (descriptor == null) {
            descriptor = new EjbSessionDescriptor();
            descriptor.setEjbBundleDescriptor((EjbBundleDescriptorImpl) getParentNode().getDescriptor());
        }
        return descriptor;
    }
View Full Code Here

    protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo,
            EjbContext[] ejbContexts) throws AnnotationProcessorException {

        for(EjbContext next : ejbContexts) {
           
            EjbSessionDescriptor ejbSessionDescriptor =
                (EjbSessionDescriptor) next.getDescriptor();

            ejbSessionDescriptor.addPostActivateDescriptor(
                getPostActivateDescriptor(ainfo));
           
        }

        return getDefaultProcessedResult();       
View Full Code Here

    protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo,
            EjbContext[] ejbContexts) throws AnnotationProcessorException {
       
        for (EjbContext ejbContext : ejbContexts) {
            EjbSessionDescriptor ejbDesc =
                    (EjbSessionDescriptor) ejbContext.getDescriptor();

            Method annMethod = (Method) ainfo.getAnnotatedElement();
            checkValid(annMethod);
            if (logger.isLoggable(Level.FINE)) {
                logger.fine("Setting BeforeCompletion method " + annMethod);
            }

            ejbDesc.setBeforeCompletionMethodIfNotSet(new MethodDescriptor(annMethod));
        }

        return getDefaultProcessedResult();
    }
View Full Code Here

    protected boolean isValidEjbDescriptor(EjbDescriptor ejbDesc,
            Annotation annotation) {
        boolean isValid = EjbSessionDescriptor.TYPE.equals(ejbDesc.getType());

        if( isValid ) {
            EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejbDesc;
            // Only check specific session-bean type if it's set in the descriptor.
            // Otherwise it was probably populated with a sparse ejb-jar.xml and
            // we'll set the type later.
            if( sessionDesc.isSessionTypeSet() && !sessionDesc.isSingleton() ) {
                isValid = false;
            }
        }

        return  isValid;
View Full Code Here

    protected EjbDescriptor createEjbDescriptor(String elementName,
            AnnotationInfo ainfo) throws AnnotationProcessorException {

        AnnotatedElement ae = ainfo.getAnnotatedElement();
        Class ejbClass = (Class)ae;
        EjbSessionDescriptor newDescriptor = new EjbSessionDescriptor();
        newDescriptor.setName(elementName);
        newDescriptor.setEjbClassName(ejbClass.getName());
        newDescriptor.setSessionType(EjbSessionDescriptor.SINGLETON);

        doSingletonSpecificProcessing(newDescriptor, ejbClass);

        return newDescriptor;
    }
View Full Code Here

     */
    protected HandlerProcessingResult setEjbDescriptorInfo(
            EjbDescriptor ejbDesc, AnnotationInfo ainfo)
            throws AnnotationProcessorException {

        EjbSessionDescriptor ejbSingletonDescriptor = (EjbSessionDescriptor) ejbDesc;

        Class ejbClass = (Class) ainfo.getAnnotatedElement();
        Singleton singleton = (Singleton) ainfo.getAnnotation();

        // set session bean type in case it wasn't set in a sparse ejb-jar.xml.
        if( !ejbSingletonDescriptor.isSessionTypeSet() ) {
            ejbSingletonDescriptor.setSessionType(EjbSessionDescriptor.SINGLETON);
        }

        doDescriptionProcessing(singleton.description(), ejbDesc);
        doMappedNameProcessing(singleton.mappedName(), ejbDesc);

View Full Code Here

    protected boolean isValidEjbDescriptor(EjbDescriptor ejbDesc,
            Annotation annotation) {
        boolean isValid = EjbSessionDescriptor.TYPE.equals(ejbDesc.getType());

        if( isValid ) {
            EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejbDesc;
            // Only check specific session-bean type if it's set in the descriptor.
            // Otherwise it was probably populated with a sparse ejb-jar.xml and
            // we'll set the type later.
            if( sessionDesc.isSessionTypeSet() && !sessionDesc.isStateful() ) {
                isValid = false;
            }
        }

        return  isValid;
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.