irc
Class EventDispatcher

java.lang.Object
  |
  +--irc.EventDispatcher

public class EventDispatcher
extends java.lang.Object

Event dispatcher, using reflection.


Constructor Summary
EventDispatcher()
           
 
Method Summary
static void clearCache()
          Clear the internal EventDispatcher method call.
static java.lang.Object dispatchEvent(java.lang.Object target, java.lang.String method, java.lang.Object[] params)
          Dispatch a new event to the given target.
static java.lang.Thread dispatchEventAsync(java.lang.Object target, java.lang.String method, java.lang.Object[] params)
          Dispatch the given event in a new thread.
static java.lang.Thread dispatchEventAsync(java.lang.Object target, java.lang.String method, java.lang.Object[] params, java.lang.Object lock)
          Dispatch the given event in a new thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventDispatcher

public EventDispatcher()
Method Detail

clearCache

public static void clearCache()
Clear the internal EventDispatcher method call.


dispatchEventAsync

public static java.lang.Thread dispatchEventAsync(java.lang.Object target,
                                                  java.lang.String method,
                                                  java.lang.Object[] params)
Dispatch the given event in a new thread. Event return value is discarded.

Parameters:
target - event target.
method - event method name.
params - event parameters.
Returns:
the started thread in wich the event is called.

dispatchEventAsync

public static java.lang.Thread dispatchEventAsync(java.lang.Object target,
                                                  java.lang.String method,
                                                  java.lang.Object[] params,
                                                  java.lang.Object lock)
Dispatch the given event in a new thread. Event return value is discarded.

Parameters:
target - event target.
method - event method name.
params - event parameters.
lock - if not null, the newly created thread will wait on this lock before attempting to execute the event. If the thread is interrupted while waiting, the event will not be executed.
Returns:
the started thread in wich the event is called.

dispatchEvent

public static java.lang.Object dispatchEvent(java.lang.Object target,
                                             java.lang.String method,
                                             java.lang.Object[] params)
Dispatch a new event to the given target.

Parameters:
target - target event listener.
method - method name to call.
params - parameters to pass to the called method.
Returns:
method result.