Package org.apache.openejb.spi

Examples of org.apache.openejb.spi.ContainerSystem


                interfaces.addAll(ejb.getBusinessClasses());
            } else {
                interfaces.add(ejb.getRemoteInterfaceClass());
            }

            final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
            final BeanContext beanContext = containerSystem.getBeanContext(ejb.getDeploymentID());

            return EjbObjectProxyHandler.createProxy(beanContext, handler.getPrimaryKey(), interfaceType, interfaces, ejb.getMainInterface());
        } catch (Exception e) {
            Logger.getInstance(LogCategory.OPENEJB_SERVER_REMOTE, "org.apache.openejb.server.util.resources")
                .error("ServerSideResolver.resolve() failed, falling back to ClientSideResolver: " +
View Full Code Here


    private final ClusterableRequestHandler clusterableRequestHandler;
    private Context rootContext;

    JndiRequestHandler(final EjbDaemon daemon) throws Exception {
        super(daemon);
        final 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 ignore) {
        }
        clusterableRequestHandler = newClusterableRequestHandler();
    }
View Full Code Here

                dataSource = (DataSource) value;
            } else {
                String resouceId = (String) value;

                try {
                    ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
                    Context context = containerSystem.getJNDIContext();
                    Object obj = context.lookup("openejb/Resource/" + resouceId);
                    if (!(obj instanceof DataSource)) {
                        throw new IllegalArgumentException("Resource with id " + resouceId +
                                " is not a DataSource, but is " + obj.getClass().getName());
                    }
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");
                    DeploymentInfo[] 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

        context = (Context) context.lookup("openejb/local");
        return context;
    }

    private static Context getRoot() {
        ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
        Context context = containerSystem.getJNDIContext();
        return context;
    }
View Full Code Here

            }
            String message = messages.format(key, info.getName(), info.getEjbLink(), info.getHome(), info.getInterface());
            throw new NameNotFoundException(message);
        }

        ContainerSystem containerSystem = systemInstance.getComponent(ContainerSystem.class);

        DeploymentInfo deploymentInfo = containerSystem.getDeploymentInfo(deploymentId);

        if (deploymentInfo == null) {
            String message = messages.format("deploymentNotFound", info.getName(), deploymentId);
            throw new NameNotFoundException(message);
        }
View Full Code Here

    }

    public static Context getContext() {
        ThreadContext callContext = ThreadContext.getThreadContext();
        if (callContext == null) {
            ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
            return containerSystem.getJNDIContext();
        }

        CoreDeploymentInfo di = callContext.getDeploymentInfo();
        if (di != null) {
            return di.getJndiEnc();
        } else {
            ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
            return containerSystem.getJNDIContext();
        }
    }
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

     * user having to track down which deployment is using a particular jndi name
     * @param name
     * @return .
     */
    private DeploymentInfo findNameOwner(String name) {
        ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
        for (DeploymentInfo deploymentInfo : containerSystem.deployments()) {
            Bindings bindings = deploymentInfo.get(Bindings.class);
            if (bindings != null && bindings.getBindings().contains(name)) return deploymentInfo;
        }
        return null;
    }
View Full Code Here

        assembler.createResource(config.configureService("Default JDBC Database", ResourceInfo.class));

        // unmanaged JDBC
        assembler.createResource(config.configureService("Default Unmanaged JDBC Database", ResourceInfo.class));

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

        DataSource managedDS = (DataSource) containerSystem.getJNDIContext().lookup("openejb/Resource/Default JDBC Database");
        assertNotNull("managedDS is null", managedDS);

        DataSource unmanagedDS = (DataSource) containerSystem.getJNDIContext().lookup("openejb/Resource/Default Unmanaged JDBC Database");
        assertNotNull("unmanagedDS is null", unmanagedDS);

        // test without a transaction
        // NOTE: without a transaction all connections work as unmanaged
        verifyUnmanagedConnections(managedDS);
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.