Package org.apache.openejb

Examples of org.apache.openejb.Container


        }

        for (CoreDeploymentInfo deployment : deployments) {
            String deploymentID = deployment.getDeploymentID() + "";
            try {
                Container container = deployment.getContainer();
                container.undeploy(deployment);
                deployment.setContainer(null);
            } catch (Throwable t) {
                undeployException.getCauses().add(new Exception("bean: " + deploymentID + ": " + t.getMessage(), t));
            } finally {
                deployment.setDestroyed(true);
View Full Code Here


    }

    public Container createContainer(Class<? extends ContainerInfo> type, String serviceId, Properties declaredProperties, String providerId) throws OpenEJBException {
        ContainerInfo containerInfo = configurationFactory.configureService(type, serviceId, declaredProperties, providerId, "Container");
        assembler.createContainer(containerInfo);
        Container container = assembler.getContainerSystem().getContainer(serviceId);
        return container;
    }
View Full Code Here

    }

    public Container createContainer(Class<? extends ContainerInfo> type, String serviceId, Properties declaredProperties, String providerId) throws OpenEJBException {
        ContainerInfo containerInfo = configurationFactory.configureService(type, serviceId, declaredProperties, providerId, "Container");
        assembler.createContainer(containerInfo);
        Container container = assembler.getContainerSystem().getContainer(serviceId);
        return container;
    }
View Full Code Here

            // now that everything is configured, deploy to the container
            if (start) {
                for (DeploymentInfo deployment : allDeployments) {
                    try {
                        Container container = deployment.getContainer();
                        container.deploy(deployment);
                        logger.info("createApplication.createdEjb", deployment.getDeploymentID(), deployment.getEjbName(), container.getContainerID());
                    } catch (Throwable t) {
                        throw new OpenEJBException("Error deploying '"+deployment.getEjbName()+"'.  Exception: "+t.getClass()+": "+t.getMessage(), t);
                    }
                }
            }
View Full Code Here

        Collections.reverse(deployments);

        for (DeploymentInfo deployment : deployments) {
            String deploymentID = deployment.getDeploymentID() + "";
            try {
                Container container = deployment.getContainer();
                container.undeploy(deployment);
                deployment.setContainer(null);
            } catch (Throwable t) {
                undeployException.getCauses().add(new Exception("bean: " + deploymentID + ": " + t.getMessage(), t));
            } finally {
                ((CoreDeploymentInfo)deployment).setDestroyed(true);
View Full Code Here

                interceptorBindingBuilder.build(deployment, ejbInfo);

                deployment.setJarPath(ejbJar.jarPath);
                deployments.put(ejbInfo.ejbDeploymentId, deployment);

                Container container = (Container) props.get(ejbInfo.containerId);
                if (container == null) throw new IllegalStateException("Container does not exist: " + ejbInfo.containerId + ".  Referenced by deployment: " + deployment.getDeploymentID());
                // Don't deploy to the container, yet. That will be done by deploy() once Assembler as finished configuring the DeploymentInfo
                deployment.setContainer(container);
            } catch (Throwable e) {
                throw new OpenEJBException("Error building bean '" + ejbInfo.ejbName + "'.  Exception: " + e.getClass() + ": " + e.getMessage(), e);
View Full Code Here

            // now that everything is configured, deploy to the container
            if (start) {
                // deploy
                for (BeanContext deployment : allDeployments) {
                    try {
                        Container container = deployment.getContainer();
                        container.deploy(deployment);
                        if (!((String) deployment.getDeploymentID()).endsWith(".Comp")
                                && !deployment.isHidden()) {
                            logger.info("createApplication.createdEjb", deployment.getDeploymentID(), deployment.getEjbName(), container.getContainerID());
                        }
                        if (logger.isDebugEnabled()) {
                            for (Map.Entry<Object, Object> entry : deployment.getProperties().entrySet()) {
                                logger.info("createApplication.createdEjb.property", deployment.getEjbName(), entry.getKey(), entry.getValue());
                            }
                        }
                    } catch (Throwable t) {
                        throw new OpenEJBException("Error deploying '"+deployment.getEjbName()+"'.  Exception: "+t.getClass()+": "+t.getMessage(), t);
                    }
                }

                // start
                for (BeanContext deployment : allDeployments) {
                    try {
                        Container container = deployment.getContainer();
                        container.start(deployment);
                        if (!((String) deployment.getDeploymentID()).endsWith(".Comp")
                                && !deployment.isHidden()) {
                            logger.info("createApplication.startedEjb", deployment.getDeploymentID(), deployment.getEjbName(), container.getContainerID());
                        }
                    } catch (Throwable t) {
                        throw new OpenEJBException("Error starting '"+deployment.getEjbName()+"'.  Exception: "+t.getClass()+": "+t.getMessage(), t);
                    }
                }
View Full Code Here

        // stop
        for (BeanContext deployment : deployments) {
            String deploymentID = deployment.getDeploymentID() + "";
            try {
                Container container = deployment.getContainer();
                container.stop(deployment);
            } catch (Throwable t) {
                undeployException.getCauses().add(new Exception("bean: " + deploymentID + ": " + t.getMessage(), t));
            }
        }

        // undeploy
        for (BeanContext bean : deployments) {
            String deploymentID = bean.getDeploymentID() + "";
            try {
                Container container = bean.getContainer();
                container.undeploy(bean);
                bean.setContainer(null);
            } catch (Throwable t) {
                undeployException.getCauses().add(new Exception("bean: " + deploymentID + ": " + t.getMessage(), t));
            } finally {
                bean.setDestroyed(true);
View Full Code Here

        assertSame(springDataSource, exportedDS);

        //
        // Container
        //
        Container singletonContainer = containerSystem.getContainer("SpringDefinedSingletonContainer");
        assertTrue("singletonContainer should be an instance of SingletonContainer", singletonContainer instanceof org.apache.openejb.core.singleton.SingletonContainer);
        Container statelessContainer = containerSystem.getContainer("SpringDefinedStatelessContainer");
        assertTrue("statelessContainer should be an instance of StatelessContainer", statelessContainer instanceof org.apache.openejb.core.stateless.StatelessContainer);
        Container statefulContainer = containerSystem.getContainer("SpringDefinedStatefulContainer");
        assertTrue("statefulContainer should be an instance of StatefulContainer", statefulContainer instanceof org.apache.openejb.core.stateful.StatefulContainer);
        Container mdbContainer = containerSystem.getContainer("SpringDefinedMdbContainer");
        assertTrue("mdbContainer should be an instance of MdbContainer", mdbContainer instanceof org.apache.openejb.core.mdb.MdbContainer);
        Container bmpContainer = containerSystem.getContainer("SpringDefinedBmpContainer");
        assertTrue("bmpContainer should be an instance of BmpContainer", bmpContainer instanceof EntityContainer);
        Container cmpContainer = containerSystem.getContainer("SpringDefinedCmpContainer");
        assertTrue("cmpContainer should be an instance of CmpContainer", cmpContainer instanceof org.apache.openejb.core.cmp.CmpContainer);

        //
        // JNDI Context
        //
View Full Code Here

    }

    public Container createContainer(Class<? extends ContainerInfo> type, String serviceId, Properties declaredProperties, String providerId) throws OpenEJBException {
        ContainerInfo containerInfo = configurationFactory.configureService(type, serviceId, declaredProperties, providerId, "Container");
        assembler.createContainer(containerInfo);
        Container container = assembler.getContainerSystem().getContainer(serviceId);
        return container;
    }
View Full Code Here

TOP

Related Classes of org.apache.openejb.Container

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.