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);

        DeploymentInfo deploymentInfo = containerSystem.getDeploymentInfo("EchoBean");

        assertNotNull(deploymentInfo);

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


        body.println("<td><font face=\"arial\" color=\"white\">ID</font></td>");
        body.println("<td><font color=\"white\">" + id + "</font></td>");
        body.println("</tr>");

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

        CoreDeploymentInfo di = (CoreDeploymentInfo) containerSystem.getDeploymentInfo(id);

        printRow("Name", bean.ejbName, body);
        printRow(
            "Description",
            StringUtilities.replaceNullOrBlankStringWithNonBreakingSpace(bean.description),
View Full Code Here

        return (EnterpriseBeanInfo) deploymentIdIndex.get(id);
    }

    private void printDeployments(PrintWriter out) throws IOException {
        SystemInstance system = SystemInstance.get();
        ContainerSystem containerSystem = system.getComponent(ContainerSystem.class);

        DeploymentInfo[] deployments = containerSystem.deployments();
        String[] deploymentString = new String[deployments.length];
        out.println("<table width=\"100%\" border=\"1\">");
        out.println("<tr bgcolor=\"#5A5CB8\">");
        out.println("<td><font color=\"white\">Deployment ID</font></td>");
        out.println("</tr>");
View Full Code Here

    /** initalizes the left and top menu navigation
     */   
    public HashMap initNavSections(){
        HashMap sections = new HashMap();
        try{
            ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
            Context ctx = containerSystem.getJNDIContext();
            ctx = (Context) ctx.lookup("openejb/ejb");
            NamingEnumeration enumeration = ctx.list("");
            //System.out.println("\n\nENUM "+enumeration);

            if ( enumeration == null){
View Full Code Here

    public synchronized void stop() throws ServiceException {
        System.out.println("[] received stop signal");
        stop = true;

        try {
            ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
            NamingEnumeration<Binding> namingEnumeration = null;
            try {
                namingEnumeration = containerSystem.getJNDIContext().listBindings("java:openejb/resourceAdapter");
            } catch (NamingException ignored) {
                // no resource adapters were created
            }
            while (namingEnumeration != null && namingEnumeration.hasMoreElements()) {
                Binding binding = namingEnumeration.nextElement();
View Full Code Here

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

            ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
            DeploymentInfo deploymentInfo = containerSystem.getDeploymentInfo(ejb.getDeploymentID());

            return EjbHomeProxyHandler.createHomeProxy(deploymentInfo, interfaceType, interfaces);
        } catch (Exception e) {
            logger.error("ServerSideResolver.resolve() failed, falling back to ClientSideResolver: "+e.getClass().getName()+": "+e.getMessage(), e );
            return new EJBHomeProxyHandle.ClientSideResovler().resolve(handler);
View Full Code Here

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

            ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
            DeploymentInfo deploymentInfo = containerSystem.getDeploymentInfo(ejb.getDeploymentID());

            return EjbObjectProxyHandler.createProxy(deploymentInfo, handler.getPrimaryKey(), interfaceType, interfaces);
        } catch (Exception e) {
            logger.error("ServerSideResolver.resolve() failed, falling back to ClientSideResolver: "+e.getClass().getName()+": "+e.getMessage(), e );
            return new EJBObjectProxyHandle.ClientSideResovler().resolve(handler);
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("java:openejb/Resource/Default JDBC Database");
        assertNotNull("managedDS is null", managedDS);

        DataSource unmanagedDS = (DataSource) containerSystem.getJNDIContext().lookup("java: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

     * 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

    public void printEjb(String name, PrintWriter out, HttpSession session)
        throws Exception {

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

        String id = (name.startsWith("/")) ? name.substring(1, name.length()) : name;

        org.apache.openejb.DeploymentInfo ejb = containerSystem.getDeploymentInfo(id);


        if (ejb == null) {
            out.print("No such EJB: " + id);
            return;
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.