Examples of RpcContainer


Examples of org.apache.openejb.RpcContainer

            paramArray = params.toArray();
        }

        insertExchange(m, paramArray, exchange);
       
        RpcContainer container = (RpcContainer) this.deploymentInfo.getContainer();
        Object result = null;
        try {
            result = container.invoke(this.deploymentInfo.getDeploymentID(), m, paramArray, null, null);
        } catch (OpenEJBException e) {
            throw new Fault(e);          
        } catch (RuntimeException e) {
            throw new Fault(e);
        }
View Full Code Here

Examples of org.apache.openejb.RpcContainer

                                    throw new RemoteException("Handle does not hold a " + remoteInterface.getName());
                                }
                            } else {
                                try {
                                    Object handleKey = handle.getPrimaryKey();
                                    RpcContainer container = (RpcContainer) ejbDeployment.getContainer();
                                    result = container.invoke(ejbDeployment.getDeploymentId(), method, arguments, handleKey, null);
                                } catch (OpenEJBException e) {
                                    Throwable cause = e.getCause();
                                    if (cause instanceof Exception) {
                                        Exception exception = (Exception) cause;
                                        return Util.writeUserException(method, reply, exception);
                                    }
                                    throw cause;
                                }
                            }
                        } catch (RemoveException e) {

                            return Util.writeUserException(method, reply, e);
                        }
                        result = null;
                    } else if (method.equals(REMOVE_W_KEY)) {
                        try {
                            ejbDeployment.getEJBHome().remove(arguments[0]);
                            result = null;
                        } catch (RemoveException e) {
                            return Util.writeUserException(method, reply, e);
                        }
                    } else {
                        throw new UnsupportedOperationException("unknown method: " + method);
                    }
                } else {
                    try {
                        RpcContainer container = (RpcContainer) ejbDeployment.getContainer();
                        result = container.invoke(ejbDeployment.getDeploymentId(), method, arguments, primaryKey, null);
                        // some methods like create() or find* return ProxyInfo objects.  We need to
                        // turn those into real EJB remote references.
                        if (result instanceof ProxyInfo || method.getName().startsWith("find")) {
                            result = createProxy(result);                   
                        }
View Full Code Here

Examples of org.apache.openejb.RpcContainer

       
        EJBInterceptor interceptor = new EJBInterceptor(this.container, requestMsgCtx);
        EJBAddressingSupport wsaSupport = new EJBAddressingSupport(jaxwsContext);
        Object[] arguments = { jaxwsContext, interceptor, wsaSupport };
       
        RpcContainer container = (RpcContainer) this.deploymentInfo.getContainer();

        Class callInterface = this.deploymentInfo.getServiceEndpointInterface();
       
        method = getMostSpecificMethod(method, callInterface);
       
        //This assumes that we are on the ultimate execution thread
        ThreadContextMigratorUtil.performMigrationToThread(Constants.THREAD_CONTEXT_MIGRATOR_LIST_ID,
                                                           axisMsgCtx);       
        try {
            Object res = container.invoke(this.deploymentInfo.getDeploymentID(), InterfaceType.SERVICE_ENDPOINT, callInterface, method, arguments, null);
            // TODO: update response message with new response value?
        } catch (ApplicationException e) {
            if (e.getCause() instanceof AxisFault) {
                throw (AxisFault)e.getCause();
            } else {
View Full Code Here

Examples of org.apache.openejb.RpcContainer

       
        try {          
            EJBInterceptor interceptor = new EJBInterceptor(params, method, this.endpoint, this.bus, exchange);
            Object[] arguments = { ctx, interceptor, ctx };

            RpcContainer container = (RpcContainer) this.deploymentInfo.getContainer();

            Class callInterface = this.deploymentInfo.getServiceEndpointInterface();
            method = getMostSpecificMethod(method, callInterface);
            Object res = container.invoke(this.deploymentInfo.getDeploymentID(), InterfaceType.SERVICE_ENDPOINT, callInterface, method, arguments, null);

            if (exchange.isOneWay()) {
                return null;
            }
View Full Code Here

Examples of org.apache.openejb.RpcContainer

                                    throw new RemoteException("Handle does not hold a " + remoteInterface.getName(), e);
                                }
                            } else {
                                try {
                                    Object handleKey = handle.getPrimaryKey();
                                    RpcContainer container = (RpcContainer) ejbDeployment.getContainer();
                                    result = container.invoke(ejbDeployment.getDeploymentId(), interfaceType, method.getDeclaringClass(), method, arguments, handleKey);
                                } catch (OpenEJBException e) {
                                    Throwable cause = e.getCause();
                                    if (cause instanceof Exception) {
                                        Exception exception = (Exception) cause;
                                        return Util.writeUserException(method, reply, exception);
                                    }
                                    throw cause;
                                }
                            }
                        } catch (RemoveException e) {

                            return Util.writeUserException(method, reply, e);
                        }
                        result = null;
                    } else if (method.equals(REMOVE_W_KEY)) {
                        try {
                            ejbDeployment.getEJBHome().remove(arguments[0]);
                            result = null;
                        } catch (RemoveException e) {
                            return Util.writeUserException(method, reply, e);
                        }
                    } else {
                        throw new UnsupportedOperationException("unknown method: " + method);
                    }
                } else {
                    try {
                        RpcContainer container = (RpcContainer) ejbDeployment.getContainer();
                        result = container.invoke(ejbDeployment.getDeploymentId(), interfaceType, method.getDeclaringClass(), method, arguments, primaryKey);
                        // some methods like create() or find* return ProxyInfo objects.  We need to
                        // turn those into real EJB remote references.
                        if (result instanceof ProxyInfo || method.getName().startsWith("find")) {
                            result = createProxy(result);
                        }
View Full Code Here

Examples of org.apache.openejb.RpcContainer

        try {
            EJBInterceptor interceptor = new EJBInterceptor(params, method, this.endpoint, this.bus, exchange);
            Object[] arguments = { ctx, interceptor, ctx };

            RpcContainer container = (RpcContainer) this.beanContext.getContainer();

            Class callInterface = this.beanContext.getServiceEndpointInterface();
            method = getMostSpecificMethod(method, callInterface);
            Object res = container.invoke(this.beanContext.getDeploymentID(), InterfaceType.SERVICE_ENDPOINT, callInterface, method, arguments, null);

            if (exchange.isOneWay()) {
                return null;
            }
View Full Code Here

Examples of org.apache.openejb.RpcContainer

        EJBInterceptor interceptor = new EJBInterceptor(this.container, requestMsgCtx);
        EJBAddressingSupport wsaSupport = new EJBAddressingSupport(jaxwsContext);
        Object[] arguments = { jaxwsContext, interceptor, wsaSupport };

        RpcContainer container = (RpcContainer) this.beanContext.getContainer();

        Class callInterface = this.beanContext.getServiceEndpointInterface();

        method = getMostSpecificMethod(method, callInterface);

        //This assumes that we are on the ultimate execution thread
        ThreadContextMigratorUtil.performMigrationToThread(Constants.THREAD_CONTEXT_MIGRATOR_LIST_ID,
                                                           axisMsgCtx);
        try {
            Object res = container.invoke(this.beanContext.getDeploymentID(), InterfaceType.SERVICE_ENDPOINT, callInterface, method, arguments, null);
            // TODO: update response message with new response value?
        } catch (ApplicationException e) {
            if (e.getCause() instanceof AxisFault) {
                throw (AxisFault)e.getCause();
            } else {
View Full Code Here

Examples of org.apache.openejb.RpcContainer

            if (asynchronous) {
                final AtomicBoolean invocationCancelTag = new AtomicBoolean(false);
                ThreadContext.initAsynchronousCancelled(invocationCancelTag);
                asynchronousInvocationCancelMap.put(req.getBody().getRequestId(), invocationCancelTag);
            }
            final RpcContainer c = (RpcContainer) call.getBeanContext().getContainer();

            //            Object result = c.invoke(req.getDeploymentId(),
            //                    req.getInterfaceClass(), req.getMethodInstance(),
            //                    req.getMethodParameters(),
            //                    req.getPrimaryKey()
            //            );

            final EJBDSerializer serializer = daemon.getSerializer();
            if (serializer != null) {
                req.setSerializer(serializer);
            }

            Object result = c.invoke(
                req.getDeploymentId(),
                InterfaceType.EJB_OBJECT,
                req.getInterfaceClass(),
                req.getMethodInstance(),
                req.getMethodParameters(),
View Full Code Here

Examples of org.apache.openejb.RpcContainer

    }

    protected void doEjbHome_METHOD(final EJBRequest req, final EJBResponse res) throws Exception {

        final CallContext call = CallContext.getCallContext();
        final RpcContainer c = (RpcContainer) call.getBeanContext().getContainer();

        final Object result = c.invoke(
            req.getDeploymentId(),
            InterfaceType.EJB_HOME,
            req.getInterfaceClass(),
            req.getMethodInstance(),
            req.getMethodParameters(),
View Full Code Here

Examples of org.apache.openejb.RpcContainer

    }

    protected void doEjbHome_CREATE(final EJBRequest req, final EJBResponse res) throws Exception {

        final CallContext call = CallContext.getCallContext();
        final RpcContainer c = (RpcContainer) call.getBeanContext().getContainer();

        Object result = c.invoke(
            req.getDeploymentId(),
            InterfaceType.EJB_HOME,
            req.getInterfaceClass(),
            req.getMethodInstance(),
            req.getMethodParameters(),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.