Package org.apache.openejb

Examples of org.apache.openejb.DeploymentInfo


        assembler.createApplication(ejbJar);

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

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

        assertNotNull(deploymentInfo);

        assertEquals("ServiceEndpointInterface", EchoServiceEndpoint.class, deploymentInfo.getServiceEndpointInterface());


        // OK, Now let's fake a web serivce invocation coming from any random
        // web service provider.  The web serivce provider needs supply
        // the MessageContext and an interceptor to do the marshalling as
        // the arguments of the standard container.invoke signature.

        // So let's create a fake message context.
        MessageContext messageContext = new FakeMessageContext();

        // Now let's create a fake interceptor as would be supplied by the
        // web service provider.  Instead of writing "fake" marshalling
        // code that would pull the arguments from the soap message, we'll
        // just give it the argument values directly.
        Object wsProviderInterceptor = new FakeWsProviderInterceptor("Hello world");

        // Ok, now we have the two arguments expected on a JAX-RPC Web Service
        // invocation as per the OpenEJB-specific agreement between OpenEJB
        // and the Web Service Provider
        Object[] args = new Object[]{messageContext, wsProviderInterceptor};

        // Let's grab the container as the Web Service Provider would do and
        // perform an invocation
        RpcContainer container = (RpcContainer) deploymentInfo.getContainer();

        Method echoMethod = EchoServiceEndpoint.class.getMethod("echo", String.class);

        String value = (String) container.invoke("EchoBean", echoMethod.getDeclaringClass(), echoMethod, args, null);
View Full Code Here


        assembler.createApplication(ejbJar);

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

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

        assertNotNull(deploymentInfo);

        assertEquals("ServiceEndpointInterface", EchoServiceEndpoint.class, deploymentInfo.getServiceEndpointInterface());


        // OK, Now let's fake a web serivce invocation coming from any random
        // web service provider.  The web serivce provider needs supply
        // the MessageContext and an interceptor to do the marshalling as
        // the arguments of the standard container.invoke signature.

        // So let's create a fake message context.
        MessageContext messageContext = new FakeMessageContext();

        // Now let's create a fake interceptor as would be supplied by the
        // web service provider.  Instead of writing "fake" marshalling
        // code that would pull the arguments from the soap message, we'll
        // just give it the argument values directly.
        Object wsProviderInterceptor = new FakeWsProviderInterceptor("Hello world");

        // Ok, now we have the two arguments expected on a JAX-RPC Web Service
        // invocation as per the OpenEJB-specific agreement between OpenEJB
        // and the Web Service Provider
        Object[] args = new Object[]{messageContext, wsProviderInterceptor};

        // Let's grab the container as the Web Service Provider would do and
        // perform an invocation
        RpcContainer container = (RpcContainer) deploymentInfo.getContainer();

        Method echoMethod = EchoServiceEndpoint.class.getMethod("echo", String.class);

        String value = (String) container.invoke("EchoBean", echoMethod.getDeclaringClass(), echoMethod, args, null);
View Full Code Here

    public void build(EjbJarInfo ejbJar, HashMap<String, DeploymentInfo> deployments) {

        JndiNameStrategy strategy = createStrategy(ejbJar, deployments);

        for (EnterpriseBeanInfo beanInfo : ejbJar.enterpriseBeans) {
            DeploymentInfo deploymentInfo = deployments.get(beanInfo.ejbDeploymentId);
            strategy.begin(deploymentInfo);
            try {
                bind(ejbJar, deploymentInfo, beanInfo, strategy);
            } finally {
                strategy.end();
View Full Code Here

                nameInfo.name = externalName;
                beanInfo.jndiNamess.add(nameInfo);

                logger.info("Jndi(name=" + externalName +") --> Ejb(deployment-id="+beanInfo.ejbDeploymentId+")");
            } catch (NameAlreadyBoundException e) {
                DeploymentInfo deployment = findNameOwner(name);
                if (deployment != null){
                    logger.error("Jndi(name=" + externalName +") cannot be bound to Ejb(deployment-id="+beanInfo.ejbDeploymentId+").  Name already taken by Ejb(deployment-id="+deployment.getDeploymentID()+")");
                } else {
                    logger.error("Jndi(name=" + externalName +") cannot be bound to Ejb(deployment-id="+beanInfo.ejbDeploymentId+").  Name already taken by another object in the system.");
                }
                // Construct a new exception as the IvmContext doesn't include
                // the name in the exception that it throws
View Full Code Here

            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

    @Test
    public void testGetDeploymentEJBRequest() throws RemoteException {
        EJBMetaDataImpl ejbMetadataWithId = new EJBMetaDataImpl(null, null, null, null, null, 1, null);
        EJBRequest request = new EJBRequest(0, ejbMetadataWithId, method, null, null);
        DeploymentInfo info = deploymentIndex.getDeployment(request);
        assert deploymentInfo.equals(info);
        assert request.getDeploymentId().equals(info.getDeploymentID());
    }
View Full Code Here

    }

    public javax.ejb.EJBMetaData getEJBMetaData(ProxyInfo info) {
        CallContext call = CallContext.getCallContext();

        DeploymentInfo deployment = info.getDeploymentInfo();
        int idCode = -1;

        EJBMetaDataImpl metaData = new EJBMetaDataImpl(deployment.getHomeInterface(),
                deployment.getRemoteInterface(),
                deployment.getPrimaryKeyClass(),
                deployment.getComponentType().toString(),
                deployment.getDeploymentID().toString(),
                idCode, null);
        return metaData;
    }
View Full Code Here

        return metaData;
    }

    public javax.ejb.Handle getHandle(ProxyInfo info) {
        CallContext call = CallContext.getCallContext();
        DeploymentInfo deployment = info.getDeploymentInfo();

        int idCode = -1;

        Object securityIdentity = null;
        try {
            securityIdentity = call.getEJBRequest().getClientIdentity();
        } catch (Exception e) {

        }
        ClientMetaData cMetaData = new ClientMetaData(securityIdentity);
        EJBMetaDataImpl eMetaData = new EJBMetaDataImpl(deployment.getHomeInterface(),
                deployment.getRemoteInterface(),
                deployment.getPrimaryKeyClass(),
                deployment.getComponentType().toString(),
                deployment.getDeploymentID().toString(),
                idCode, null);
        Object primKey = info.getPrimaryKey();

        EJBObjectHandler hanlder = EJBObjectHandler.createEJBObjectHandler(eMetaData, getServerMetaData(), cMetaData, primKey);
View Full Code Here

        return serverMetaData;
    }

    public javax.ejb.HomeHandle getHomeHandle(ProxyInfo info) {
        CallContext call = CallContext.getCallContext();
        DeploymentInfo deployment = info.getDeploymentInfo();

        int idCode = -1;

        Object securityIdentity = null;
        try {
            securityIdentity = call.getEJBRequest().getClientIdentity();
        } catch (Exception e) {
            e.printStackTrace();
        }
        ClientMetaData cMetaData = new ClientMetaData(securityIdentity);
        EJBMetaDataImpl eMetaData = new EJBMetaDataImpl(deployment.getHomeInterface(),
                deployment.getRemoteInterface(),
                deployment.getPrimaryKeyClass(),
                deployment.getComponentType().toString(),
                deployment.getDeploymentID().toString(),
                idCode, null);

        EJBHomeHandler hanlder = EJBHomeHandler.createEJBHomeHandler(eMetaData, getServerMetaData(), cMetaData);

        return new EJBHomeHandle(hanlder.createEJBHomeProxy());
View Full Code Here

        return new EJBHomeHandle(hanlder.createEJBHomeProxy());
    }

    public javax.ejb.EJBObject getEJBObject(ProxyInfo info) {
        CallContext call = CallContext.getCallContext();
        DeploymentInfo deployment = info.getDeploymentInfo();

        int idCode = -1;

        Object securityIdentity = null;
        try {
            securityIdentity = call.getEJBRequest().getClientIdentity();
        } catch (Exception e) {
            e.printStackTrace();
        }
        ClientMetaData cMetaData = new ClientMetaData(securityIdentity);
        EJBMetaDataImpl eMetaData = new EJBMetaDataImpl(deployment.getHomeInterface(),
                deployment.getRemoteInterface(),
                deployment.getPrimaryKeyClass(),
                deployment.getComponentType().toString(),
                deployment.getDeploymentID().toString(),
                idCode, null);
        Object primKey = info.getPrimaryKey();

        EJBObjectHandler hanlder = EJBObjectHandler.createEJBObjectHandler(eMetaData, getServerMetaData(), cMetaData, primKey);
View Full Code Here

TOP

Related Classes of org.apache.openejb.DeploymentInfo

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.