Package ej.kf
Class Proxy<T>
- java.lang.Object
-
- ej.kf.Proxy<T>
-
- Type Parameters:
T- the type managed by thisProxy
public class Proxy<T> extends Object
The superclass of proxy classes. A proxy class is a class that directly extends this class and directly implements a shared interface. Each method of the implemented interface must be defined according to the following pattern:public class MyProxy extends Proxy<MySharedInterface> implements MySharedInterface{ public void foo(){ try{ invoke(); } catch(Throwable e){ // return or throw default case (deny of service) } }AProxyinstance has a link to a reference owned by anotherFeature. The reference may be automatically removed by the garbage collector.
-
-
Constructor Summary
Constructors Constructor Description Proxy()The default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetReference()Returns the reference managed by thisProxy.protected voidinvoke()This method has for effect to invoke the same method on the reference.protected booleaninvokeBoolean()This method has for effect to invoke the same method on the reference.protected byteinvokeByte()This method has for effect to invoke the same method on the reference.protected charinvokeChar()This method has for effect to invoke the same method on the reference.protected doubleinvokeDouble()This method has for effect to invoke the same method on the reference.protected floatinvokeFloat()This method has for effect to invoke the same method on the reference.protected intinvokeInt()This method has for effect to invoke the same method on the reference.protected longinvokeLong()This method has for effect to invoke the same method on the reference.protected ObjectinvokeRef()This method has for effect to invoke the same method on the reference.protected shortinvokeShort()This method has for effect to invoke the same method on the reference.
-
-
-
Method Detail
-
invoke
protected final void invoke() throws ThrowableThis method has for effect to invoke the same method on the reference. Each argument of the current method is converted and passed to the underlying method.- Throws:
Throwable- any kind of exceptions must be catched by the caller
-
invokeBoolean
protected final boolean invokeBoolean() throws ThrowableThis method has for effect to invoke the same method on the reference. Each argument of the current method is converted and passed to the underlying method.- Returns:
- the boolean result of the call of the target method
- Throws:
Throwable- any kind of exceptions must be catched by the caller
-
invokeByte
protected final byte invokeByte() throws ThrowableThis method has for effect to invoke the same method on the reference. Each argument of the current method is converted and passed to the underlying method.- Returns:
- the byte result of the call of the target method
- Throws:
Throwable- any kind of exceptions must be catched by the caller
-
invokeChar
protected final char invokeChar() throws ThrowableThis method has for effect to invoke the same method on the reference. Each argument of the current method is converted and passed to the underlying method.- Returns:
- the char result of the call of the target method
- Throws:
Throwable- any kind of exceptions must be catched by the caller
-
invokeShort
protected final short invokeShort() throws ThrowableThis method has for effect to invoke the same method on the reference. Each argument of the current method is converted and passed to the underlying method.- Returns:
- the short result of the call of the target method
- Throws:
Throwable- any kind of exceptions must be catched by the caller
-
invokeInt
protected final int invokeInt() throws ThrowableThis method has for effect to invoke the same method on the reference. Each argument of the current method is converted and passed to the underlying method.- Returns:
- the int result of the call of the target method
- Throws:
Throwable- any kind of exceptions must be catched by the caller
-
invokeLong
protected final long invokeLong() throws ThrowableThis method has for effect to invoke the same method on the reference. Each argument of the current method is converted and passed to the underlying method.- Returns:
- the long result of the call of the target method
- Throws:
Throwable- any kind of exceptions must be catched by the caller
-
invokeFloat
protected final float invokeFloat() throws ThrowableThis method has for effect to invoke the same method on the reference. Each argument of the current method is converted and passed to the underlying method.- Returns:
- the float result of the call of the target method
- Throws:
Throwable- any kind of exceptions must be catched by the caller
-
invokeDouble
protected final double invokeDouble() throws ThrowableThis method has for effect to invoke the same method on the reference. Each argument of the current method is converted and passed to the underlying method.- Returns:
- the double result of the call of the target method
- Throws:
Throwable- any kind of exceptions must be catched by the caller
-
invokeRef
protected final Object invokeRef() throws Throwable
This method has for effect to invoke the same method on the reference. Each argument of the current method is converted and passed to the underlying method.
-
-