Class AbstractPushController
- java.lang.Object
-
- java.lang.Thread
-
- de.hybris.platform.core.threadregistry.RegistrableThread
-
- de.hybris.platform.cockpit.session.impl.AbstractPushController
-
- All Implemented Interfaces:
PushController,java.lang.Runnable
- Direct Known Subclasses:
CommentPushController,WorkflowPushController
public abstract class AbstractPushController extends RegistrableThread implements PushController
Class to be used as super class when implementing a standard CockpitPushController.- See Also:
PushController
-
-
Field Summary
Fields Modifier and Type Field Description protected static intDEFAULT_DELAYstatic java.lang.StringPARAM_UPDATE_INTERVALprotected java.util.Map<java.lang.String,java.lang.Object>params
-
Constructor Summary
Constructors Constructor Description AbstractPushController()AbstractPushController(PushComponent pushComp)AbstractPushController(PushComponent pushComp, int updateInterval)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddEvent(CockpitEvent cockpitEvent)protected abstract voidafter()protected abstract voidbefore()PushComponentgetComponent()Returns this push controller'sPushComponent.protected org.zkoss.zk.ui.DesktopgetDesktop()java.util.Map<java.lang.String,java.lang.Object>getParameters()protected UISessiongetSession()intgetUpdateInterval()Returns the update interval in milliseconds for this push controller.protected org.springframework.web.context.WebApplicationContextgetWebApplicationContext()protected voidinternalRun()protected booleanisDone()protected voidloadParameters()voidsetComponent(PushComponent component)Sets thePushComponentto be used by this push controller tocomponent.voidsetDone()Tells this push controller to stop processing server push events.voidsetParameters(java.util.Map<java.lang.String,java.lang.Object> params)voidsetUpdateInterval(int milliseconds)Sets the update interval in milliseconds for this push controller.voidstartController()Starts this push controller.java.lang.StringtoString()-
Methods inherited from class de.hybris.platform.core.threadregistry.RegistrableThread
registerThread, run, unregisterThread, withInitialInfo
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, yield
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.cockpit.session.PushController
isUpdateNeeded, update
-
-
-
-
Field Detail
-
DEFAULT_DELAY
protected static final int DEFAULT_DELAY
- See Also:
- Constant Field Values
-
PARAM_UPDATE_INTERVAL
public static final java.lang.String PARAM_UPDATE_INTERVAL
- See Also:
- Constant Field Values
-
params
protected final java.util.Map<java.lang.String,java.lang.Object> params
-
-
Constructor Detail
-
AbstractPushController
public AbstractPushController()
-
AbstractPushController
public AbstractPushController(PushComponent pushComp)
-
AbstractPushController
public AbstractPushController(PushComponent pushComp, int updateInterval)
-
-
Method Detail
-
setUpdateInterval
public void setUpdateInterval(int milliseconds)
Description copied from interface:PushControllerSets the update interval in milliseconds for this push controller.- Specified by:
setUpdateIntervalin interfacePushController- Parameters:
milliseconds- the delay between updates (or update requests) in milliseconds
-
getUpdateInterval
public int getUpdateInterval()
Description copied from interface:PushControllerReturns the update interval in milliseconds for this push controller.- Specified by:
getUpdateIntervalin interfacePushController- Returns:
- the delay between updates (or update requests) in milliseconds
-
setComponent
public void setComponent(PushComponent component)
Description copied from interface:PushControllerSets thePushComponentto be used by this push controller tocomponent.- Specified by:
setComponentin interfacePushController- Parameters:
component- the push component used by this push controller- See Also:
PushComponent
-
getComponent
public PushComponent getComponent()
Description copied from interface:PushControllerReturns this push controller'sPushComponent.- Specified by:
getComponentin interfacePushController- Returns:
- the push component used by this push controller
-
getDesktop
protected org.zkoss.zk.ui.Desktop getDesktop()
-
setDone
public void setDone()
Description copied from interface:PushControllerTells this push controller to stop processing server push events. Typically stops the thread gently within one polling cycle (seePushController.getUpdateInterval()).- Specified by:
setDonein interfacePushController- See Also:
PushController.startController()
-
isDone
protected boolean isDone()
-
internalRun
protected void internalRun()
- Overrides:
internalRunin classRegistrableThread
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Thread
-
addEvent
protected void addEvent(CockpitEvent cockpitEvent)
-
startController
public void startController()
Description copied from interface:PushControllerStarts this push controller. Typically starts the push controller thread.- Specified by:
startControllerin interfacePushController- See Also:
PushController.setDone()
-
getSession
protected UISession getSession()
-
getWebApplicationContext
protected org.springframework.web.context.WebApplicationContext getWebApplicationContext() throws java.lang.IllegalStateException- Throws:
java.lang.IllegalStateException
-
before
protected abstract void before()
-
after
protected abstract void after()
-
setParameters
public void setParameters(java.util.Map<java.lang.String,java.lang.Object> params)
- Specified by:
setParametersin interfacePushController
-
getParameters
public java.util.Map<java.lang.String,java.lang.Object> getParameters()
- Specified by:
getParametersin interfacePushController
-
loadParameters
protected void loadParameters()
-
-