com.softwareag.xbd.extension
Class JCOServer

java.lang.Object
  extended bycom.sap.mw.jco.JCO.Connection
      extended bycom.sap.mw.jco.JCO.Server
          extended bycom.softwareag.xbd.extension.JCOServer
All Implemented Interfaces:
java.lang.Cloneable, com.sap.mw.jco.JCO.ServerErrorListener, com.sap.mw.jco.JCO.ServerExceptionListener, com.sap.mw.jco.JCO.ServerStateChangedListener, com.sap.mw.jco.JCO.TraceListener, java.lang.Runnable

public class JCOServer
extends com.sap.mw.jco.JCO.Server
implements com.sap.mw.jco.JCO.ServerExceptionListener, com.sap.mw.jco.JCO.ServerErrorListener, com.sap.mw.jco.JCO.ServerStateChangedListener, com.sap.mw.jco.JCO.TraceListener

Implements an R/3 server.

Version:
$Revision: 1.3 $

Field Summary
 
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, last_active_timestamp, pool, properties, rfc_handle, state, throughput
 
Constructor Summary
protected JCOServer(java.util.Properties properties, com.sap.mw.jco.IRepository repository, JCOStreamService service, ServerDispatcher dispatcher)
           
protected JCOServer(java.lang.String gwhost, java.lang.String gwserv, java.lang.String program_id, com.sap.mw.jco.IRepository repository, JCOStreamService service, ServerDispatcher dispatcher)
           
 
Method Summary
static java.lang.String getRevision()
          Returns CVS revision.
protected  void handleRequest(com.sap.mw.jco.JCO.Function function)
          Called upon an incoming requests
protected  boolean onCheckTID(java.lang.String tid)
          This function will be invoked when a transactional RFC is being called from a SAP R/3 system.
protected  void onCommit(java.lang.String tid)
          This function will be called after all RFC functions belonging to a certain transaction have been successfully completed.
protected  void onConfirmTID(java.lang.String tid)
          This function will be called after the local transaction has been completed.
protected  void onRollback(java.lang.String tid)
          This function will be called if an error in one of the RFC functions belonging to a certain transaction has occurred.
 void serverErrorOccurred(com.sap.mw.jco.JCO.Server srv, java.lang.Error err)
          Called if an error was thrown anywhere in our server
 void serverExceptionOccurred(com.sap.mw.jco.JCO.Server srv, java.lang.Exception ex)
          Called if an exception was thrown anywhere in our server
 void serverStateChangeOccurred(com.sap.mw.jco.JCO.Server server, int old_state, int new_state)
          Simply prints server state changes
 void start(int workers)
          Starts the dispatcher.
 void stop()
          Stops the dispatcher.
 void trace(int arg0, java.lang.String message)
           
 
Methods inherited from class com.sap.mw.jco.JCO.Server
abort, checkAuthorization, disconnect, dispatchRequest, getAttributes, getCallModel, getFunction, getGWHost, getGWServ, getMiddlewareImplementation, getProgID, getPropertyInfo, getRepository, getServerInterface, getState, getThread, getTrace, handleRequest, isAlive, listen, run, setCallModel, setProperty, setRepository, setState, setThread, setTrace, start, suspend
 
Methods inherited from class com.sap.mw.jco.JCO.Connection
clone, finalize, getConnectionHandle, getProperties, getProperty, getThroughput, isValid, setThroughput
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCOServer

protected JCOServer(java.lang.String gwhost,
                    java.lang.String gwserv,
                    java.lang.String program_id,
                    com.sap.mw.jco.IRepository repository,
                    JCOStreamService service,
                    ServerDispatcher dispatcher)

JCOServer

protected JCOServer(java.util.Properties properties,
                    com.sap.mw.jco.IRepository repository,
                    JCOStreamService service,
                    ServerDispatcher dispatcher)
Method Detail

getRevision

public static java.lang.String getRevision()
Returns CVS revision.

Returns:
CVS revision as string

onCheckTID

protected boolean onCheckTID(java.lang.String tid)
This function will be invoked when a transactional RFC is being called from a SAP R/3 system. The function has to store the TID in permanent storage and return true. The method has to return false if the a transaction with this ID has already been process. Throw an exception if anything goes wrong. The transaction processing will be aborted thereafter. Derived servers must override this method to actually implement the transaction ID management.

Parameters:
tid - the transaction ID
Returns:
true if the ID is valid and not in use otherwise, false otherwise

onConfirmTID

protected void onConfirmTID(java.lang.String tid)
This function will be called after the local transaction has been completed. All resources assiciated with this TID can be released. Derived servers must override this method to actually implement the transaction ID management.

Parameters:
tid - the transaction ID

onCommit

protected void onCommit(java.lang.String tid)
This function will be called after all RFC functions belonging to a certain transaction have been successfully completed. Derived servers can override this method to locally commit the transaction.

Parameters:
tid - the transaction ID

onRollback

protected void onRollback(java.lang.String tid)
This function will be called if an error in one of the RFC functions belonging to a certain transaction has occurred. Derived servers can override this method to locally rollback the transaction.

Parameters:
tid - the transaction ID

handleRequest

protected void handleRequest(com.sap.mw.jco.JCO.Function function)
Called upon an incoming requests


serverExceptionOccurred

public void serverExceptionOccurred(com.sap.mw.jco.JCO.Server srv,
                                    java.lang.Exception ex)
Called if an exception was thrown anywhere in our server

Specified by:
serverExceptionOccurred in interface com.sap.mw.jco.JCO.ServerExceptionListener

serverErrorOccurred

public void serverErrorOccurred(com.sap.mw.jco.JCO.Server srv,
                                java.lang.Error err)
Called if an error was thrown anywhere in our server

Specified by:
serverErrorOccurred in interface com.sap.mw.jco.JCO.ServerErrorListener

serverStateChangeOccurred

public void serverStateChangeOccurred(com.sap.mw.jco.JCO.Server server,
                                      int old_state,
                                      int new_state)
Simply prints server state changes

Specified by:
serverStateChangeOccurred in interface com.sap.mw.jco.JCO.ServerStateChangedListener

start

public void start(int workers)
Starts the dispatcher.

Parameters:
workers -

stop

public void stop()
Stops the dispatcher.


trace

public void trace(int arg0,
                  java.lang.String message)
Specified by:
trace in interface com.sap.mw.jco.JCO.TraceListener


Copyright © 2004-2007 Software AG. All Rights Reserved.