org.sonatype.sisu.goodies.eventbus.internal.guava
Class EventHandler

java.lang.Object
  extended by org.sonatype.sisu.goodies.eventbus.internal.guava.EventHandler

public class EventHandler
extends Object

Wraps a single-argument 'handler' method on a specific object.

This class only verifies the suitability of the method and event type if something fails. Callers are expected to verify their uses of this class.

Two EventHandlers are equivalent when they refer to the same method on the same object (not class). This property is used to ensure that no handler method is registered more than once.

Author:
Cliff Biffle

Method Summary
 boolean equals(Object obj)
           
 void handleEvent(Object event)
          Invokes the wrapped handler method to handle event.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

handleEvent

public void handleEvent(Object event)
                 throws InvocationTargetException
Invokes the wrapped handler method to handle event.

Parameters:
event - event to handle
Throws:
InvocationTargetException - if the wrapped method throws any Throwable that is not an Error (Errors are propagated as-is).

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2008-2012 Sonatype, Inc.. All Rights Reserved.