Package org.apache.tuscany.sca.contribution.jee

Examples of org.apache.tuscany.sca.contribution.jee.JavaEEApplicationInfo


                    if(unresolved != resolved) {
                        moduleInfo = resolved;
                    }
                }
                if(moduleInfo == null) {
                    JavaEEApplicationInfo unresolved = new JavaEEApplicationInfoImpl();
                    unresolved.setUri(URI.create(archive));
                    JavaEEApplicationInfo resolved = resolver.resolveModel(JavaEEApplicationInfo.class, unresolved);
                    if(unresolved != resolved) {
                        moduleInfo = resolved;
                    }
                }
            } else if(uri.endsWith(".war")) {
                WebModuleInfo webModuleInfo = new WebModuleInfoImpl();
                webModuleInfo.setUri(URI.create(archive));
                webModuleInfo = resolver.resolveModel(WebModuleInfo.class, webModuleInfo);
                moduleInfo = webModuleInfo;
            } else if(uri.endsWith(".jar")) {
                EjbModuleInfo ejbModuleInfo = new EjbModuleInfoImpl();
                ejbModuleInfo.setUri(URI.create(archive));
                ejbModuleInfo = resolver.resolveModel(EjbModuleInfo.class, ejbModuleInfo);
                moduleInfo = ejbModuleInfo;
            } else if(uri.endsWith(".ear")) {
                final JavaEEApplicationInfo appInfo = new JavaEEApplicationInfoImpl();
                appInfo.setUri(URI.create(archive));
                ExternalEarInfo unresolved = new ExternalEarInfo() {
                    public JavaEEApplicationInfo getAppInfo() {
                        return appInfo;
                    }
                    public Composite getAppComposite() {
View Full Code Here


        }
        return createJavaEEApplicationInfo(appModule);
    }

    private org.apache.tuscany.sca.contribution.jee.JavaEEApplicationInfo createJavaEEApplicationInfo(AppModule appModule) {
        JavaEEApplicationInfo appInfo = new JavaEEApplicationInfoImpl();
        for(EjbModule em : appModule.getEjbModules()){
            EjbModuleInfo ejbModuleInfo = createEjbModuleInfo(em);
            ejbModuleInfo.setModuleName(em.getModuleId());
            appInfo.getEjbModuleInfos().put(em.getModuleId(), ejbModuleInfo);
        }

        for(WebModule wm : appModule.getWebModules()) {
            WebModuleInfo webModuleInfo = createWebModuleInfo(wm);
            webModuleInfo.setModuleName(wm.getModuleId());
            appInfo.getWebModuleInfos().put(wm.getModuleId(), webModuleInfo);
        }

        return appInfo;
    }
View Full Code Here

                   
                    // if you do care about application composites we have
                    // to process the EAR as a contribution
                    Contribution contribution = contributionService.contribute(uri.toString(), earLocation, false);
                   
                    JavaEEApplicationInfo appInfo = null;
                    Composite appComposite = null;
                   
                    // get the ear info
                    for (Artifact artifact : contribution.getArtifacts()){
                        if (artifact.getModel() instanceof JavaEEApplicationInfo){
                            appInfo = (JavaEEApplicationInfo)artifact.getModel();
                        }
                       
                        if (artifact.getURI().equals("META-INF/application.composite")){
                            appComposite = (Composite)artifact.getModel();
                        }
                    }
                                      
                   
                    final JavaEEApplicationInfo returnAppInfo = appInfo;
                    final Composite returnAppComposite = appComposite;
                   
                    return (T)new ExternalEarInfo() {
                        public JavaEEApplicationInfo getAppInfo() {
                            return returnAppInfo;
View Full Code Here

                    if(unresolved != resolved) {
                        moduleInfo = resolved;
                    }
                }
                if(moduleInfo == null) {
                    JavaEEApplicationInfo unresolved = new JavaEEApplicationInfoImpl();
                    unresolved.setUri(URI.create(archive));
                    JavaEEApplicationInfo resolved = resolver.resolveModel(JavaEEApplicationInfo.class, unresolved);
                    if(unresolved != resolved) {
                        moduleInfo = resolved;
                    }
                }
            } else if(uri.endsWith(".war")) {
                WebModuleInfo webModuleInfo = new WebModuleInfoImpl();
                webModuleInfo.setUri(URI.create(archive));
                webModuleInfo = resolver.resolveModel(WebModuleInfo.class, webModuleInfo);
                moduleInfo = webModuleInfo;
            } else if(uri.endsWith(".jar")) {
                EjbModuleInfo ejbModuleInfo = new EjbModuleInfoImpl();
                ejbModuleInfo.setUri(URI.create(archive));
                ejbModuleInfo = resolver.resolveModel(EjbModuleInfo.class, ejbModuleInfo);
                moduleInfo = ejbModuleInfo;
            } else if(uri.endsWith(".ear")) {
                final JavaEEApplicationInfo appInfo = new JavaEEApplicationInfoImpl();
                appInfo.setUri(URI.create(archive));
                ExternalEarInfo unresolved = new ExternalEarInfo() {
                    public JavaEEApplicationInfo getAppInfo() {
                        return appInfo;
                    }
                    public Composite getAppComposite() {
View Full Code Here

            if (resolved != null) {
                return modelClass.cast(resolved);
            } else {
                try {
                    File f = new File(uri.toString());
                    final JavaEEApplicationInfo o = jeeIntrospector.introspectJeeArchive(f.toURI().toURL());
                    return (T)new ExternalEarInfo() {
                        public JavaEEApplicationInfo getAppInfo() {
                            return (JavaEEApplicationInfo)o;
                        }
                    };
View Full Code Here

        }
        return createJavaEEApplicationInfo(appModule);
    }

    private org.apache.tuscany.sca.contribution.jee.JavaEEApplicationInfo createJavaEEApplicationInfo(AppModule appModule) {
        JavaEEApplicationInfo appInfo = new JavaEEApplicationInfoImpl();
        for(EjbModule em : appModule.getEjbModules()){
            EjbModuleInfo ejbModuleInfo = createEjbModuleInfo(em);
            ejbModuleInfo.setModuleName(em.getModuleId());
            appInfo.getEjbModuleInfos().put(em.getModuleId(), ejbModuleInfo);
        }

        for(WebModule wm : appModule.getWebModules()) {
            WebModuleInfo webModuleInfo = createWebModuleInfo(wm);
            webModuleInfo.setModuleName(wm.getModuleId());
            appInfo.getWebModuleInfos().put(wm.getModuleId(), webModuleInfo);
        }

        return appInfo;
    }
View Full Code Here

        this.contribution = contribution;
       
        // get the classloaders for any EAR archive that is a contribution
        for (Artifact artifact : contribution.getArtifacts()){
            if (artifact.getModel() instanceof JavaEEApplicationInfo){
                JavaEEApplicationInfo jeeAppInfo = (JavaEEApplicationInfo)artifact.getModel();
                // TODO - won't these all have the same classloader?
                ejbModules.addAll(jeeAppInfo.getEjbModuleInfos().values());
            }
        }
            
    }
View Full Code Here

    public String getArtifactType() {
        return ".ear";
    }

    public JavaEEApplicationInfo read(URL contributionURL, URI artifactURI, URL artifactURL) throws ContributionReadException {
        JavaEEApplicationInfo jeeAppInfo = jeeIntrospector.introspectJeeArchive(artifactURL);
        jeeAppInfo.setUri(artifactURI);
        jeeAppInfo.setApplicationName(new File(artifactURL.getFile()).getName());
        return jeeAppInfo;
    }
View Full Code Here

                   
                    // if you do care about application composites we have
                    // to process the EAR as a contribution
                    Contribution contribution = contributionService.contribute(uri.toString(), earLocation, false);
                   
                    JavaEEApplicationInfo appInfo = null;
                    Composite appComposite = null;
                   
                    // get the ear info
                    for (Artifact artifact : contribution.getArtifacts()){
                        if (artifact.getModel() instanceof JavaEEApplicationInfo){
                            appInfo = (JavaEEApplicationInfo)artifact.getModel();
                        }
                       
                        if (artifact.getURI().equals("META-INF/application.composite")){
                            appComposite = (Composite)artifact.getModel();
                        }
                    }
                                      
                   
                    final JavaEEApplicationInfo returnAppInfo = appInfo;
                    final Composite returnAppComposite = appComposite;
                   
                    return (T)new ExternalEarInfo() {
                        public JavaEEApplicationInfo getAppInfo() {
                            return returnAppInfo;
View Full Code Here

                    if(unresolved != resolved) {
                        moduleInfo = resolved;
                    }
                }
                if(moduleInfo == null) {
                    JavaEEApplicationInfo unresolved = new JavaEEApplicationInfoImpl();
                    unresolved.setUri(URI.create(archive));
                    JavaEEApplicationInfo resolved = resolver.resolveModel(JavaEEApplicationInfo.class, unresolved);
                    if(unresolved != resolved) {
                        moduleInfo = resolved;
                    }
                }
            } else if(uri.endsWith(".war")) {
                WebModuleInfo webModuleInfo = new WebModuleInfoImpl();
                webModuleInfo.setUri(URI.create(archive));
                webModuleInfo = resolver.resolveModel(WebModuleInfo.class, webModuleInfo);
                moduleInfo = webModuleInfo;
            } else if(uri.endsWith(".jar")) {
                EjbModuleInfo ejbModuleInfo = new EjbModuleInfoImpl();
                ejbModuleInfo.setUri(URI.create(archive));
                ejbModuleInfo = resolver.resolveModel(EjbModuleInfo.class, ejbModuleInfo);
                moduleInfo = ejbModuleInfo;
            } else if(uri.endsWith(".ear")) {
                final JavaEEApplicationInfo appInfo = new JavaEEApplicationInfoImpl();
                appInfo.setUri(URI.create(archive));
                ExternalEarInfo unresolved = new ExternalEarInfo() {
                    public JavaEEApplicationInfo getAppInfo() {
                        return appInfo;
                    }
                    public Composite getAppComposite() {
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.contribution.jee.JavaEEApplicationInfo

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.