Examples of EjbSessionDescriptor


Examples of com.sun.enterprise.deployment.EjbSessionDescriptor

        // Ensure correct usage of per-request-load-balancing
        if( ejb.getIASEjbExtraDescriptors().hasPerRequestLoadBalancing() ) {
            boolean valid = false;
            if( ejb instanceof EjbSessionDescriptor ) {
                EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejb;
                valid = sessionDesc.isStateless();
            }
            if( !valid ) {
                throw new RuntimeException("Invalid EJB bean type for bean " +
                                           ejb.getName() + " configured for " +
                                           "per-request-load-balancing.  Bean " +
View Full Code Here

Examples of com.sun.enterprise.deployment.EjbSessionDescriptor

        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

Examples of com.sun.enterprise.deployment.EjbSessionDescriptor

                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

Examples of com.sun.enterprise.deployment.EjbSessionDescriptor

    public Collection<BusinessInterfaceDescriptor<?>> getRemoteBusinessInterfaces() {
        Set<BusinessInterfaceDescriptor<?>> remoteBusIntfs = new HashSet<BusinessInterfaceDescriptor<?>>();

        if( ejbDesc.getType().equals(EjbSessionDescriptor.TYPE) ) {

            EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejbDesc;
            Set<String> remoteNames = sessionDesc.getRemoteBusinessClassNames();

            // Add superinterfaces that are also marked as Local
            Set<String> extraNames = new HashSet<String>();
            for(String local : remoteNames) {
                try {
                    Class<?> remoteClass = sessionDesc.getEjbBundleDescriptor().getClassLoader().loadClass(local);
                    addIfRemote(remoteClass.getInterfaces(), extraNames);
                } catch(ClassNotFoundException e) {
                    throw new IllegalStateException(e);
                }
            }

            remoteNames.addAll(extraNames);

            // Include the no-interface Local view
            if( sessionDesc.isLocalBean() ) {
                remoteNames.add(sessionDesc.getEjbClassName());
            }


            for(String remote : remoteNames) {
                try {

                    Class<?> remoteClass = sessionDesc.getEjbBundleDescriptor().getClassLoader().loadClass(remote);
                    @SuppressWarnings({ "rawtypes", "unchecked" })
                    BusinessInterfaceDescriptor<?> busIntfDesc =
                            new BusinessInterfaceDescriptorImpl(remoteClass);
                    remoteBusIntfs.add(busIntfDesc);
View Full Code Here

Examples of com.sun.enterprise.deployment.EjbSessionDescriptor

    }
  

    private String getDefaultGlobalJndiName(EjbDescriptor<?> ejbDesc) {

        EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor)
                ((EjbDescriptorImpl<?>) ejbDesc).getEjbDescriptor();

        String clientView = null;

        if( sessionDesc.isLocalBean() ) {
            clientView = sessionDesc.getEjbClassName();
        } else if( sessionDesc.getLocalBusinessClassNames().size() >= 1) {
            clientView = sessionDesc.getLocalBusinessClassNames().iterator().next();
        } else if( sessionDesc.getRemoteBusinessClassNames().size() >= 1) {
            clientView = sessionDesc.getRemoteBusinessClassNames().iterator().next();
        }

        return (clientView != null) ? sessionDesc.getPortableJndiName(clientView) : null;

    }
View Full Code Here

Examples of com.sun.enterprise.deployment.EjbSessionDescriptor

      
        Set<BusinessInterfaceDescriptor<?>> localBusIntfs = new HashSet<BusinessInterfaceDescriptor<?>>();

        if( ejbDesc.getType().equals(EjbSessionDescriptor.TYPE) ) {

            EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejbDesc;
            Set<String> localNames = sessionDesc.getLocalBusinessClassNames();

            // Add superinterfaces that are also marked as Local
            Set<String> extraNames = new HashSet<String>();
            for(String local : localNames) {
                try {
                    Class<?> localClass = sessionDesc.getEjbBundleDescriptor().getClassLoader().loadClass(local);
                    addIfLocal(localClass.getInterfaces(), extraNames);
                } catch(ClassNotFoundException e) {
                    throw new IllegalStateException(e);
                }
            }

            localNames.addAll(extraNames);

            // Include the no-interface Local view
            if( sessionDesc.isLocalBean() ) {
                localNames.add(sessionDesc.getEjbClassName());
            }


            for(String local : localNames) {
                try {

                    Class<?> localClass = sessionDesc.getEjbBundleDescriptor().getClassLoader().loadClass(local);
                    @SuppressWarnings({ "rawtypes", "unchecked" })
                    BusinessInterfaceDescriptor<?> busIntfDesc =
                            new BusinessInterfaceDescriptorImpl(localClass);
                    localBusIntfs.add(busIntfDesc);
View Full Code Here

Examples of com.sun.enterprise.deployment.EjbSessionDescriptor

    */
    public Collection<Method> getRemoveMethods() {
        Set<Method> removeMethods = new HashSet<Method>();

        if( ejbDesc.getType().equals(EjbSessionDescriptor.TYPE) ) {
            EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejbDesc;
            if( sessionDesc.isStateful() && sessionDesc.hasRemoveMethods() ) {

                for(MethodDescriptor mDesc : sessionDesc.getRemoveMethodDescriptors()) {
                    Method m = mDesc.getMethod(ejbDesc);
                    if( m == null ) {
                        throw new IllegalStateException("Can't resolve remove method " +
                        mDesc + " For EJB " + sessionDesc.getName());
                    }
                    removeMethods.add(m);

                }

View Full Code Here

Examples of com.sun.enterprise.deployment.EjbSessionDescriptor

      
        Set<BusinessInterfaceDescriptor<?>> localBusIntfs = new HashSet<BusinessInterfaceDescriptor<?>>();

        if( ejbDesc.getType().equals(EjbSessionDescriptor.TYPE) ) {

            EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejbDesc;
            Set<String> localNames = sessionDesc.getLocalBusinessClassNames();

            // Add superinterfaces that are also marked as Local
            Set<String> extraNames = new HashSet<String>();
            for(String local : localNames) {
                try {
                    Class<?> localClass = sessionDesc.getEjbBundleDescriptor().getClassLoader().loadClass(local);
                    addIfLocal(localClass.getInterfaces(), extraNames);
                } catch(ClassNotFoundException e) {
                    throw new IllegalStateException(e);
                }
            }

            localNames.addAll(extraNames);

            // Include the no-interface Local view
            if( sessionDesc.isLocalBean() ) {
                localNames.add(sessionDesc.getEjbClassName());
            }


            for(String local : localNames) {
                try {

                    Class<?> localClass = sessionDesc.getEjbBundleDescriptor().getClassLoader().loadClass(local);
                    @SuppressWarnings({ "rawtypes", "unchecked" })
                    BusinessInterfaceDescriptor<?> busIntfDesc =
                            new BusinessInterfaceDescriptorImpl(localClass);
                    localBusIntfs.add(busIntfDesc);
View Full Code Here

Examples of com.sun.enterprise.deployment.EjbSessionDescriptor

    */
    public Collection<Method> getRemoveMethods() {
        Set<Method> removeMethods = new HashSet<Method>();

        if( ejbDesc.getType().equals(EjbSessionDescriptor.TYPE) ) {
            EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejbDesc;
            if( sessionDesc.isStateful() && sessionDesc.hasRemoveMethods() ) {

                for(MethodDescriptor mDesc : sessionDesc.getRemoveMethodDescriptors()) {
                    Method m = mDesc.getMethod(ejbDesc);
                    if( m == null ) {
                        throw new IllegalStateException("Can't resolve remove method " +
                        mDesc + " For EJB " + sessionDesc.getName());
                    }
                    removeMethods.add(m);

                }

View Full Code Here

Examples of com.sun.enterprise.deployment.EjbSessionDescriptor

    public Collection<BusinessInterfaceDescriptor<?>> getRemoteBusinessInterfaces() {
        Set<BusinessInterfaceDescriptor<?>> remoteBusIntfs = new HashSet<BusinessInterfaceDescriptor<?>>();

        if( ejbDesc.getType().equals(EjbSessionDescriptor.TYPE) ) {

            EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejbDesc;
            Set<String> remoteNames = sessionDesc.getRemoteBusinessClassNames();

            // Add superinterfaces that are also marked as Local
            Set<String> extraNames = new HashSet<String>();
            for(String local : remoteNames) {
                try {
                    Class<?> remoteClass = sessionDesc.getEjbBundleDescriptor().getClassLoader().loadClass(local);
                    addIfRemote(remoteClass.getInterfaces(), extraNames);
                } catch(ClassNotFoundException e) {
                    throw new IllegalStateException(e);
                }
            }

            remoteNames.addAll(extraNames);

            // Include the no-interface Local view
            if( sessionDesc.isLocalBean() ) {
                remoteNames.add(sessionDesc.getEjbClassName());
            }


            for(String remote : remoteNames) {
                try {

                    Class<?> remoteClass = sessionDesc.getEjbBundleDescriptor().getClassLoader().loadClass(remote);
                    @SuppressWarnings({ "rawtypes", "unchecked" })
                    BusinessInterfaceDescriptor<?> busIntfDesc =
                            new BusinessInterfaceDescriptorImpl(remoteClass);
                    remoteBusIntfs.add(busIntfDesc);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.