Examples of EjbModule


Examples of org.apache.geronimo.openejb.deployment.EjbModule

        Environment environment,
        Object moduleContextInfo,
        AbstractName earName,
        Naming naming,
        ModuleIDBuilder idBuilder) throws DeploymentException {
        EjbModule ejbModule = (EjbModule) module;
        GeronimoEjbJarType tmpGeronimoEjbJarType = (GeronimoEjbJarType) ejbModule.getEjbModule().getAltDDs().get("geronimo-openejb.xml");
        OpenejbGeronimoEjbJarType geronimoEjbJarType = XmlUtil.convertToXmlbeans(tmpGeronimoEjbJarType);
        GerOpenejbClusteringWadiType clusteringWadiType = getWadiClusterConfig(geronimoEjbJarType);
        if (null == clusteringWadiType) {
            return;
        }

        EnvironmentBuilder.mergeEnvironments(environment, defaultEnvironment);

        ejbModule.getPreAutoConfigDeployer().add(new MapSFSBToContainerIDDeployer(defaultClusteredStatefulContainerId));
    }
View Full Code Here

Examples of org.apache.geronimo.openejb.deployment.EjbModule

       
        // if we have a default environment specified, we merge it in, but only if
        // this module has tss links.  The vendorDD isn't available yet, so we'll have to look at the 
        // jaxb version of this information now.
        if (this.defaultEnvironment != null) {
            EjbModule ejbModule = (EjbModule)module;
            GeronimoEjbJarType geronimoEjbJarType = (GeronimoEjbJarType) ejbModule.getEjbModule().getAltDDs().get("geronimo-openejb.xml");
           
            if (geronimoEjbJarType != null) {
                List<TssLinkType> links = geronimoEjbJarType.getTssLink();
                if (links != null && links.size() > 0) {
                    EnvironmentBuilder.mergeEnvironments(environment, this.defaultEnvironment);
View Full Code Here

Examples of org.apache.geronimo.openejb.deployment.EjbModule

    public void addGBeans(EARContext earContext, Module module, Bundle bundle, Collection repository) throws DeploymentException {

        if (module.getType() != ConfigurationModuleType.EJB) {
            return;
        }
        EjbModule ejbModule = (EjbModule) module;
        OpenejbGeronimoEjbJarType jarInfo = ejbModule.getVendorDD();

        OpenejbTssLinkType[] links = jarInfo.getTssLinkArray();
        // if there are no links, then there's nothing to do.
        if (links == null || links.length == 0) {
            return;
View Full Code Here

Examples of org.apache.geronimo.openejb.deployment.EjbModule

    public void createModule(Module module, Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
        if (module.getType() != ConfigurationModuleType.EJB) {
            return;
        }

        EjbModule ejbModule = (EjbModule) module;

        //overridden web service locations
        Map<String, String> correctedPortLocations = new HashMap<String, String>();
        Map<String, WebServiceBinding> wsBindingMap = createWebServiceBindingMap(ejbModule);
        for (Map.Entry<String, WebServiceBinding> entry : wsBindingMap.entrySet()) {
            String location = entry.getValue().getWebServiceAddress();
            if (location != null) {
                location = location.trim();
                if (!location.startsWith("/")) {
                    location = "/" + location;
                }
                correctedPortLocations.put(entry.getKey(), location);
            }
        }

        axisBuilder.findWebServices(module, true, correctedPortLocations, environment, ejbModule.getSharedContext());

        if (this.defaultEnvironment != null) {
            EnvironmentBuilder.mergeEnvironments(environment, this.defaultEnvironment);
        }
    }
View Full Code Here

Examples of org.apache.geronimo.openejb.deployment.EjbModule

    public void initContext(EARContext earContext, Module module, Bundle bundle) throws DeploymentException {
        if (module.getType() != ConfigurationModuleType.EJB) {
            return;
        }

        EjbModule ejbModule = (EjbModule) module;

        Map<String, WebServiceBinding> wsBindingMap = createWebServiceBindingMap(ejbModule);

        for (EnterpriseBeanInfo bean : ejbModule.getEjbJarInfo().enterpriseBeans) {

            String j2eeType = null;
            if (bean.type == EnterpriseBeanInfo.STATELESS) {
                j2eeType = NameFactory.STATELESS_SESSION_BEAN;
            } else if (bean.type == EnterpriseBeanInfo.SINGLETON) {
View Full Code Here

Examples of org.apache.geronimo.openejb.deployment.EjbModule

    public void addGBeans(EARContext earContext, Module module, Bundle bundle, Collection collection) throws DeploymentException {
        if (module.getType() != ConfigurationModuleType.EJB) {
            return;
        }

        EjbModule ejbModule = (EjbModule) module;

        Map<String, WebServiceBinding> wsBindingMap = createWebServiceBindingMap(ejbModule);

        for (EnterpriseBeanInfo bean : ejbModule.getEjbJarInfo().enterpriseBeans) {

            String j2eeType = null;
            if (bean.type == EnterpriseBeanInfo.STATELESS) {
                j2eeType = NameFactory.STATELESS_SESSION_BEAN;
            } else if (bean.type == EnterpriseBeanInfo.SINGLETON) {
                j2eeType = NameFactory.SINGLETON_BEAN;
            } else {
                continue;
            }

            String ejbName = bean.ejbName;

            AbstractName sessionName = earContext.getNaming().createChildName(module.getModuleName(), ejbName, j2eeType);

            assert sessionName != null: "StatelesSessionBean/SingletionBean object name is null";

            AbstractName ejbWebServiceName = earContext.getNaming().createChildName(sessionName, ejbName, NameFactory.WEB_SERVICE_LINK);

            GBeanData ejbWebServiceGBean = new GBeanData(ejbWebServiceName, EjbWebServiceGBean.class);

            ejbWebServiceGBean.setAttribute("ejbName", ejbName);
            ejbWebServiceGBean.setAttribute("ejbClass", bean.ejbClass);

            WebServiceBinding wsBinding = wsBindingMap.get(ejbName);
            if (wsBinding != null) {
                List<String> ddVirtualHosts = wsBinding.getWebServiceVirtualHost();
                if (ddVirtualHosts != null) {
                    String[] virtualHosts = new String[ddVirtualHosts.size()];
                    for (int i=0; i<ddVirtualHosts.size(); i++) {
                        virtualHosts[i] = ddVirtualHosts.get(i).trim();
                    }
                    ejbWebServiceGBean.setAttribute("virtualHosts", virtualHosts);
                }

                WebServiceSecurityType wsSecurity = wsBinding.getWebServiceSecurity();
                if (wsSecurity != null) {
                    ejbWebServiceGBean.setReferencePattern("ConfigurationFactory",
                            new AbstractNameQuery(null, Collections.singletonMap("name", wsSecurity.getSecurityRealmName().trim()),
                            ConfigurationFactory.class.getName()));
                    ejbWebServiceGBean.setAttribute("authMethod", wsSecurity.getAuthMethod().value());
                    if (wsSecurity.getRealmName() != null) {
                        ejbWebServiceGBean.setAttribute("realmName", wsSecurity.getRealmName().trim());
                    }
                    Properties properties = wsSecurity.getProperties();
                    ejbWebServiceGBean.setAttribute("properties", properties);
                    String policyContextID = sessionName.toString();
                    ejbWebServiceGBean.setAttribute("policyContextID", policyContextID);
                }
            }

            ejbWebServiceGBean.addDependency(module.getModuleName());
            if (axisBuilder.configureEJB(ejbWebServiceGBean, ejbName, ejbModule,
                                         ejbModule.getSharedContext(), bundle)) {

                try {
                    earContext.addGBean(ejbWebServiceGBean);
                } catch (GBeanAlreadyExistsException e) {
                    throw new DeploymentException(
View Full Code Here

Examples of org.apache.geronimo.openejb.deployment.EjbModule

    public void addGBeans(EARContext earContext, Module module, Bundle bundle, Collection repository) throws DeploymentException {
        if (module.getType() != ConfigurationModuleType.EJB) {
            return;
        }

        EjbModule ejbModule = (EjbModule) module;

        Map<String, WebServiceBinding> wsBindingMap = createWebServiceBindingMap(ejbModule);

        for (EnterpriseBeanInfo bean : ejbModule.getEjbJarInfo().enterpriseBeans) {
            String j2eeType = null;
            if (bean.type == EnterpriseBeanInfo.STATELESS) {
                j2eeType = NameFactory.STATELESS_SESSION_BEAN;
            } else if (bean.type == EnterpriseBeanInfo.SINGLETON) {
                j2eeType = NameFactory.SINGLETON_BEAN;
            } else {
                continue;
            }

            String ejbName = bean.ejbName;

            AbstractName sessionName = earContext.getNaming().createChildName(module.getModuleName(), ejbName, j2eeType);

            assert sessionName != null: "StatelesSessionBean/SingletonBean object name is null";

            AbstractName ejbWebServiceName = earContext.getNaming().createChildName(sessionName, ejbName, NameFactory.WEB_SERVICE_LINK);

            GBeanData ejbWebServiceGBean = new GBeanData(ejbWebServiceName, this.wsGBeanInfo);

            ejbWebServiceGBean.setAttribute("ejbName", ejbName);
            ejbWebServiceGBean.setAttribute("ejbClass", bean.ejbClass);

            WebServiceBinding wsBinding = wsBindingMap.get(ejbName);
            if (wsBinding != null) {
                List<String> ddVirtualHosts = wsBinding.getWebServiceVirtualHost();
                if (ddVirtualHosts != null) {
                    String[] virtualHosts = new String[ddVirtualHosts.size()];
                    for (int i=0; i<ddVirtualHosts.size(); i++) {
                        virtualHosts[i] = ddVirtualHosts.get(i).trim();
                    }
                    ejbWebServiceGBean.setAttribute("virtualHosts", virtualHosts);
                }

                WebServiceSecurityType wsSecurity = wsBinding.getWebServiceSecurity();
                if (wsSecurity != null) {
                    Properties properties = wsSecurity.getProperties();

                    ejbWebServiceGBean.setReferencePattern("ConfigurationFactory",
                            new AbstractNameQuery(null, Collections.singletonMap("name", wsSecurity.getSecurityRealmName().trim()),
                            ConfigurationFactory.class.getName()));
                    String authMethod = wsSecurity.getAuthMethod().value();
                    ejbWebServiceGBean.setAttribute("authMethod", authMethod);
                    if (wsSecurity.getRealmName() != null) {
                        ejbWebServiceGBean.setAttribute("realmName", wsSecurity.getRealmName().trim());
                    }
                    String policyContextID = sessionName.toString();
                    ejbWebServiceGBean.setAttribute("policyContextID", policyContextID);
                    ejbWebServiceGBean.setAttribute("properties", properties);
                }
            }

            ejbWebServiceGBean.addDependency(module.getModuleName());

            if (jaxwsBuilder.configureEJB(ejbWebServiceGBean, bean.ejbName, ejbModule,
                                          ejbModule.getSharedContext(), bundle)) {

                try {
                    earContext.addGBean(ejbWebServiceGBean);
                } catch (GBeanAlreadyExistsException e) {
                    throw new DeploymentException(
View Full Code Here

Examples of org.apache.geronimo.openejb.deployment.EjbModule

    public void initContext(EARContext earContext, Module module, Bundle bundle) throws DeploymentException {
        if (module.getType() != ConfigurationModuleType.EJB) {
            return;
        }

        EjbModule ejbModule = (EjbModule) module;
        Environment environment = module.getEnvironment();

        //overridden web service locations
        Map<String, String> correctedPortLocations = new HashMap<String, String>();
        Map<String, WebServiceBinding> wsBindingMap = createWebServiceBindingMap(ejbModule);
        for (Map.Entry<String, WebServiceBinding> entry : wsBindingMap.entrySet()) {
            String location = entry.getValue().getWebServiceAddress();
            if (location != null) {
                location = location.trim();
                if (!location.startsWith("/")) {
                    location = "/" + location;
                }
                correctedPortLocations.put(entry.getKey(), location);
            }
        }

        jaxwsBuilder.findWebServices(module, true, correctedPortLocations, environment, ejbModule.getSharedContext());

        for (EnterpriseBeanInfo bean : ejbModule.getEjbJarInfo().enterpriseBeans) {

            String j2eeType = null;
            if (bean.type == EnterpriseBeanInfo.STATELESS) {
                j2eeType = NameFactory.STATELESS_SESSION_BEAN;
            } else if (bean.type == EnterpriseBeanInfo.SINGLETON) {
View Full Code Here

Examples of org.apache.maven.plugin.ear.EjbModule


    public void testSimpleEjbModule()
    {
        final List<EarModule> modules = new ArrayList<EarModule>();
        final EarModule module = new EjbModule( createArtifact( "foo", "ejb" ) );
        setUri( module, "foo-1.0.jar" );
        modules.add( module );

        final EarMavenArchiver archiver = new EarMavenArchiver( modules );
        assertEquals( "foo-1.0.jar", archiver.generateClassPathEntry( "" ) );
View Full Code Here

Examples of org.apache.openejb.config.EjbModule

*/
public class CheckInjectionTargetsTest extends TestCase {

    public void test() throws Exception {

        EjbModule module = new EjbModule(new EjbJar());
        StatelessBean bean = module.getEjbJar().addEnterpriseBean(new StatelessBean("CheeseEjb", "org.acme.CheeseEjb"));

        // Valid
        EnvEntry envEntry = new EnvEntry("count", Integer.class.getName(), "10");
        envEntry.getInjectionTarget().add(new InjectionTarget("org.acme.CheeseEjb", "org.acme.CheeseEjb/count"));
        bean.getEnvEntry().add(envEntry);

        // Invalid
        EnvEntry envEntry2 = new EnvEntry("color", String.class.getName(), "yellow");
        envEntry2.getInjectionTarget().add(new InjectionTarget("org.acme.CheeseEjb", "org.acme.CheeseEjb/setColor"));
        bean.getEnvEntry().add(envEntry2);

        // Invalid
        EnvEntry envEntry3 = new EnvEntry("age", Integer.class.getName(), "5");
        envEntry3.getInjectionTarget().add(new InjectionTarget("org.acme.CheeseEjb", "setAge"));
        bean.getEnvEntry().add(envEntry3);

        CheckInjectionTargets rule = new CheckInjectionTargets();
        rule.module = module;
        rule.validate(module);

        ValidationWarning[] warnings = module.getValidation().getWarnings();
        assertEquals(warnings.length, 2);

    }
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.