com.sap.conn.jco.server
Interface JCoServerUnitIDHandler


public interface JCoServerUnitIDHandler

This interface defines methods to handle a function unit received by a JCoServer. Applications providing support for transactional scenarios based on bgRFC communication have to provide a custom implementation for this interface. The instance implementing this interface has to be set on the server.

See Also:
JCoServer.setUnitIDHandler(JCoServerUnitIDHandler)

Method Summary
 boolean checkUnitID(JCoServerContext serverCtx, JCoUnitIdentifier unitIdentifier)
          This method will be invoked when a bgRFC unit is being sent from an SAP system.
 void commit(JCoServerContext serverCtx, JCoUnitIdentifier unitIdentifier)
          This method will be called after all RFC function modules belonging to the concerned unit have been successfully completed.
 void confirmUnitID(JCoServerContext serverCtx, JCoUnitIdentifier unitIdentifier)
          This method will be called after the local transaction has been completed.
 JCoFunctionUnitState getFunctionUnitState(JCoServerContext serverCtx, JCoUnitIdentifier unitIdentifier)
          The method will be invoked if the ABAP side resumes after a failure in bgRFC scheduler.
 void rollback(JCoServerContext serverCtx, JCoUnitIdentifier unitIdentifier)
          This method will be called if an error has occurred in one of the RFC function modules belonging to the concerned unit.
 

Method Detail

checkUnitID

boolean checkUnitID(JCoServerContext serverCtx,
                    JCoUnitIdentifier unitIdentifier)
This method will be invoked when a bgRFC unit is being sent from an SAP system. The method has to store the unit identifier in a permanent storage and return true. The method has to return false if a unit with this ID has already been processed. It should throw an exception if anything goes wrong. The unit processing will be aborted thereafter.

Parameters:
serverCtx - server context describes the server which gets the call
unitIdentifier - unit identifier
Returns:
true if the ID is valid and not in use, false otherwise

confirmUnitID

void confirmUnitID(JCoServerContext serverCtx,
                   JCoUnitIdentifier unitIdentifier)
This method will be called after the local transaction has been completed. All resources associated with this unit identifier can be released.

Parameters:
serverCtx - server context describes the server which gets the call
unitIdentifier - unit identifier

commit

void commit(JCoServerContext serverCtx,
            JCoUnitIdentifier unitIdentifier)
This method will be called after all RFC function modules belonging to the concerned unit have been successfully completed.

Parameters:
serverCtx - server context describes the server which gets the call
unitIdentifier - unit identifier

rollback

void rollback(JCoServerContext serverCtx,
              JCoUnitIdentifier unitIdentifier)
This method will be called if an error has occurred in one of the RFC function modules belonging to the concerned unit.

Parameters:
serverCtx - server context describes the server which gets the call
unitIdentifier - unit identifier

getFunctionUnitState

JCoFunctionUnitState getFunctionUnitState(JCoServerContext serverCtx,
                                          JCoUnitIdentifier unitIdentifier)
The method will be invoked if the ABAP side resumes after a failure in bgRFC scheduler. The implementation will return a unit state defined by JCoFunctionUnitState. The unit state NOT_FOUND means that the unit either did not reach the server or was removed after successful commitment and confirmation.
The unit state COMMITED means the unit was committed but not confirmed yet. The ABAP server will invoke confirmation for the unit ID
The unit state ROLLED_BACK means the processing of the unit failed. The ABAP server will potentially re-invoke the unit ID
The unit state IN_PROCESS means the unit is currently being processed by the application.
The unit state CONFIRMED means the unit has been confirmed and no actions are required.

Parameters:
serverCtx - server context describes the server which gets the call
unitIdentifier - unit identifier
Returns:
the current state of the concerned unit


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