|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectoranjestad.commons.beanutils.messaging.Channel
public class Channel
A Channel defines a means by which a bean sends notifications
via a listener interface.
A Channel is typically inferred by two pairs of methods with the following signatures.
public void addChannelName(ListenerInterface);
public void/boolean removeChannelName)(ListenerInterface);
| Constructor Summary | |
|---|---|
Channel()
|
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
|
protected java.lang.reflect.Method[] |
findSameNameLength(java.lang.Object producer,
java.lang.reflect.Method originalMethod,
java.lang.Object[] args,
int listenerIndex)
Internal method that searches for an add method that has the same name and number of arguments. |
protected java.lang.reflect.Method[] |
findSameNameSignature(java.lang.Object producer,
java.lang.reflect.Method originalMethod,
java.lang.Object[] args)
Method for searching for a method with the same name but a different signature. |
java.lang.reflect.Method |
getAddListenerMethod()
|
java.lang.reflect.Method |
getAddListenerMethod(java.lang.Object producer,
java.lang.Object[] args,
int listenerIndex)
Method that tries to match the add-listener method with the supplied parameters. |
java.lang.Class<?> |
getListenerInterface()
Gets the listener class that is parameter passed into the add and remove
methods. |
java.lang.String |
getName()
|
java.lang.reflect.Method |
getRemoveListenerMethod()
|
int |
hashCode()
|
void |
setAddListenerMethod(java.lang.reflect.Method method)
Sets the add listener method (typically called during introspectoin). |
void |
setListenerInterface(java.lang.Class listenerInterface)
Sets the listener interface (typically called during introspection). |
void |
setName(java.lang.String name)
Sets the channel name (typically called during introspection). |
void |
setRemoveListenerMethod(java.lang.reflect.Method method)
Sets the remove listener method (typically called during introspection). |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Channel()
| Method Detail |
|---|
public java.lang.String getName()
public void setName(java.lang.String name)
name - Channel name.public java.lang.reflect.Method getAddListenerMethod()
public java.lang.reflect.Method getAddListenerMethod(java.lang.Object producer,
java.lang.Object[] args,
int listenerIndex)
producer - The producer to search for the method on.args - The arguments to match against.listenerIndex - The index of the listener (as supplied by caller).
java.lang.IllegalArgumentException - if no method can be found.public void setAddListenerMethod(java.lang.reflect.Method method)
method - Add listener method.public java.lang.reflect.Method getRemoveListenerMethod()
public void setRemoveListenerMethod(java.lang.reflect.Method method)
method - The remove listener method.public java.lang.Class<?> getListenerInterface()
add and remove
methods.
public void setListenerInterface(java.lang.Class listenerInterface)
listenerInterface - The listener interface.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
protected java.lang.reflect.Method[] findSameNameSignature(java.lang.Object producer,
java.lang.reflect.Method originalMethod,
java.lang.Object[] args)
Method for searching for a method with the same name but a different signature.
producer - The producer to search for the method on.originalMethod - The original method (whose signature doesn't match).args - The arguments.
protected java.lang.reflect.Method[] findSameNameLength(java.lang.Object producer,
java.lang.reflect.Method originalMethod,
java.lang.Object[] args,
int listenerIndex)
Internal method that searches for an add method that has the same name and number of arguments. Also, if the listenerIndex is supplied (i.e. greather than -1) then all parameters other than the listener index must match.
The listener index can potentially not match because a generic listener could be used to wrap this listener and adapt methods to invoke into an aribtrary listener.
producer - The producer of messages.originalMethod - The original (default) add listener method.args - The arguments to the add method being invoked.listenerIndex - The index of the listener in the args array.
This might be a negative number if the listener is unknown.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||