Class NullGUIManager
- java.lang.Object
-
- de.aristaflow.adept2.base.service.AbstractADEPT2Service
-
- de.aristaflow.adept2.core.runtimemanager.gui.AbstractGUIManager
-
- de.aristaflow.adept2.ui.guimanager.NullGUIManager
-
- All Implemented Interfaces:
ADEPT2Service
,LogService
,ServiceThreadHandling
,ActivityStateNotification
,GUIManager
,RemoteGUIManager
public class NullGUIManager extends AbstractGUIManager
The null GUI manager returns theNullGUIContext
as the GUIContext and may be used for GUI-less clients.- Author:
- Kevin Goeser, Markus Lauer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
AbstractADEPT2Service.ActiveSessions
-
-
Field Summary
-
Fields inherited from class de.aristaflow.adept2.core.runtimemanager.gui.AbstractGUIManager
CONF_TERMINATION_TIMEOUT, earlyTerminates, guiContexts, listeners, localGuiContexts, TERMINATION_TIMEOUT
-
Fields inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
CONF_CSV_LOGGING, configuration, logger, registry, runtimeRequiredServices, startupRequiredServices
-
-
Constructor Summary
Constructors Constructor Description NullGUIManager(org.apache.commons.configuration2.Configuration configuration, Registry registry)
Instantiate the manager that returns only NullGUIContexts on client requests.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GUIContext
createGUIContext(SessionToken session, de.aristaflow.adept2.model.runtimeenvironment.guicontext.TransferableGUIContext trCtxt, ExecutionControlManager ecm)
Creates a GUI context for the designatedTransferrableGUIContext
and the designatedExecutionControlManager
.GUIContext
getGUIContext(SessionToken session, ActivityInstance activityInstance, EBPInstanceReference ebpInstanceReference, String sessionID, ExecutionContext executionContext, ExecutionControlManager ecm, Thread thread)
Gets an appropriate GUI context for the designated activity as configured locally for the corresponding client.-
Methods inherited from class de.aristaflow.adept2.core.runtimemanager.gui.AbstractGUIManager
activityClosed, activityFailed, activityReset, activityResumed, activitySignalled, activitySuspended, activitySuspended, closeGUIContext, getActivityStateListenerURIs, getExecutionControlManager, getLocalForRemoteGuiContext, shutdown, terminateRemoteExecution
-
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, 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, start
-
-
-
-
Constructor Detail
-
NullGUIManager
public NullGUIManager(org.apache.commons.configuration2.Configuration configuration, Registry registry)
Instantiate the manager that returns only NullGUIContexts on client requests.- Parameters:
registry
- The assigned registry of this GUIManager instance.configuration
- The configuration assigned to this GUIManager instance.
-
-
Method Detail
-
getGUIContext
public GUIContext getGUIContext(SessionToken session, ActivityInstance activityInstance, EBPInstanceReference ebpInstanceReference, String sessionID, ExecutionContext executionContext, ExecutionControlManager ecm, Thread thread) throws GUIContextUnavailableException
Description copied from interface:GUIManager
Gets an appropriate GUI context for the designated activity as configured locally for the corresponding client. This method looks for a specific context for the execution environment of the activity. If none is defined, the context for the type of the activity (for instance, a standard GUI for all web services) will be returned. If there is also no definition, a standard GUI context will be returned.
Applications using the GUI context should cast the returned instance to the appropriate implementation.- Parameters:
session
- The session which is used to check for access rights on this method.activityInstance
- The activity instance for which a GUI context is to be retrieved. If a localisation is available, it will already be applied.ebpInstanceReference
- The EBP-instance reference (identifies the corresponding instance node) for which a GUI context is to be retrieved.sessionID
- The ID of the session in which the GUI context is needed.executionContext
- The context in which the component the GUI context is retrieved for is executed.ecm
- A reference to control the execution, for instance, to close the application when the user closes the GUI window of the returned GUI context.thread
- The thread, the component runs inside. The GUI context must check calls to it against this thread, to ensure thread safety.
Do not keep a strong reference within theGUIContext
to this thread! Otherwise memory leaks may occur.- Returns:
- The context containing the appropriate GUI for displaying the user interface of an application. The caller should close, but implementations should ensure closing of all created GUI contexts when shutting down.
- Throws:
GUIContextUnavailableException
- If the requested GUI context can not be created, aGUIContextUnavailableException
will be thrown.
-
createGUIContext
public GUIContext createGUIContext(SessionToken session, de.aristaflow.adept2.model.runtimeenvironment.guicontext.TransferableGUIContext trCtxt, ExecutionControlManager ecm) throws GUIContextUnavailableException
Description copied from class:AbstractGUIManager
Creates a GUI context for the designatedTransferrableGUIContext
and the designatedExecutionControlManager
. This is similar toAbstractGUIManager.getLocalForRemoteGuiContext(SessionToken, TransferableGUIContext)
but provides the corresponding execution control manager and may be overridden in subclasses.AbstractGUIManager.getLocalForRemoteGuiContext(SessionToken, TransferableGUIContext)
may not be overridden since it provides the means for theActivityStateNotification
.- Overrides:
createGUIContext
in classAbstractGUIManager
- Parameters:
session
- The session which is used to check for access rights on this method.trCtxt
- The GUI context retrieved from the component that is executed remotely. A local GUI context for this has to be created.- Returns:
- The context containing the appropriate GUI for remotely execution
of the component of the designated
RemoteGUIContext
. This can usually be ignored since thisRemoteGUIManager
already handles closing and displaying of the created localGUIContext
. - Throws:
GUIContextUnavailableException
- If no GUI context can be created for the designatedTransferableGUIContext
, aGUIContextUnavailableException
will be thrown.
-
-