Package org.apache.openejb

Examples of org.apache.openejb.DeploymentInfo


        this.container = container;
        poolMap = new HashMap<Object,LinkedListStack>();// put size in later

        DeploymentInfo[] deploymentInfos = this.container.deployments();
        for (int i = 0; i < deploymentInfos.length; i++) {
            DeploymentInfo deploymentInfo = deploymentInfos[i];
            deploy(deploymentInfo);
        }
    }
View Full Code Here


/**
* DO NOT REFACTOR THIS CLASS.  This class is referenced directly by generated code.
*/
public class EjbSelect {
    public static Object execute(Object di, String methodSignature, String returnType, Object... args) throws FinderException {
        DeploymentInfo deploymentInfo = (DeploymentInfo) di;
        Container container = deploymentInfo.getContainer();
        if (!(container instanceof CmpContainer)) {
            throw new FinderException("Deployment is not connected to a CmpContainer " + deploymentInfo.getDeploymentID());
        }
        CmpContainer cmpContainer = (CmpContainer) container;
        Object result = cmpContainer.select(deploymentInfo, methodSignature, returnType, args);
        if (result instanceof Number) {
            Number number = (Number) result;
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, sMetaData, cMetaData, primKey);
View Full Code Here

        return new EJBObjectHandle(hanlder.createEJBObjectProxy());
    }

    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, sMetaData, 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, sMetaData, cMetaData, primKey);
View Full Code Here

        return (javax.ejb.EJBObject) hanlder.createEJBObjectProxy();
    }

    public Object getBusinessObject(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(null, null,
                deployment.getPrimaryKeyClass(),
                deployment.getComponentType().toString(),
                deployment.getDeploymentID().toString(),
                idCode, info.getInterfaces());
        Object primKey = info.getPrimaryKey();

        EJBObjectHandler hanlder = EJBObjectHandler.createEJBObjectHandler(eMetaData, sMetaData, cMetaData, primKey);
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

        return hanlder.createEJBObjectProxy();
    }

    public javax.ejb.EJBHome getEJBHome(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, sMetaData, cMetaData);

        return hanlder.createEJBHomeProxy();
View Full Code Here

            return securityService.isCallerInRole(roleName);
        }

        public UserTransaction getUserTransaction(UserTransaction userTransaction) throws IllegalStateException {
            ThreadContext threadContext = ThreadContext.getThreadContext();
            DeploymentInfo di = threadContext.getDeploymentInfo();

            if (di.isBeanManagedTransaction()) {
                return userTransaction;
            } else {
                throw new IllegalStateException("container-managed transaction beans can not access the UserTransaction");
            }
        }
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.