net.sf.webmancer.base
Class Event

java.lang.Object
  extended by net.sf.webmancer.base.Event
Direct Known Subclasses:
FinalizationEvent, InitializationEvent, RequestEvent

public class Event
extends java.lang.Object

Author:
Michal Burda

Constructor Summary
Event()
          Creates new broadcast event.
Event(java.lang.String target)
          Creates new event that is adressed to target object target.
 
Method Summary
 java.lang.String getTarget()
          Return the target object's name or null, if the current event is broadcast.
 boolean isBroadcast()
          Returns true if the current event is a broadcast event.
 boolean isHandled()
          Returns true if the event has been handled already.
 void setHandled(boolean handled)
          Set the handled flag to the event.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Event

public Event(java.lang.String target)
Creates new event that is adressed to target object target. A null target means a broadcast event.

Parameters:
target - The target object identification or null for broadcast event.

Event

public Event()
Creates new broadcast event.

Method Detail

isHandled

public boolean isHandled()
Returns true if the event has been handled already. Broadcast events return always false.

Returns:
true if the event has been handled already.

isBroadcast

public boolean isBroadcast()
Returns true if the current event is a broadcast event. Broadcast events do not have any concrete target.

Returns:
true if the current event is a broadcast event.

getTarget

public java.lang.String getTarget()
Return the target object's name or null, if the current event is broadcast.

Returns:
the target object's name

setHandled

public void setHandled(boolean handled)
Set the handled flag to the event. Broadcast events cannot be set to handled.

Parameters:
handled - the handled flag
Throws:
java.lang.IllegalStateException - if setting handled for a broadcast event

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2006-2007. All Rights Reserved.