Examples of MethodInvocationResult


Examples of org.apache.tapestry5.services.MethodInvocationResult

    public void invokeEventHandlerMethod(ComponentEvent event, Object instance)
    {
        event.setMethodDescription(identifier);

        MethodInvocationResult result = access.invoke(instance, constructParameters(event));

        result.rethrow();

        event.storeResult(result.getReturnValue());
    }
View Full Code Here

Examples of org.apache.tapestry5.services.MethodInvocationResult

                {
                    public void advise(ComponentMethodInvocation invocation)
                    {
                        invocation.proceed();

                        MethodInvocationResult invocationResult = pvnaAccess.invoke(invocation.getInstance());

                        assertFalse(invocationResult.isFail(), "fail should be false, no checked exception thrown");
                    }
                });
            }
        });
View Full Code Here

Examples of org.apache.tapestry5.services.MethodInvocationResult

                {
                    public void advise(ComponentMethodInvocation invocation)
                    {
                        invocation.proceed();

                        MethodInvocationResult invocationResult = targetAccess.invoke(invocation.getInstance());

                        assertTrue(invocationResult.isFail(), "fail should be true; checked exception thrown");

                        SQLException ex = invocationResult.getThrown(SQLException.class);

                        assertNotNull(ex);
                        assertEquals(ex.getMessage(), "From publicVoidThrowsException()");
                    }
                });
View Full Code Here

Examples of org.apache.tapestry5.services.MethodInvocationResult

                        // the parameters to the original method, so that they can be mapped
                        // to some other method (including a MethodAccess).

                        Integer parameter = (Integer) invocation.getParameter(0);

                        MethodInvocationResult result = incrementerAccess.invoke(invocation.getInstance(), parameter);

                        invocation.overrideResult(result.getReturnValue());
                    }
                });
            }
        });
View Full Code Here

Examples of org.apache.tapestry5.services.MethodInvocationResult

                    public void advise(ComponentMethodInvocation invocation)
                    {
                        // Don't even bother with proceed() this time, which is OK (but
                        // somewhat rare).

                        MethodInvocationResult result = targetMethodAccess.invoke(invocation.getInstance(), invocation
                                .getParameter(0), invocation.getParameter(1));

                        invocation.overrideResult(result.getReturnValue());
                    }
                });
            }
        });
View Full Code Here

Examples of org.jboss.mx.remote.MethodInvocationResult

    }

    private Object deserializeResult(byte[] bytes) throws Exception, ClassNotFoundException
    {
        // de-serialize the method invocation result
        MethodInvocationResult result = (MethodInvocationResult) SerializationHelper.deserialize(bytes);

        //TODO -TME Need to check if exception.  If it is, then throw it?
        Object obj = result.getResult();
        return obj;
    }
View Full Code Here

Examples of org.jboss.mx.remote.MethodInvocationResult

        RemoteMethodInvocation method = new RemoteMethodInvocation(name, arg, sig);
        byte buf[] = SerializationHelper.serialize(method);

        byte[] bytes = connector.invoke(buf);
        // de-serialize the method invocation result
        MethodInvocationResult result = (MethodInvocationResult) SerializationHelper.deserialize(bytes);

        System.out.println("result = " + result);

        //TODO -TME Need to check if exception.  If it is, then throw it?
        Object obj = result.getResult();

        return obj;
    }
View Full Code Here

Examples of org.jboss.mx.remote.MethodInvocationResult

        {
            Object obj = SerializationHelper.deserialize(in0);
            RemoteMethodInvocation mi = (RemoteMethodInvocation) obj;
            Object invokeResult = connectorSvr.invoke(null, mi);

            MethodInvocationResult result = new MethodInvocationResult(invokeResult);
            // return the byte buffer result
            returnBuf = SerializationHelper.serialize(result);
        }
        catch(Throwable e)
        {
View Full Code Here

Examples of org.jboss.mx.remote.MethodInvocationResult

        byte[] returnBuf = null;
        try
        {
            Object invokeResult = connectorSvr.getNotifications(in0);

            MethodInvocationResult result = new MethodInvocationResult(invokeResult);
            // return the byte buffer result
            returnBuf = SerializationHelper.serialize(result);
        }
        catch(Throwable e)
        {
View Full Code Here

Examples of org.jboss.mx.remote.MethodInvocationResult

                        left -= amt;
                        in.write(buf, 0, amt);
                    }

                    // deserialize incoming buffer
                    MethodInvocationResult result = null;
                    try
                    {
                        // ask the executor to invoke the method
                        RemoteMethodInvocation mi = (RemoteMethodInvocation) SerializationHelper.deserialize(in.toByteArray());
                        result = new MethodInvocationResult(executor.invoke(addr, mi));
                    }
                    catch (ClassNotFoundException cnf)
                    {
                        log.error("Class Not Found during de-serializing of remote method invocation.",cnf);
                        result = new MethodInvocationResult(cnf);
                    }
                    catch (Throwable t)
                    {
                        if (logMethod && log.isDebugEnabled())
                        {
                            log.debug("Exception in method execution ...",t);
                        }
                        result = new MethodInvocationResult(t);
                    }

                    in = null;

                    // return the byte buffer result
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.