com.sap.conn.jco.ext
Interface SessionReferenceProvider

All Known Implementing Classes:
DefaultSessionReferenceProvider

public interface SessionReferenceProvider

The session reference provider can be implemented by a runtime environment that has a session concept in order to provide JCo a simple reference to a session. JCo is using the ID associated with a JCoSessionReference internally for stateful function module invocations, i.e. the same physical connection is used for a sequence of function modules. In a generally stateless environment, e.g. JCo standalone, JCoContext.begin(JCoDestination destination) starts such a sequence for a destination.

See Also:
JCoContext

Method Summary
 JCoSessionReference getCurrentSessionReference(java.lang.String scopeType)
          This method is invoked by JCo in order to find out, in which session it is running.
 boolean isSessionAlive(java.lang.String sessionId)
          JCo will invoke this method in order to check whether a session is still alive.
 void jcoServerSessionContinued(java.lang.String sessionID)
          This method will be invoked before a subsequent RFC call for a JCoServer session is passed to the JCoHandlerFactory.
 void jcoServerSessionFinished(java.lang.String sessionID)
          This method will be invoked when a JCoServer session has finished, i.e.
 void jcoServerSessionPassivated(java.lang.String sessionID)
          This method will be invoked after the processing of an RFC call in a JCoServer session has finished .
 JCoSessionReference jcoServerSessionStarted()
          The following four methods will be invoked by the JCo runtime to notify the implementation of the SessionReferenceProvider (Session Management) about the sessions initiated by an ABAP Application Server.
 

Method Detail

getCurrentSessionReference

JCoSessionReference getCurrentSessionReference(java.lang.String scopeType)
This method is invoked by JCo in order to find out, in which session it is running. This is necessary in case of a JCoContext has been started, so that from now on the same physical connection should be used for keeping alive the user context in the application server ABAP. If the scope type is null or the empty String, the default scope should be used, according to the definition of the runtime environment. Runtime environments that do not provide a scope management within sessions, can simply ignore the scope type parameter in their implementation of a SessionReferenceProvider.

Parameters:
scopeType - defines the scope, for which the session reference is needed
Returns:
a JCoSessionReference that identifies the current session, in which the method is invoked

isSessionAlive

boolean isSessionAlive(java.lang.String sessionId)
JCo will invoke this method in order to check whether a session is still alive. If the session has been ended, JCo can release the connections associated with this session, and thus resources. In a standalone environment, this happens for example in a special timeout checker thread.

Parameters:
sessionId - The session ID, for which it should be checked whether the session is alive.
Returns:
true if the session is alive false otherwise

jcoServerSessionStarted

JCoSessionReference jcoServerSessionStarted()
                                            throws SessionException
The following four methods will be invoked by the JCo runtime to notify the implementation of the SessionReferenceProvider (Session Management) about the sessions initiated by an ABAP Application Server. This method will be invoked before the first RFC call from an ABAP Application Server is passed to the JCoHandlerFactory and as a consequence a session has been started.

Returns:
the session reference for the new JCoServer session
Throws:
SessionException - if the session reference provider runs into errors

jcoServerSessionContinued

void jcoServerSessionContinued(java.lang.String sessionID)
                               throws SessionException
This method will be invoked before a subsequent RFC call for a JCoServer session is passed to the JCoHandlerFactory. This will only occur, if the server connection was turned to stateful by the server or the client application.

Parameters:
sessionID - sessionID of the continued JCoServer session
Throws:
SessionException - if the session reference provider runs into errors
See Also:
JCoServerContext.setStateful(boolean)

jcoServerSessionPassivated

void jcoServerSessionPassivated(java.lang.String sessionID)
                                throws SessionException
This method will be invoked after the processing of an RFC call in a JCoServer session has finished .

Parameters:
sessionID - sessionID of the passivated JCoServer session
Throws:
SessionException - if the session reference provider runs into errors

jcoServerSessionFinished

void jcoServerSessionFinished(java.lang.String sessionID)
                              throws SessionException
This method will be invoked when a JCoServer session has finished, i.e. the connection has been or will be closed.

Parameters:
sessionID - sessionID of the finished JCoServer session
Throws:
SessionException - if the session reference provider runs into errors


Copyright © 2008-2014 SAP AG. All Rights Reserved.