Package org.apache.geronimo.core.service

Examples of org.apache.geronimo.core.service.SimpleInvocationResult


        try {

            Method m = ProxyInvocation.getMethod(invocation);
            Object args[] = ProxyInvocation.getArguments(invocation);
            Object rc = m.invoke(target, args);
            return new SimpleInvocationResult(true, rc);

        } catch (InvocationTargetException e) {
            Throwable t = e.getCause();
            if (t instanceof Exception && t instanceof RuntimeException == false) {
                return new SimpleInvocationResult(false, (Exception)t);
            } else {
                throw t;
            }
        }
    }
View Full Code Here


        try {

            Method m = ProxyInvocation.getMethod(invocation);
            Object args[] = ProxyInvocation.getArguments(invocation);
            Object rc = m.invoke(target, args);
            return new SimpleInvocationResult(true, rc);

        } catch (InvocationTargetException e) {
            Throwable t = e.getCause();
            if (t instanceof Exception && t instanceof RuntimeException == false) {
                return new SimpleInvocationResult(false, (Exception)t);
            } else {
                throw t;
            }
        }
    }
View Full Code Here

        try {

            Method m = ProxyInvocation.getMethod(invocation);
            Object args[] = ProxyInvocation.getArguments(invocation);
            Object rc = m.invoke(target, args);
            return new SimpleInvocationResult(true, rc);

        } catch (InvocationTargetException e) {
            Throwable t = e.getCause();
            if (t instanceof Exception && t instanceof RuntimeException == false) {
                return new SimpleInvocationResult(false, (Exception)t);
            } else {
                throw t;
            }
        }
    }
View Full Code Here

                currentThread.setContextClassLoader(classloader);
                marshalledInvocation = (Invocation) mo.get();
            } catch (Throwable e) {
                // Could not deserialize the invocation...
                mo.set(new ThrowableWrapper(e));
                return new SimpleInvocationResult(false, mo);               
            }

            try {
                InvocationResult rc = next.invoke(marshalledInvocation);
                mo.set(new SimpleInvocationResult(rc.isNormal(), rc.getResult()));
                return new SimpleInvocationResult(true, mo);
            } catch (Throwable e) {
                mo.set(new ThrowableWrapper(e));
                return new SimpleInvocationResult(true, mo);
            }

        } finally {
            currentThread.setContextClassLoader(orig);
        }
View Full Code Here

        Msg msg = transportClient.createMsg();
        msg.pushMarshaledObject(mo);
        if (type == InvocationType.REQUEST) {
            msg = transportClient.sendRequest(remoteURI, msg);
            return new SimpleInvocationResult(true, msg.popMarshaledObject());
        } else {
            transportClient.sendDatagram(remoteURI, msg);
            MarshalledObject rcmo = transportClient.createMarshalledObject();
            rcmo.set(null);
            return new SimpleInvocationResult(true, rcmo);
        }
    }
View Full Code Here

        try {

            Method m = ProxyInvocation.getMethod(invocation);
            Object args[] = ProxyInvocation.getArguments(invocation);
            Object rc = m.invoke(target, args);
            return new SimpleInvocationResult(true, rc);

        } catch (InvocationTargetException e) {
            Throwable t = e.getCause();
            if (t instanceof Exception && t instanceof RuntimeException == false) {
                return new SimpleInvocationResult(false, (Exception)t);
            } else {
                throw t;
            }
        }
    }
View Full Code Here

    public InvocationResult invoke(Invocation invocation) throws Throwable {
        Method method = ProxyInvocation.getMethod(invocation);
        if( method.equals(EQUALS_METHOD) ) {
            Object proxy = ProxyInvocation.getProxy(invocation);
            Object[] args = ProxyInvocation.getArguments(invocation);
            return new SimpleInvocationResult( true, proxy == args[0] ? Boolean.TRUE : Boolean.FALSE)
        } else if( method.equals(HASHCODE_METHOD) ) {
            return new SimpleInvocationResult( true, new Integer(ref.hashCode()) );
        }       
        return next.invoke(invocation);
    }
View Full Code Here

                currentThread.setContextClassLoader(classloader);
                marshalledInvocation = (Invocation) mo.get();
            } catch (Throwable e) {
                // Could not deserialize the invocation...
                mo.set(new ThrowableWrapper(e));
                return new SimpleInvocationResult(false, mo);               
            }

            try {
                InvocationResult rc = next.invoke(marshalledInvocation);
                mo.set(new SimpleInvocationResult(rc.isNormal(), rc.getResult()));
                return new SimpleInvocationResult(true, mo);
            } catch (Throwable e) {
                mo.set(new ThrowableWrapper(e));
                return new SimpleInvocationResult(true, mo);
            }

        } finally {
            currentThread.setContextClassLoader(orig);
        }
View Full Code Here

    public InvocationResult invoke(Invocation invocation) throws Throwable {
        Method method = ProxyInvocation.getMethod(invocation);
        if( method.equals(EQUALS_METHOD) ) {
            Object proxy = ProxyInvocation.getProxy(invocation);
            Object[] args = ProxyInvocation.getArguments(invocation);
            return new SimpleInvocationResult( true, proxy == args[0] ? Boolean.TRUE : Boolean.FALSE)
        } else if( method.equals(HASHCODE_METHOD) ) {
            return new SimpleInvocationResult( true, new Integer(ref.hashCode()) );
        }       
        return next.invoke(invocation);
    }
View Full Code Here

        Msg msg = transportClient.createMsg();
        msg.pushMarshaledObject(mo);
        if (type == InvocationType.REQUEST) {
            msg = transportClient.sendRequest(remoteURI, msg);
            return new SimpleInvocationResult(true, msg.popMarshaledObject());
        } else {
            transportClient.sendDatagram(remoteURI, msg);
            MarshalledObject rcmo = transportClient.createMarshalledObject();
            rcmo.set(null);
            return new SimpleInvocationResult(true, rcmo);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.core.service.SimpleInvocationResult

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.