Package org.oddjob.web
Class WebClientJob
java.lang.Object
org.oddjob.framework.extend.BaseComponent
org.oddjob.framework.extend.SimpleService
org.oddjob.web.WebClientJob
- All Implemented Interfaces:
Runnable,ArooaContextAware,ArooaSessionAware,BeanDirectoryOwner,PropertyChangeNotifier,Iconic,RemoteDirectoryOwner,ConsoleArchiver,LogArchiver,LogEnabled,Resettable,Stateful,Stoppable,Structural
public class WebClientJob
extends SimpleService
implements Structural, LogArchiver, ConsoleArchiver, RemoteDirectoryOwner
- Author:
- Rob Gordon
Description
An Oddjob client that works over http.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from interface org.oddjob.logging.LogArchiver
MAX_HISTORY, NO_LOG_AVAILABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConsoleListener(LogListener l, Object component, long last, int max) Add a listener to the archiver which will receive all missed events.voidaddLogListener(LogListener l, Object component, LogLevel level, long last, int history) Add a listener to the archiver which will receive all missed events.voidaddStructuralListener(StructuralListener listener) Add a listener.consoleIdFor(Object component) Get the console id for a given component.protected voiddoStop(WebClientJob.WhyStop why, Exception cause) longgetHost()longintintintgetPort()voidSubclasses override this method to perform post creation initialisation.protected voidonStart()protected voidonStop()Allow sub classes to do something on stop.protected voidProvide a remote directory.voidremoveConsoleListener(LogListener l, Object component) Remove the LogListener.voidremoveLogListener(LogListener l, Object component) Remove the LogListener.voidremoveStructuralListener(StructuralListener listener) Remove a listener.voidsetHandlerFactories(HandlerFactoryProvider handlerFactories) voidsetHeartbeat(long heartbeat) voidvoidsetLogPollingInterval(long logPollingInterval) voidsetMaxConsoleLines(int maxConsoleLines) voidsetMaxLoggerLines(int maxLoggerLines) voidsetPort(int port) Methods inherited from class org.oddjob.framework.extend.SimpleService
fireDestroyedState, getName, getStateChanger, hardReset, iconHelper, logger, loggerName, onDestroy, run, setName, softReset, stateHandler, stop, toStringMethods inherited from class org.oddjob.framework.extend.BaseComponent
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, removeIconListener, removePropertyChangeListener, removeStateListener, save, 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
-
Field Details
-
DEFAULT_LOG_POLLING_INTERVAL
public static final long DEFAULT_LOG_POLLING_INTERVAL- See Also:
-
-
Constructor Details
-
WebClientJob
public WebClientJob()
-
-
Method Details
-
addLogListener
Description copied from interface:LogArchiverAdd a listener to the archiver which will receive all missed events. The idea of receiving only missed events is to minimise network traffic when used remotely.Event numbers begin at 0. To receive all events, last must be -1.
- Specified by:
addLogListenerin interfaceLogArchiver- Parameters:
l- The logListener which will receive the events.level- The level of events required.last- The last event number received. The LogArchive will not send messages from before this number.history- The maximum messages to send up to the most recent.
-
removeLogListener
Description copied from interface:LogArchiverRemove the LogListener.- Specified by:
removeLogListenerin interfaceLogArchiver- Parameters:
l- The LogListener.
-
addConsoleListener
Description copied from interface:ConsoleArchiverAdd a listener to the archiver which will receive all missed events. The idea of receiving only missed event is to minimise network traffic when used remotely.- Specified by:
addConsoleListenerin interfaceConsoleArchiver- Parameters:
l- The logListener which will receive the events.component- The component whose console to receive events for.last- The last event number received. The LogArchive will not send messages from before this number.max- The maximum messages to send up to the most recent.
-
removeConsoleListener
Description copied from interface:ConsoleArchiverRemove the LogListener.- Specified by:
removeConsoleListenerin interfaceConsoleArchiver- Parameters:
l- The LogListener.
-
consoleIdFor
Description copied from interface:ConsoleArchiverGet the console id for a given component.- Specified by:
consoleIdForin interfaceConsoleArchiver- Parameters:
component- The component.- Returns:
- The console id.
-
onInitialised
public void onInitialised()Description copied from class:BaseComponentSubclasses override this method to perform post creation initialisation.- Overrides:
onInitialisedin classBaseComponent
-
onStart
- Specified by:
onStartin classSimpleService- Throws:
RemoteException
-
onStop
protected void onStop()Description copied from class:SimpleServiceAllow sub classes to do something on stop.- Overrides:
onStopin classSimpleService
-
doStop
-
onStop
-
provideBeanDirectory
Description copied from interface:RemoteDirectoryOwnerProvide a remote directory.- Specified by:
provideBeanDirectoryin interfaceBeanDirectoryOwner- Specified by:
provideBeanDirectoryin interfaceRemoteDirectoryOwner- Returns:
- The
BeanDirectoryor null.
-
addStructuralListener
Description copied from interface:StructuralAdd a listener. The listener will immediately receive add notifications for all existing children.- Specified by:
addStructuralListenerin interfaceStructural- Parameters:
listener- The listener.
-
removeStructuralListener
Description copied from interface:StructuralRemove a listener.- Specified by:
removeStructuralListenerin interfaceStructural- Parameters:
listener- The listener.
-
getHeartbeat
public long getHeartbeat() -
setHeartbeat
public void setHeartbeat(long heartbeat) -
getHost
-
setHost
-
getPort
public int getPort() -
setPort
public void setPort(int port) -
getMaxConsoleLines
public int getMaxConsoleLines() -
setMaxConsoleLines
public void setMaxConsoleLines(int maxConsoleLines) -
getMaxLoggerLines
public int getMaxLoggerLines() -
setMaxLoggerLines
public void setMaxLoggerLines(int maxLoggerLines) -
getLogPollingInterval
public long getLogPollingInterval() -
setLogPollingInterval
public void setLogPollingInterval(long logPollingInterval) -
getHandlerFactories
-
setHandlerFactories
-