Class AbstractSession<C extends AbstractBackendClient<C,S>, S>
java.lang.Object
ch.nolix.system.application.main.AbstractSession<C,S>
- Type Parameters:
C- is the type of theAbstractBackendClientof aAbstractSession.S- is the type of the application service of the parentApplicationof the parentAbstractBackendClientof aAbstractSession.
- All Implemented Interfaces:
IClientComponent<C>, IRefreshableSubscriber, Refreshable, AlivenessRequestable
- Direct Known Subclasses:
AbstractWebClientSession, TestSession
public abstract class AbstractSession<C extends AbstractBackendClient<C,S>, S>
extends Object
implements IClientComponent<C>, IRefreshableSubscriber
A
AbstractSession manages user run methods and user data methods.- Author:
- Silvan Wyss
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanfinal Stringfinal Sfinal Cfinal booleanfinal booleanisAlive()final voidpop()Pops the currentAbstractSessionfrom its parentAbstractClient.final voidPops the currentAbstractSessionfrom its parentAbstractClientwith the given result.final voidpush(AbstractSession<C, S> session) Pushes the given session to the parentAbstractClientof the currentAbstractSession.final <R> RpushAndGetResult(AbstractSession<C, S> session) Pushes the given session to the parentAbstractClientof the currentAbstractSession.final voidsetNext(AbstractSession<C, S> session) Sets the next session of the parentAbstractClientof the currentAbstractSession.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AlivenessRequestable
isOutdatedMethods inherited from interface Refreshable
refresh
-
Constructor Details
-
AbstractSession
public AbstractSession()
-
-
Method Details
-
belongsToClient
public final boolean belongsToClient()- Specified by:
belongsToClientin interfaceIClientComponent<C extends AbstractBackendClient<C,S>> - Returns:
- true if the current
AbstractSessionbelongs to aAbstractClient, false otherwise.
-
getApplicationName
- Returns:
- the name of the parent
Applicationof the parentAbstractClientof the currentAbstractSession.
-
getStoredApplicationService
- Returns:
- the context of the parent
Applicationof the parentAbstractClientof the currentAbstractSession.
-
getStoredParentClient
- Specified by:
getStoredParentClientin interfaceIClientComponent<C extends AbstractBackendClient<C,S>> - Returns:
- the parent client of the current
AbstractSession. - Throws:
RuntimeException- if the currentAbstractSessiondoes not belong to a client.
-
hasParentSession
public final boolean hasParentSession() -
isAlive
public final boolean isAlive()- Specified by:
isAlivein interfaceAlivenessRequestable- Returns:
- true if the current
AlivenessRequestableis alive, false otherwise.
-
pop
public final void pop()Pops the currentAbstractSessionfrom its parentAbstractClient. -
pop
Pops the currentAbstractSessionfrom its parentAbstractClientwith the given result.- Parameters:
result-- Throws:
RuntimeException- if the given result is null.
-
push
Pushes the given session to the parentAbstractClientof the currentAbstractSession.- Parameters:
session-- Throws:
RuntimeException- if the given session is null.
-
pushAndGetResult
Pushes the given session to the parentAbstractClientof the currentAbstractSession.- Type Parameters:
R- is the type of the returned result.- Parameters:
session-- Returns:
- the result from the given session.
- Throws:
RuntimeException- if the given session is null.
-
setNext
Sets the next session of the parentAbstractClientof the currentAbstractSession. That means the currentAbstractSessionwill be popped from its parentAbstractClientand the given session is pushed to the parentAbstractClientof the currentAbstractSession.- Parameters:
session-- Throws:
RuntimeException- if the given session is null.
-