org.apache.geronimo.interceptor
Interface InvocationResult

All Known Implementing Classes:
SimpleInvocationResult

public interface InvocationResult

The result of an Invocation. There are two types of result:

Note that these should both be considered a normal completion of the operation by the container. Abnormal completions, such as a RuntimeException or Error from the invocation, or any problem in the interceptor chain itself, should result in a Throwable being thrown up the chain rather than being contained in this result.

This distinction mirrors the semantics for EJB invocations, where a business method is considered to have completed successfuly even if it throws declared Exception - the Exception there is indicating a business level issue and not a system problem.


Method Summary
 Exception getException()
          Get the application exception raised by the invocation.
 Object getResult()
          Get the return value from the invocation.
 boolean isException()
          Was an application exception raised by the invocation?
 boolean isNormal()
          Was this a normal completion (return)?
 

Method Detail

isNormal

boolean isNormal()
Was this a normal completion (return)?

Returns:
true if the invocation returned; false if a declared exception was thrown

getResult

Object getResult()
Get the return value from the invocation. It is an error to call this method if the invocation is not complete normally.

Returns:
the return value from the invocation; null if the operation was void

isException

boolean isException()
Was an application exception raised by the invocation? Note, this indicates a checked application exception was thrown; this will never contain a system exception

Returns:
true if a declared exception was thrown; false if the invocation returned

getException

Exception getException()
Get the application exception raised by the invocation. It is an error to call this method if the invocation did not raise an exception

Returns:
the checked Exception raised by the application


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.