Novell exteNd
Director 5.2 API

com.sssw.fw.event.api
Interface EbiStateChangeProducer

All Known Subinterfaces:
EbiContentManager, EbiContentMgmtDelegate, EbiStateChangeProducer, EbiTaskManager, EbiTaskManager, EbiTaskMgmtDelegate

public interface EbiStateChangeProducer

Represents a state change event producer. Provides abilities to register and unregister a state change listener and also fires state change events.


Method Summary
 boolean addStateChangeListener(BitSet events, EbiStateChangeListener listener)
          Adds a state change event listener that only listens on a specific set of events.
 boolean addStateChangeListener(EbiStateChangeListener listener)
          Adds a state change event listener.
 boolean addVetoableStateChangeListener(BitSet events, EbiVetoableStateChangeListener listener)
          Adds a vetoable state change event listener that only listens on a specific set of events.
 boolean addVetoableStateChangeListener(EbiVetoableStateChangeListener listener)
          Adds a vetoable state change event listener.
 void fireStateChange(EboStateChangeEvent event)
          Fires off a state change event.
 boolean fireVetoableStateChange(EboStateChangeEvent event)
          Fires off a vetoable state change event.
 Collection getListeners()
          Gets the list of all regular listeners registered with the producer.
 String getScpDescription()
          Gets the description of this state change producer.
 EbiLog getScpLog()
          Gets the log set up for the state change producer
 Collection getVetoableListeners()
          Gets the list of all vetoable listeners registered with the producer.
 boolean hasListeners()
          Tells whether the producer has any (regular) listeners registered.
 boolean hasVetoableListeners()
          Tells whether the producer has any vetoable listeners registered.
 boolean removeStateChangeListener(EbiStateChangeListener listener)
          Removes a state change event listener.
 boolean removeVetoableStateChangeListener(EbiVetoableStateChangeListener listener)
          Removes a vetoable state change event listener.
 void setScpDescription(String descr)
          Sets an (optional) description for the state change producer.
 void setScpLog(EbiLog log)
          Sets the log for the state change producer
 

Method Detail

addStateChangeListener

public boolean addStateChangeListener(EbiStateChangeListener listener)
Adds a state change event listener.
Parameters:
listener - listener to add
Returns:
true if the listener is added successfully, false if it had already been added before

addVetoableStateChangeListener

public boolean addVetoableStateChangeListener(EbiVetoableStateChangeListener listener)
Adds a vetoable state change event listener.
Parameters:
listener - listener to add
Returns:
true if the listener is added successfully, false if it had already been added before

addStateChangeListener

public boolean addStateChangeListener(BitSet events,
                                      EbiStateChangeListener listener)
Adds a state change event listener that only listens on a specific set of events.
Parameters:
events - a bit set of event identifiers
listener - listener to add
Returns:
true if the listener is added successfully, false if it had already been added before

addVetoableStateChangeListener

public boolean addVetoableStateChangeListener(BitSet events,
                                              EbiVetoableStateChangeListener listener)
Adds a vetoable state change event listener that only listens on a specific set of events.
Parameters:
events - a bit set of event identifiers
listener - listener to add
Returns:
true if the listener is added successfully, false if it had already been added before

removeStateChangeListener

public boolean removeStateChangeListener(EbiStateChangeListener listener)
Removes a state change event listener.
Parameters:
listener - listener to remove
Returns:
true if the listener was successfully removed, false if it was not found

removeVetoableStateChangeListener

public boolean removeVetoableStateChangeListener(EbiVetoableStateChangeListener listener)
Removes a vetoable state change event listener.
Parameters:
listener - listener to remove
Returns:
true if the listener was successfully removed, false if it was not found

fireStateChange

public void fireStateChange(EboStateChangeEvent event)
Fires off a state change event. Note that the out-of-the-box implementation of the state change producer sends the event to listeners in the same order as they were added to the producer.
Parameters:
event - the event to fire off

fireVetoableStateChange

public boolean fireVetoableStateChange(EboStateChangeEvent event)
Fires off a vetoable state change event. The producer is expected to call this method prior to acting upon it. The event is vetoed if at least one of the registered vetoable event listeners returns false from their vetoableStateChanged method. Note that the out-of-the-box implementation of the state change producer sends the event to vetoable listeners in the same order as they were added to the producer.
Parameters:
event - the event to fire off
Returns:
false if the event was vetoed, true otherwise

setScpLog

public void setScpLog(EbiLog log)
Sets the log for the state change producer
Parameters:
log - the log

getScpLog

public EbiLog getScpLog()
Gets the log set up for the state change producer
Returns:
log the log or null if none set

setScpDescription

public void setScpDescription(String descr)
Sets an (optional) description for the state change producer.
Parameters:
descr - the description for the state change producer

getScpDescription

public String getScpDescription()
Gets the description of this state change producer.
Returns:
the description of this state change producer or null if none set

hasListeners

public boolean hasListeners()
Tells whether the producer has any (regular) listeners registered.
Returns:
true if there is at least one listener registered, false otherwise

hasVetoableListeners

public boolean hasVetoableListeners()
Tells whether the producer has any vetoable listeners registered.
Returns:
true if there is at least one vetoable listener registered, false otherwise

getListeners

public Collection getListeners()
Gets the list of all regular listeners registered with the producer.
Returns:
a collection of EbiStateChangeListener's which is empty if no listeners have been registered

getVetoableListeners

public Collection getVetoableListeners()
Gets the list of all vetoable listeners registered with the producer.
Returns:
a collection of EbiVetoableStateChangeListener's which is empty if no vetoable listeners have been registered

Novell exteNd
Director 5.2 API