cz.cuni.amis.pogamut.base.component.bus.event
Class ComponentBusEvents

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.component.bus.event.ComponentBusEvents
Direct Known Subclasses:
AgentEvents

public class ComponentBusEvents
extends java.lang.Object

This class provides simple methods for propagation of events that happened in some component.

Every component should instantiate this class for itself as it provides a convenient way to send new events into the bus (but it is not mandatory).

There is a possibility to disable sending of all events by setting false via setBroadcasting(boolean). Think of it as applying aspect to all event-broadcasting used by your class which allows you to disable the cross-cutting concern of sending events.


Field Summary
protected  boolean broadcasting
          Whether the event broadcasting is enabled.
protected  IComponentBus bus
           
protected  IComponent component
           
protected  java.util.logging.Logger log
           
 
Constructor Summary
ComponentBusEvents(IComponentBus bus, IComponent component, java.util.logging.Logger log)
           
 
Method Summary
 boolean fatalError(java.lang.String message)
           
 boolean fatalError(java.lang.String message, java.lang.Throwable cause)
           
 boolean fatalError(java.lang.Throwable cause)
           
 boolean isBroadcasting()
          When some method is called to broadcast some event then it will go through ONLY IFF isBroadcasting().
 boolean paused()
           
 boolean paused(java.lang.String message)
           
 boolean pausedTransactional()
           
 boolean pausedTransactional(java.lang.String message)
           
 boolean pausing()
           
 boolean pausing(java.lang.String message)
           
 boolean pausingTransactional()
           
 boolean pausingTransactional(java.lang.String message)
           
 boolean resumed()
           
 boolean resumed(java.lang.String message)
           
 boolean resumedTransactional()
           
 boolean resumedTransactional(java.lang.String message)
           
 boolean resuming()
           
 boolean resuming(java.lang.String message)
           
 boolean resumingTransactional()
           
 boolean resumingTransactional(java.lang.String message)
           
 void setBroadcasting(boolean broadcasting)
          This may enable (== true) / disable (== false) whether this object will actually be sending any events or not.
 boolean started()
           
 boolean started(java.lang.String message)
           
 boolean startedTransactional()
           
 boolean startedTransactional(java.lang.String message)
           
 boolean starting()
           
 boolean starting(java.lang.String message)
           
 boolean startingPaused()
           
 boolean startingPaused(java.lang.String message)
           
 boolean startingPausedTransactional()
           
 boolean startingPausedTransactional(java.lang.String message)
           
 boolean startingTransactional()
           
 boolean startingTransactional(java.lang.String message)
           
 boolean stopped()
           
 boolean stopped(java.lang.String message)
           
 boolean stoppedTransactional()
           
 boolean stoppedTransactional(java.lang.String message)
           
 boolean stopping()
           
 boolean stopping(java.lang.String message)
           
 boolean stoppingTransactional()
           
 boolean stoppingTransactional(java.lang.String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bus

protected IComponentBus bus

component

protected IComponent component

log

protected java.util.logging.Logger log

broadcasting

protected boolean broadcasting
Whether the event broadcasting is enabled.

Constructor Detail

ComponentBusEvents

public ComponentBusEvents(IComponentBus bus,
                          IComponent component,
                          java.util.logging.Logger log)
Method Detail

isBroadcasting

public boolean isBroadcasting()
When some method is called to broadcast some event then it will go through ONLY IFF isBroadcasting().

Returns:

setBroadcasting

public void setBroadcasting(boolean broadcasting)
This may enable (== true) / disable (== false) whether this object will actually be sending any events or not.

Parameters:
broadcasting -

starting

public boolean starting()

starting

public boolean starting(java.lang.String message)

startingPaused

public boolean startingPaused()

startingPaused

public boolean startingPaused(java.lang.String message)

started

public boolean started()

started

public boolean started(java.lang.String message)

pausing

public boolean pausing()

pausing

public boolean pausing(java.lang.String message)

paused

public boolean paused()

paused

public boolean paused(java.lang.String message)

resuming

public boolean resuming()

resuming

public boolean resuming(java.lang.String message)

resumed

public boolean resumed()

resumed

public boolean resumed(java.lang.String message)

stopping

public boolean stopping()

stopping

public boolean stopping(java.lang.String message)

stopped

public boolean stopped()

stopped

public boolean stopped(java.lang.String message)

fatalError

public boolean fatalError(java.lang.String message)

fatalError

public boolean fatalError(java.lang.String message,
                          java.lang.Throwable cause)

fatalError

public boolean fatalError(java.lang.Throwable cause)

startingTransactional

public boolean startingTransactional()

startingTransactional

public boolean startingTransactional(java.lang.String message)

startingPausedTransactional

public boolean startingPausedTransactional()

startingPausedTransactional

public boolean startingPausedTransactional(java.lang.String message)

startedTransactional

public boolean startedTransactional()

startedTransactional

public boolean startedTransactional(java.lang.String message)

pausingTransactional

public boolean pausingTransactional()

pausingTransactional

public boolean pausingTransactional(java.lang.String message)

pausedTransactional

public boolean pausedTransactional()

pausedTransactional

public boolean pausedTransactional(java.lang.String message)

resumingTransactional

public boolean resumingTransactional()

resumingTransactional

public boolean resumingTransactional(java.lang.String message)

resumedTransactional

public boolean resumedTransactional()

resumedTransactional

public boolean resumedTransactional(java.lang.String message)

stoppingTransactional

public boolean stoppingTransactional()

stoppingTransactional

public boolean stoppingTransactional(java.lang.String message)

stoppedTransactional

public boolean stoppedTransactional()

stoppedTransactional

public boolean stoppedTransactional(java.lang.String message)