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 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 <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 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
-
hasUnderlyingSession
public final boolean hasUnderlyingSession()- Specified by:
hasUnderlyingSessionin interfaceSession<C extends AbstractBackendClient<C,S>, S> - Returns:
- true if the current
Sessionhas a underlyingSession, false otherwise
-
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.- Type Parameters:
R- 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
-