Sun Adapter for SAP BAPI API

com.stc.connector.sapbapiadapter.sapbapi
Class SAPServer

java.lang.Object
  extended by com.sap.mw.jco.JCO.Connection
      extended by com.sap.mw.jco.JCO.Server
          extended by com.stc.connector.sapbapiadapter.sapbapi.SAPServer
All Implemented Interfaces:
com.sap.mw.jco.JCO.ServerErrorListener, com.sap.mw.jco.JCO.ServerExceptionListener, com.sap.mw.jco.JCO.ServerStateChangedListener, java.lang.Cloneable, java.lang.Runnable
Direct Known Subclasses:
BapiServer.SbynServer

public abstract class SAPServer
extends com.sap.mw.jco.JCO.Server
implements com.sap.mw.jco.JCO.ServerErrorListener, com.sap.mw.jco.JCO.ServerExceptionListener, com.sap.mw.jco.JCO.ServerStateChangedListener

An abstract class to define the common methods required by a SAP BAPI and IDOC servers for inbound transactions from SAP

Version:
$Revision: 1.13 $
Author:
Julie Knight

Field Summary
protected  ConnectorServer cs
          ConnectorServer from extended classes.
protected  TIDManager tidManager
           
protected  boolean tRFCCallInProgress
          Flag to indicate a tRFC call is in-progress.
 
Fields inherited from class com.sap.mw.jco.JCO.Server
AUTHORIZATION_MODE_BASIC, AUTHORIZATION_MODE_SNC, FUNCTION_MODEL, m_middleware, REQUEST_RESPONSE_MODEL
 
Fields inherited from class com.sap.mw.jco.JCO.Connection
attributes, codepage_converter, conn_object, conn_params, connection_cpc_mode, dsr_monitor, jarm_monitor, last_active_timestamp, num_received_bytes, num_sent_bytes, passport_bytes, pool, properties, rfc_handle, rfm_name, start_time, state, throughput, time_handle_request, time_middleware, time_total
 
Constructor Summary
SAPServer(java.util.Properties properties, com.sap.mw.jco.IRepository repository, com.stc.connector.management.util.ObjectReference mMonitor)
           
 
Method Summary
protected  void checkInTrfcMode()
          Ensures the server is in tRFC mode.
protected  void finalize()
          DOCUMENT ME!
 java.lang.String getID()
          Retrieves the RFC Server identification string.
 java.lang.String getStateString(int state)
          Describes the RFC Server state.
 java.lang.String getTID()
          Retrieves the current transaction ID if in transaction mode.
 boolean isTRFCCallInProgress()
          Tests whether a Transactional RFC (tRFC) call is in progress.
protected  boolean onCheckTID(java.lang.String tid)
          Override the standard onCheckTID method in the JCO.Server class.
protected  void onCommit(java.lang.String tid)
          Override the standard onCommit method in the JCO.Server class.
protected  void onConfirmTID(java.lang.String tid)
          Override the standard onConfirmTID method in the JCO.Server class.
protected  void onRollback(java.lang.String tid)
          Override the standard onRollback method in the JCO.Server class.
 void serverErrorOccurred(com.sap.mw.jco.JCO.Server server, java.lang.Error error)
          Called when a RFC Server Exception has occurred.
 void serverExceptionOccurred(com.sap.mw.jco.JCO.Server server, java.lang.Exception exception)
          Called when a RFC Server Exception has occurred.
 void serverStateChangeOccurred(com.sap.mw.jco.JCO.Server server, int oldState, int newState)
          Called when the RFC Server internal state changes.
protected  void setConnServer(ConnectorServer connServer)
          DOCUMENT ME!
 void setTID(java.lang.String tid)
          Sets the current transaction ID.
 void setTIDManager(TIDManager tidMgr)
          Sets the Transactional ID Manager for this server.
 
Methods inherited from class com.sap.mw.jco.JCO.Server
abort, beginCall, checkAuthorization, disconnect, dispatchRequest, endCall, getAttributes, getCallModel, getDsrPassport, getFunction, getGWHost, getGWServ, getMiddlewareImplementation, getProgID, getPropertyInfo, getRepository, getServerInterface, getState, getThread, getTrace, handleRequest, handleRequest, isAlive, listen, run, setCallModel, setProperty, setRepository, setState, setThread, setTrace, start, stop, suspend
 
Methods inherited from class com.sap.mw.jco.JCO.Connection
checkProperties, clone, getConnectionHandle, getProperties, getProperty, getThroughput, hideConnection, isValid, setThroughput
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cs

protected ConnectorServer cs
ConnectorServer from extended classes.


tRFCCallInProgress

protected boolean tRFCCallInProgress
Flag to indicate a tRFC call is in-progress.


tidManager

protected TIDManager tidManager
Constructor Detail

SAPServer

public SAPServer(java.util.Properties properties,
                 com.sap.mw.jco.IRepository repository,
                 com.stc.connector.management.util.ObjectReference mMonitor)
Method Detail

setConnServer

protected void setConnServer(ConnectorServer connServer)
DOCUMENT ME!


finalize

protected void finalize()
DOCUMENT ME!

Overrides:
finalize in class com.sap.mw.jco.JCO.Connection

isTRFCCallInProgress

public boolean isTRFCCallInProgress()
Tests whether a Transactional RFC (tRFC) call is in progress.

Returns:
true if tRFC is in progress.

onCheckTID

protected boolean onCheckTID(java.lang.String tid)
                      throws com.sap.mw.jco.JCO.Exception
Override the standard onCheckTID method in the JCO.Server class.

Overrides:
onCheckTID in class com.sap.mw.jco.JCO.Server
Parameters:
tid - Transaction ID to check.
Returns:
true if the TID has not yet been processed.
Throws:
com.sap.mw.jco.JCO.Exception

onCommit

protected void onCommit(java.lang.String tid)
Override the standard onCommit method in the JCO.Server class.

Overrides:
onCommit in class com.sap.mw.jco.JCO.Server
Parameters:
tid - Transaction ID to commit.

onConfirmTID

protected void onConfirmTID(java.lang.String tid)
Override the standard onConfirmTID method in the JCO.Server class.

Overrides:
onConfirmTID in class com.sap.mw.jco.JCO.Server
Parameters:
tid - Transaction ID to confirm.

onRollback

protected void onRollback(java.lang.String tid)
Override the standard onRollback method in the JCO.Server class.

Overrides:
onRollback in class com.sap.mw.jco.JCO.Server
Parameters:
tid - Transaction ID to rollback.

checkInTrfcMode

protected void checkInTrfcMode()
Ensures the server is in tRFC mode.

Throws:
com.sap.mw.jco.JCO.AbapException - When not in tRFC Server mode.

setTIDManager

public void setTIDManager(TIDManager tidMgr)
Sets the Transactional ID Manager for this server.

Parameters:
tidMgr - the Transactional ID Manager.

serverErrorOccurred

public void serverErrorOccurred(com.sap.mw.jco.JCO.Server server,
                                java.lang.Error error)
Called when a RFC Server Exception has occurred.

Specified by:
serverErrorOccurred in interface com.sap.mw.jco.JCO.ServerErrorListener
Parameters:
server - The failing RFC Server.
error - The Error that has occurred.

serverExceptionOccurred

public void serverExceptionOccurred(com.sap.mw.jco.JCO.Server server,
                                    java.lang.Exception exception)
Called when a RFC Server Exception has occurred.

Specified by:
serverExceptionOccurred in interface com.sap.mw.jco.JCO.ServerExceptionListener
Parameters:
server - The failing RFC Server
exception - The Exception that has occurred.

serverStateChangeOccurred

public void serverStateChangeOccurred(com.sap.mw.jco.JCO.Server server,
                                      int oldState,
                                      int newState)
Called when the RFC Server internal state changes.

Specified by:
serverStateChangeOccurred in interface com.sap.mw.jco.JCO.ServerStateChangedListener
Parameters:
server - The RFC Server.
oldState - The old state.
newState - The new state.

getStateString

public java.lang.String getStateString(int state)
Describes the RFC Server state.

Parameters:
state - State of the RFC Server.
Returns:
String describing the state.

getID

public java.lang.String getID()
Retrieves the RFC Server identification string.

Returns:
RFC Server ID string.

setTID

public void setTID(java.lang.String tid)
Sets the current transaction ID.

Parameters:
tid - TID string.

getTID

public java.lang.String getTID()
Retrieves the current transaction ID if in transaction mode.

Returns:
TID string if in transaction mode; null if not.

Sun Adapter for SAP BAPI API