Package org.jmanage.core.remote

Examples of org.jmanage.core.remote.InvocationResult


        try {
            Object result = executeInternal(invocation.getClassName(),
                    invocation.getMethodName(),
                    invocation.getSignature(),
                    invocation.getArgs());
            return new InvocationResult(result);
        } catch (InvocationTargetException e) {
            Throwable t = e.getCause();
            if(t != null){
                if(t instanceof ServiceException || t instanceof UnAuthorizedAccessException){
                    return new InvocationResult(t);
                }else if(t instanceof ConnectionFailedException){
                    return new InvocationResult(
                            new ServiceException(ErrorCodes.CONNECTION_FAILED));
                }
            }
            logger.log(Level.SEVERE, "Error while invoking: " +
                    invocation.getClassName() +"->"+ invocation.getMethodName(),
View Full Code Here


        }

        /* read the response */
        InputStream is = conn.getInputStream();
        ObjectInputStream ois = new ObjectInputStream(is);
        InvocationResult result = (InvocationResult) ois.readObject();

        ois.read(); // jsse connection pooling hack
        ois.close();
        oos.close();

        Object output = result.get();
        if(output instanceof Exception){
            throw (Exception)output;
        }
        return output;
    }
View Full Code Here

            ServletInputStream sis = request.getInputStream();
            ObjectInputStream ois = new ObjectInputStream(sis);
            RemoteInvocation invocation = (RemoteInvocation) ois.readObject();
            ois.close();
            /* execute the method */
            InvocationResult result = ServiceCallHandler.execute(invocation);
            /* write the result */
            ServletOutputStream sos = response.getOutputStream();
            ObjectOutputStream oos = new ObjectOutputStream(sos);
            oos.writeObject(result);
            oos.close();
        } catch (Throwable t) {
            /* write the exception */
            ServletOutputStream sos = response.getOutputStream();
            ObjectOutputStream oos = new ObjectOutputStream(sos);
            oos.writeObject(new InvocationResult(t));
            oos.close();
        }
    }
View Full Code Here

TOP

Related Classes of org.jmanage.core.remote.InvocationResult

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.