Package org.apache.tuscany.sca.contribution.service

Examples of org.apache.tuscany.sca.contribution.service.ContributionException


       
        // Read all artifacts in the contribution
        try {
            processReadPhase(contribution, contributionArtifacts);
        } catch ( Exception e ) {
            throw new ContributionException(e);
        }

        //
        this.contributionListener.contributionAdded(this.contributionRepository, contribution);
View Full Code Here


       
        // Read all artifacts in the contribution
        try {
            processReadPhase(contribution, contributionArtifacts);
        } catch ( Exception e ) {
            throw new ContributionException(e);
        }

        //
        this.contributionListener.contributionAdded(this.contributionRepository, contribution);
View Full Code Here

        try {
          // Allow access to read system properties. Requires PropertyPermission in security policy.
          // Any security exceptions are caught and wrapped as ContributionException.
            processReadPhase(contribution, contributionArtifacts);
        } catch ( Exception e ) {
            throw new ContributionException(e);
        }

        readContributionMetadata(contribution);

        //
View Full Code Here

        try {
          // Allow access to read system properties. Requires PropertyPermission in security policy.
          // Any security exceptions are caught and wrapped as ContributionException.
            processReadPhase(contribution, contributionArtifacts);
        } catch ( Exception e ) {
            throw new ContributionException(e);
        }

        readContributionMetadata(contribution);

        //
View Full Code Here

        try {
          // Allow access to read system properties. Requires PropertyPermission in security policy.
          // Any security exceptions are caught and wrapped as ContributionException.
            processReadPhase(contribution, contributionArtifacts);
        } catch ( Exception e ) {
            throw new ContributionException(e);
        }

        //
        this.contributionListener.contributionAdded(this.contributionRepository, contribution);
View Full Code Here

        DeploymentLoader loader = new DeploymentLoader();
        AppModule appModule = null;
        try {
            appModule = loader.load(new File(jarFilePath));
        } catch (OpenEJBException e) {
            throw new ContributionException(e);
        }

        // Process deployment descriptor files
        ReadDescriptors readDescriptors = new ReadDescriptors();
        try {
            readDescriptors.deploy(appModule);
        } catch (OpenEJBException e) {
            throw new ContributionException(e);
        }

        // Process annotations
        AnnotationDeployer annDeployer = new AnnotationDeployer();
        try {
            annDeployer.deploy(appModule);
        } catch (OpenEJBException e) {
            throw new ContributionException(e);
        }

        return appModule;
    }
View Full Code Here

            try {
                Class<?> clazz = classLoader.loadClass(ejbRef.getInterface());
                ic = helper.createInterfaceContract(clazz);
            } catch (Exception e) {
                componentType = null;
                throw new ContributionException(e);
            }
            reference.setInterfaceContract(ic);
            reference.getRequiredIntents().add(AssemblyHelper.EJB_INTENT);
            componentType.getReferences().add(reference);
        }
View Full Code Here

                Class<?> clazz = cl.loadClass(intfName);
                ic = helper.createInterfaceContract(clazz);
                ic.getInterface().setConversational(conversational);
                ic.getInterface().setRemotable(true);
            } catch (Exception e) {
                throw new ContributionException(e);
            }
            service.setInterfaceContract(ic);
            if (conversational) {
                service.getRequiredIntents().add(AssemblyHelper.CONVERSATIONAL_INTENT);
            }
            componentType.getServices().add(service);
        }

        // Process Local Business interfaces of the SessionBean
        for (String intfName : bean.getBusinessLocal()) {
            String serviceName =
                intfName.lastIndexOf(".") != -1 ? intfName.substring(intfName.lastIndexOf(".") + 1) : intfName;
            Service service = helper.createComponentService();
            service.setName(serviceName);
            InterfaceContract ic = null;
            try {
                Class<?> clazz = cl.loadClass(intfName);
                ic = helper.createInterfaceContract(clazz);
                ic.getInterface().setConversational(conversational);
            } catch (Exception e) {
                throw new ContributionException(e);
            }
            service.setInterfaceContract(ic);
            if (conversational) {
                service.getRequiredIntents().add(AssemblyHelper.CONVERSATIONAL_INTENT);
            }
            componentType.getServices().add(service);
        }

        // Process Remote EJB References
        for (Map.Entry<String, EjbRef> entry : bean.getEjbRefMap().entrySet()) {
            EjbRef ejbRef = entry.getValue();
            if(ejbRef.getHome() != null) {
                // References to only EJB3 beans need to be considered.
                // Skip the current on as it is not a reference to an EJB3 bean.
                continue;
            }
            if (ejbRef.getRefType().compareTo(EjbReference.Type.REMOTE) != 0) {
                // Only Remote EJB references need to be considered.
                // Skip the current one as it is not a remote reference.
                continue;
            }
            //FIXME: ejbRef.getEjbRefType() is null sometimes.  Need a different way to figure the type.
            if(ejbRef.getEjbRefType() != null && ejbRef.getEjbRefType().compareTo(EjbRefType.SESSION) != 0) {
                // Only references to Session beans need to be considered.
                // Skip the current one as it is not a Session bean.
                continue;
            }
            String referenceName = entry.getKey();
            referenceName = referenceName.replace("/", "_");
            Reference reference = helper.createComponentReference();
            reference.setName(referenceName);
            InterfaceContract ic = null;
            try {
                Class<?> clazz = cl.loadClass(ejbRef.getInterface());
                ic = helper.createInterfaceContract(clazz);
            } catch (Exception e) {
                throw new ContributionException(e);
            }
            reference.setInterfaceContract(ic);
            reference.getRequiredIntents().add(AssemblyHelper.EJB_INTENT);
            componentType.getReferences().add(reference);
        }
View Full Code Here

            InterfaceContract ic = null;
            try {
                Class<?> clazz = cl.loadClass(ejbRef.getInterface());
                ic = helper.createInterfaceContract(clazz);
            } catch (Exception e) {
                throw new ContributionException(e);
            }
            reference.setInterfaceContract(ic);
            reference.getRequiredIntents().add(AssemblyHelper.EJB_INTENT);
            componentType.getReferences().add(reference);
        }
View Full Code Here

        try {
          // Allow access to read system properties. Requires PropertyPermission in security policy.
          // Any security exceptions are caught and wrapped as ContributionException.
            processReadPhase(contribution, contributionArtifacts);
        } catch ( Exception e ) {
            throw new ContributionException(e);
        }

        //
        this.contributionListener.contributionAdded(this.contributionRepository, contribution);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.contribution.service.ContributionException

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.