Class AbstractSession<C extends AbstractBackendClient<C,S>, S>
java.lang.Object
ch.nolix.base.net.clientserver.AbstractSession<C,S>
- Type Parameters:
C- the type of theAbstractBackendClientof aAbstractSessionS- the type of the application service of the parentAbstractApplicationof the parentAbstractBackendClientof aAbstractSession
- All Implemented Interfaces:
AlivenessRequestable, Session<C,S>, ClientComponent<C>, Refreshable
- Direct Known Subclasses:
AbstractWebClientSession, TestSession
public abstract class AbstractSession<C extends AbstractBackendClient<C,S>, S>
extends Object
implements Session<C,S>
- Author:
- Silvan Wyss
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanfinal Stringfinal Sfinal Cfinal booleanfinal Objectfinal voidfinal voidinternalSetParentClient(C parentClient) Sets the parentBackendClientof the currentSession.final voidinternalSetResult(Object result) Sets the result of the currentSession.final booleanisAlive()final voidpop()Pops the currentSessionfrom its parentBackendClient.final voidpopWithResult(Object result) Pops the currentSessionfrom its parentBackendClientwith the given result.final voidpush(AbstractSession<C, S> session) Pushes the given session to the parentAbstractClientof the currentAbstractSession.final ObjectpushAndGetResult(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
refreshMethods inherited from interface Session
getClientClass, internalFullInitialize
-
Constructor Details
-
AbstractSession
public AbstractSession()
-
-
Method Details
-
belongsToClient
public final boolean belongsToClient()- Specified by:
belongsToClientin interfaceClientComponent<C extends AbstractBackendClient<C,S>> - Returns:
- true if the current
ClientComponentbelongs to a client, false otherwise
-
getApplicationName
- Specified by:
getApplicationNamein interfaceSession<C extends AbstractBackendClient<C,S>, S> - Returns:
- the name of the parent
Applicationof the parentBackendClientof the currentSession
-
getStoredApplicationService
- Specified by:
getStoredApplicationServicein interfaceSession<C extends AbstractBackendClient<C,S>, S> - Returns:
- the application service of the parent
Applicationof the parentBackendClientof the currentSession
-
getStoredParentClient
- Specified by:
getStoredParentClientin interfaceClientComponent<C extends AbstractBackendClient<C,S>> - Returns:
- the client of the current
ClientComponent
-
hasFrameSession
public final boolean hasFrameSession()- Specified by:
hasFrameSessionin interfaceSession<C extends AbstractBackendClient<C,S>, S> - Returns:
- true if the current
Sessionhas a frameSession, false otherwise
-
internalGetStoredResult
- Specified by:
internalGetStoredResultin interfaceSession<C extends AbstractBackendClient<C,S>, S> - Returns:
- the result of the current
Session
-
internalRemoveParentClient
public final void internalRemoveParentClient()- Specified by:
internalRemoveParentClientin interfaceSession<C extends AbstractBackendClient<C,S>, S>
-
internalSetParentClient
Sets the parentBackendClientof the currentSession.- Specified by:
internalSetParentClientin interfaceSession<C extends AbstractBackendClient<C,S>, S> - Parameters:
parentClient-
-
internalSetResult
Sets the result of the currentSession.- Specified by:
internalSetResultin interfaceSession<C extends AbstractBackendClient<C,S>, S> - Parameters:
result-
-
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 currentSessionfrom its parentBackendClient. -
popWithResult
Pops the currentSessionfrom its parentBackendClientwith the given result.- Specified by:
popWithResultin interfaceSession<C extends AbstractBackendClient<C,S>, S> - Parameters:
result-
-
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.- 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
-