Package org.apache.openejb.spi

Examples of org.apache.openejb.spi.ContainerSystem


        EjbJarInfo ejbJar = config.configureApplication(buildTestApp());

        assembler.createApplication(ejbJar);

        ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);

        BeanContext beanContext = containerSystem.getBeanContext("EchoBean");

        assertNotNull(beanContext);

        assertEquals("ServiceEndpointInterface", EchoServiceEndpoint.class, beanContext.getServiceEndpointInterface());
View Full Code Here


    private final ClusterableRequestHandler clusterableRequestHandler;
    private Context rootContext;

    JndiRequestHandler(EjbDaemon daemon) throws Exception {
        ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
        ejbJndiTree = (Context) containerSystem.getJNDIContext().lookup("openejb/remote");
        deploymentsJndiTree = (Context) containerSystem.getJNDIContext().lookup("openejb/Deployment");

        globalJndiTree = (Context) containerSystem.getJNDIContext().lookup("openejb/global");

        rootContext = containerSystem.getJNDIContext();
        try {
            clientJndiTree = (Context) containerSystem.getJNDIContext().lookup("openejb/client");
        } catch (NamingException e) {
        }
        clusterableRequestHandler = newClusterableRequestHandler();
    }
View Full Code Here

        contextTransaction.setProperty(Constants.FACTORY, UserTransactionFactory.class.getName());
        naming.setTransaction(contextTransaction);
    }

    public static void mergeJava(StandardContext standardContext) {
        ContainerSystem cs = SystemInstance.get().getComponent(org.apache.openejb.spi.ContainerSystem.class);
        ContextAccessController.setWritable(standardContext.getNamingContextListener().getName(), standardContext);
        Context root = null;
        try {
            root = (Context) ContextBindings.getClassLoader().lookup("");
        } catch (NamingException ignored) { // shouldn't occur
            // no-op
        }

        String path = standardContext.getEncodedPath();
        if (path.startsWith("/")) {
            path = path.substring(1);
        }

        final WebContext webContext = cs.getWebContext(path);

        if (webContext != null && webContext.getBindings() != null) {
            for (Map.Entry<String, Object> entry : webContext.getBindings().entrySet()) {
                try {
                    final String key = entry.getKey();
View Full Code Here

    public String getJndiName() {
        return jndiName;
    }

    public Object getObject() throws NamingException {
        ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
        try {
            return containerSystem.getJNDIContext().lookup(jndiName);
        } catch (NameNotFoundException e) { // EE.5.18: try using java:module/<shortName> prefix
            return containerSystem.getJNDIContext().lookup("java:module/" + Strings.lastPart(getClassName(), '.'));
        } catch (NamingException e) {
            throw (NamingException)new NamingException("could not look up " + jndiName).initCause(e);
        }
    }
View Full Code Here

            } catch (LoginException e) {
                throw (AuthenticationException) new AuthenticationException("User could not be authenticated: "+user).initCause(e);
            }
        }

        ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
        Context context = containerSystem.getJNDIContext();
        context = (Context) context.lookup("openejb/local");
        return context;

    }
View Full Code Here

    }

    protected Context getContext() throws NamingException {
        if (context == null) {
            if (contextJndiName != null) {
                ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
                context = (Context) containerSystem.getJNDIContext().lookup(contextJndiName);
            } else {
                context = new InitialContext(envProperties);
            }
        }
        return context;
View Full Code Here

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {

        in.defaultReadObject();

        ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
        setBeanContext(containerSystem.getBeanContext(deploymentID));
        container = (RpcContainer) getBeanContext().getContainer();

        if (IntraVmCopyMonitor.isCrossClassLoaderOperation()) {
            setDoCrossClassLoaderCopy(true);
        }
View Full Code Here

                String msg = messages.message("startup.assemblerEncounterUnexpectedBuildError");
                logger.fatal(msg, t);
                throw new OpenEJBException(msg, t);
            }

            ContainerSystem containerSystem = assembler.getContainerSystem();
            if (containerSystem == null) {
                String msg = messages.message("startup.assemblerReturnedNullContainer");
                logger.fatal(msg);
                throw new OpenEJBException(msg);
            }

            system.setComponent(ContainerSystem.class, containerSystem);

            if (logger.isDebugEnabled()) {
                logger.debug("startup.debugContainers", containerSystem.containers().length);

                if (containerSystem.containers().length > 0) {
                    Container[] c = containerSystem.containers();
                    logger.debug("startup.debugContainersType");
                    for (int i = 0; i < c.length; i++) {
                        String entry = "   ";
                        switch (c[i].getContainerType()) {
                            case BMP_ENTITY:
                                entry += "BMP ENTITY  ";
                                break;
                            case CMP_ENTITY:
                                entry += "CMP ENTITY  ";
                                break;
                            case STATEFUL:
                                entry += "STATEFUL    ";
                                break;
                            case STATELESS:
                                entry += "STATELESS   ";
                                break;
                            case MESSAGE_DRIVEN:
                                entry += "MESSAGE     ";
                                break;
                        }
                        entry += c[i].getContainerID();
                        logger.debug("startup.debugEntry", entry);
                    }
                }

                logger.debug("startup.debugDeployments", containerSystem.deployments().length);
                if (containerSystem.deployments().length > 0) {
                    logger.debug("startup.debugDeploymentsType");
                    BeanContext[] d = containerSystem.deployments();
                    for (int i = 0; i < d.length; i++) {
                        String entry = "   ";
                        switch (d[i].getComponentType()) {
                            case BMP_ENTITY:
                                entry += "BMP_ENTITY  ";
View Full Code Here

    public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable env) throws NamingException {
        return getContext();
    }

    public static Context getContext() throws NamingException {
        ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);

        Context context = (Context) containerSystem.getJNDIContext().lookup("openejb");
        return context;
    }
View Full Code Here

    public UserTransaction getUserTransaction()
    {
        UserTransaction ut = null;

        // TODO Convert to final field
        ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);

        try {
            ut = (UserTransaction) containerSystem.getJNDIContext().lookup("comp/UserTransaction");
        } catch (NamingException e) {
            logger.debug("User transaction is not bound to context, lets create it");
            ut = new CoreUserTransaction(getTransactionManager());

        }
View Full Code Here

TOP

Related Classes of org.apache.openejb.spi.ContainerSystem

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.