|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.jomc.ri.DefaultInvoker
@Generated(value="org.jomc.tools.JavaSources",
comments="See http://jomc.sourceforge.net/jomc/1.0-alpha-8/jomc-tools")
public class DefaultInvoker
Default Invoker implementation.
DefaultInvocation| Constructor Summary | |
|---|---|
DefaultInvoker()
Creates a new DefaultInvoker instance. |
|
| Method Summary | |
|---|---|
Object |
invoke(org.jomc.spi.Invocation invocation)
Performs a method invocation on an object. |
org.jomc.spi.Invocation |
postInvoke(org.jomc.spi.Invocation invocation)
Called after an invocation has been performed. |
org.jomc.spi.Invocation |
preInvoke(org.jomc.spi.Invocation invocation)
Called before an invocation is performed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@Generated(value="org.jomc.tools.JavaSources",
comments="See http://jomc.sourceforge.net/jomc/1.0-alpha-8/jomc-tools")
public DefaultInvoker()
DefaultInvoker instance.
| Method Detail |
|---|
public Object invoke(org.jomc.spi.Invocation invocation)
throws Throwable
This method first passes the given invocation to the preInvoke method. If the result property of the
invocation returned by the preInvoke method is an instance of Throwable, that instance will be
thrown; otherwise the invocation returned by the preInvoke method is performed and then passed to the
postInvoke method. If the result property of the invocation returned from the postInvoke method
is an instance of Throwable, that instance will be thrown; otherwise the value of the result property is
returned by this method.
invoke in interface org.jomc.spi.Invokerinvocation - The invocation to perform.
null and the declared return type of the method of the invocation
is primitive, then a NullPointerException will be thrown. If the value returned by this method is
otherwise not compatible to the declared return type of the method of the invocation, a
ClassCastException will be thrown.
Throwable - The exception thrown from the method invocation. The exception's type must be assignable
either to any of the exception types declared in the throws clause of the method of the invocation or to
the unchecked exception types java.lang.RuntimeException or java.lang.Error.
If a checked exception is thrown by this method that is not assignable to any of the exception types declared in
the throws clause of the method of the invocation, then an UndeclaredThrowableException
containing the exception that was thrown by this method will be thrown.preInvoke(org.jomc.spi.Invocation),
postInvoke(org.jomc.spi.Invocation)public org.jomc.spi.Invocation preInvoke(org.jomc.spi.Invocation invocation)
Overriding classes may use this method to perform any kind of operation prior to an invocation and to create
custom invocation instances. If an overriding class wishes to throw an exception, it may do so by setting the
result property of the returned invocation to an instance of Throwable thrown as the result of the
invocation. If an overriding class wishes to provide a custom Invocation class, it may do so by returning
a different instance from this method. By default, this method does nothing and returns the given invocation
unchanged.
invocation - The invocation about to be performed.
NullPointerException - if invocation is null.public org.jomc.spi.Invocation postInvoke(org.jomc.spi.Invocation invocation)
Overriding classes may use this method to perform any kind of operation after an invocation has been
performed and to maintain custom invocation instances. If an overriding class wishes to throw an exception, it
may do so by setting the result property of the returned invocation to an instance of Throwable thrown as
the result of the invocation. Since the result property of the given invocation already holds the result of the
invocation (which may already be an instance of Throwable), care must be taken when updating that result.
By default, this method does nothing and returns the given invocation unchanged.
invocation - The performed invocation.
NullPointerException - if invocation is null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||