REFLEX.reflection
Class Delegation

java.lang.Object
  |
  +--REFLEX.reflection.Delegation
All Implemented Interfaces:
java.io.Serializable

public abstract class Delegation
extends java.lang.Object
implements java.io.Serializable

All behaviour classes must be implemented by objects providing dispatcher delegated methods. Therefore behavioural objects usually extend from this class.


Constructor Summary
Delegation()
           
 
Method Summary
abstract  java.lang.Object delegate(java.lang.Object proxy, java.lang.reflect.Method m, java.lang.Object[] args)
          Delegated method behaviour for the dispatcher to call for the exported public component interface.
 boolean delegateCondition(java.lang.Object proxy, java.lang.reflect.Method m, java.lang.Object[] args)
          Set a condition on the delegation.
 boolean fireNotification()
          Override this method to return true if event notification to remote listeners is required for this method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Delegation

public Delegation()
Method Detail

delegate

public abstract java.lang.Object delegate(java.lang.Object proxy,
                                          java.lang.reflect.Method m,
                                          java.lang.Object[] args)
Delegated method behaviour for the dispatcher to call for the exported public component interface. For each exported method on the RComponent a delegation to the method's implementation should be provided via over-ridding this method.

Parameters:
proxy - The calling object.
m - The method to be trapped.
args - An array of arguments passed to the method.
Returns:
The object returned by the delegated method.

delegateCondition

public boolean delegateCondition(java.lang.Object proxy,
                                 java.lang.reflect.Method m,
                                 java.lang.Object[] args)
Set a condition on the delegation. If the condition is not met then a DelegationConditionException is thrown to be handled by the client. This feature is used to provide facilities such as resource reflection, whereby an invocation is conditional based upon some external requirement being met. For example, sufficent network bandwidth, or the availability of a specific network service. Over-ride this method to provide custom condition behaviour.

Parameters:
proxy - The calling object.
m - The method being invoked by the proxy.
args - An array of arguments passed to the method.
Returns:
true if the delegation can proceed, otherwise false.

fireNotification

public boolean fireNotification()
Override this method to return true if event notification to remote listeners is required for this method. If enabled then all listeners for the particular RComponent will be notified when this method is invoked.

Returns:
true to enable remote event notification to any registered listeners for this RComponent when this particular method delegation occurs. If set to return false then the delegation does not fire any events for this particular method.