Package org.oddjob.events
Class EventServiceBase<T>
java.lang.Object
org.oddjob.framework.extend.BaseComponent
org.oddjob.framework.extend.BasePrimary
org.oddjob.events.EventServiceBase<T>
- Type Parameters:
T- The type of the event.
- All Implemented Interfaces:
Runnable,ArooaContextAware,ArooaSessionAware,Outbound<T>,PropertyChangeNotifier,Iconic,LogEnabled,Resettable,Stateful,Stoppable
- Direct Known Subclasses:
EventWatchComponent,ForEvents,ListSource,StreamWatcher
public abstract class EventServiceBase<T>
extends BasePrimary
implements Outbound<T>, Runnable, Resettable, Stateful, Stoppable
Base class for components that want Event Icons because the objects the emmit are in the style of events
rather than streams of data. Implementations can either be used in
BasicBusService
or as EventSources using an EventSourceAdaptor as happens automatically in EventJobBase.
Implementations need only implement doStart(Consumer).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Restoreprotected voidInternal method to fire state.protected final StateChanger<EventState> booleanPerform a hard reset.protected IconHelperSubclasses must provide aIconHelper.protected voidAllow sub classes to do something on a hard reset.protected voidonReset()Allow sub classes to do something on reset.protected voidAllow subclasses to do something on a soft reset.voidrun()protected voidvoidSet the out bound destination.booleanPerform a soft reset.protected EventStateHandlerSubclasses must provide aStateHandler.final voidstop()Allow subclasses to indicate they are stopping.Methods inherited from class org.oddjob.framework.extend.BasePrimary
configure, getName, logger, logger, loggerName, save, setName, toStringMethods inherited from class org.oddjob.framework.extend.BaseComponent
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onDestroy, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSessionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.oddjob.Stateful
addStateListener, lastStateEvent, removeStateListener
-
Constructor Details
-
EventServiceBase
public EventServiceBase()Constructor.
-
-
Method Details
-
stateHandler
Description copied from class:BaseComponentSubclasses must provide aStateHandler.- Specified by:
stateHandlerin classBaseComponent- Returns:
- A State Handler. Never null.
-
iconHelper
Description copied from class:BaseComponentSubclasses must provide aIconHelper.- Specified by:
iconHelperin classBaseComponent- Returns:
- An Icon Helper. Never null.
-
getStateChanger
-
run
public void run() -
setStateException
-
doStart
- Throws:
Exception
-
stop
public final void stop()Allow subclasses to indicate they are stopping. The subclass must still implement Stoppable. -
softReset
public boolean softReset()Description copied from interface:ResettablePerform a soft reset.- Specified by:
softResetin interfaceResettable- Returns:
- true if successful.
-
hardReset
public boolean hardReset()Description copied from interface:ResettablePerform a hard reset.- Specified by:
hardResetin interfaceResettable- Returns:
- true if successful.
-
onSoftReset
protected void onSoftReset()Allow subclasses to do something on a soft reset. Defaults toonReset() -
onHardReset
protected void onHardReset()Allow sub classes to do something on a hard reset. Defaults toonReset() -
onReset
protected void onReset()Allow sub classes to do something on reset. -
setTo
Description copied from interface:OutboundSet the out bound destination. -
fireDestroyedState
protected void fireDestroyedState()Internal method to fire state.- Specified by:
fireDestroyedStatein classBaseComponent
-