ReceiverInterface

Each receiver must implement this interface. It has the following methods:

Method

init

Method description

Initializes the receiver, based on the contents of the ReceiverConfig object

Syntax

public void init (Context context, ReceiverConfig config)
       throws BCGReceiverException

Parameters

context
Run-time context information for this receiver
config
Configuration details as specified in the Community Console

Method

refreshConfig

Method description

Called by the Receiver Framework if it detects changes in the configuration of this receiver

Note: The target of a receiver can be enabled or disabled from the Community Console. The target status can be read from the target configuration attribute BCGDocumentConstants.BCG_TARGET_STATUS. The value of this attribute returns 1 if the target is enabled.

Syntax

public void refreshConfig(ReceiverConfig config)
              throws BCGReceiverException

Parameters

config
An object that carries configuration details as specified in the Community Console

Method

startReceiving

Method description

Called by the Receiver Framework in its thread. After this method is called, the receiver can receive documents on its active targets. If the receiver is of the callback type, it processes callbacks in its own thread only after this point. The receiver receives documents in its own threads. This method returns quickly.

Note: The receiver is responsible for its own thread management.

Syntax

public void startReceiving()
             throws BCGReceiverException

Parameters

None

Method

processResponse

Method description

In the case of nonblocking synchronous requests, called by the Receiver Framework when the response document has returned from Document Manager. The call comes on a Receiver Framework (or internal class) thread. The receiver returns this call quickly.

Syntax

public void processResponse(ResponseCorrelation respCorr,
                       ReceiverDocumentInterface response)
             throws BCGReceiverException

Parameters

respCorr
An object that contains the information needed to synchronize the response document to the original request document
response
The response document

Method

stopReceiving

Method description

This method is called by the Receiver Framework in its thread. This method returns quickly. After this method is called, the receiver stops receiving the documents, and cleanup is performed. After this method is called, all references to the receiver are removed. This method is called when the Receiver Framework receivers a request to terminate.

Syntax

public void stopReceiving()
              throws BCGReceiverException

Parameters

None

Copyright IBM Corp. 2003, 2005