Class PVPUpdateManager
- java.lang.Object
-
- de.aristaflow.adept2.base.service.AbstractADEPT2Service
-
- de.aristaflow.adept2.ui.updatemanager.PVPUpdateManager
-
- All Implemented Interfaces:
ADEPT2Service
,LogService
,ServiceThreadHandling
,UpdateManager
public class PVPUpdateManager extends AbstractADEPT2Service implements UpdateManager
This class manages a set ofChangeListener
s for an object which are notified when properties of that object change.
The purpose of this is to remove the burden of change-notification from the process model (i.e. Node, Edge, Process, ...)
Instead ChangeOperations, which alter a Process, should notify the UpdateManager of all the objects that have been affected by the change. The UpdateManager will then take care to notify all graphical representations of these elements.
Preferably ChangeOperations will give detailed feedback as to which properties have actually been changed, so that updating the visual model can be done with minimal effort.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
PVPUpdateManager.UpdateRequest
The UpdateRequest is attached to the SWT Default thread responsible for UI updates.-
Nested classes/interfaces inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
AbstractADEPT2Service.ActiveSessions
-
Nested classes/interfaces inherited from interface de.aristaflow.adept2.core.updatemanager.UpdateManager
UpdateManager.ActivityProperties, UpdateManager.DataEdgeProperties, UpdateManager.DataElementProperties, UpdateManager.EdgeProperties, UpdateManager.InstanceProperties, UpdateManager.NodeProperties, UpdateManager.ProcessProperties, UpdateManager.TransactionProperties
-
-
Field Summary
-
Fields inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
CONF_CSV_LOGGING, configuration, logger, registry, runtimeRequiredServices, startupRequiredServices
-
Fields inherited from interface de.aristaflow.adept2.core.updatemanager.UpdateManager
ACTIVITY_STATE, DEFAULT_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description PVPUpdateManager(org.apache.commons.configuration2.Configuration configuration, Registry registry)
The update manager could be called as an ADEPT2Service
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(Object what, ChangeListener callback)
Add callback as a new listener for what, using the default priority.void
addListener(Object what, ChangeListener callback, int priority)
Add callback as a new listener for whatprotected void
asyncSendPropertyChanges()
Property change events are published asynchronous.void
firePropertyChange(Object procElement, Object prop)
Notify all interested parties of changes to a Process elementvoid
firePropertyChange(Object procElement, Object prop, Object newValue)
Notify all interested parties of changes to a Process elementvoid
firePropertyChange(Object procElement, Object prop, Object oldValue, Object newValue)
Notify all interested parties of changes to a Process elementprotected void
queuePropertyChanges(Object procElement, PropertyChangeEvent pce)
Send PropertyChangeEvent pce to all listeners for object procElementvoid
removeListener(Object what, ChangeListener callback)
Remove a callback from the listener list for object whatvoid
sendPropertyChanges()
Send all queued events and flush the queue.-
Methods inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
_sessionActive, _sessionFinished, activeOrInvalidServiceStateException, changeLogContext, changeLogContext, changeLogContext, consoleLog, csvLoggingEnabled, getClassSpecificJulLogger, getDependencyRegistry, getLocalUris, getLogger, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, getUserCredentials, init, isActive, isSessionActive, isShutdown, logMethodEntry, logMethodEntry, logMethodEntry, logMethodExit, logMethodExit, ping, preShutdown, privilegeSession, privilegeThread, revertLogContextChanges, sessionActive, sessionActive, sessionActive, sessionActive, sessionFinished, sessionFinished, shutdown, signalShutdown, signalStart, start, unprivilegeThread
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.aristaflow.adept2.base.service.ADEPT2Service
getLocalUris, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, init, ping, preShutdown, shutdown, start
-
-
-
-
Constructor Detail
-
PVPUpdateManager
public PVPUpdateManager(org.apache.commons.configuration2.Configuration configuration, Registry registry)
The update manager could be called as an ADEPT2Service- Parameters:
configuration
- the configuration of the update managerregistry
- the registry of the update manager
-
-
Method Detail
-
addListener
public void addListener(Object what, ChangeListener callback)
Description copied from interface:UpdateManager
Add callback as a new listener for what, using the default priority.- Specified by:
addListener
in interfaceUpdateManager
- Parameters:
what
- The object that is to be monitoredcallback
- The object receiving notification
-
addListener
public void addListener(Object what, ChangeListener callback, int priority)
Description copied from interface:UpdateManager
Add callback as a new listener for what- Specified by:
addListener
in interfaceUpdateManager
- Parameters:
what
- The object that is to be monitoredcallback
- The object receiving notificationpriority
- The priority - smaller numbers lead to earlier calls.
-
removeListener
public void removeListener(Object what, ChangeListener callback)
Description copied from interface:UpdateManager
Remove a callback from the listener list for object what- Specified by:
removeListener
in interfaceUpdateManager
- Parameters:
what
- The monitored objectcallback
- The PropertyChangeListener to be removed
-
firePropertyChange
public void firePropertyChange(Object procElement, Object prop)
Notify all interested parties of changes to a Process element- Specified by:
firePropertyChange
in interfaceUpdateManager
- Parameters:
procElement
- The altered Process elementprop
- The altered property
-
firePropertyChange
public void firePropertyChange(Object procElement, Object prop, Object newValue)
Notify all interested parties of changes to a Process element- Specified by:
firePropertyChange
in interfaceUpdateManager
- Parameters:
procElement
- The altered Process elementprop
- The altered propertynewValue
- The new value of the property
-
firePropertyChange
public void firePropertyChange(Object procElement, Object prop, Object oldValue, Object newValue)
Notify all interested parties of changes to a Process element- Specified by:
firePropertyChange
in interfaceUpdateManager
- Parameters:
procElement
- The altered Process elementprop
- The altered propertyoldValue
- the old value of the propertynewValue
- The new value of the property
-
queuePropertyChanges
protected void queuePropertyChanges(Object procElement, PropertyChangeEvent pce)
Send PropertyChangeEvent pce to all listeners for object procElement- Parameters:
procElement
- the keypce
- the event
-
sendPropertyChanges
public void sendPropertyChanges()
Description copied from interface:UpdateManager
Send all queued events and flush the queue.- Specified by:
sendPropertyChanges
in interfaceUpdateManager
-
asyncSendPropertyChanges
protected void asyncSendPropertyChanges()
Property change events are published asynchronous. The request to execute this method is sent to the default display, rather than the current display of the thread calling sendPropertyChanges() (which would be wrong.)
-
-