All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.commerce.ActiveDeal

java.lang.Object
   |
   +----semper.commerce.Deal
           |
           +----semper.commerce.ActiveDeal

public class ActiveDeal
extends Deal
This class encapsulates an active commerce deal for ether the initiator or the respondent in a session. An active deal is always associated with a peer instance of ActiveDeal representing the peer's view of the same commerce deal. Active deals are used for adding new commerce transactions to a deal and for inspection of a deal. Use an instance of SuspendedDeal to inspect commerce transactions of an existing deal without opening a session to the peer.

This class cannot be instantiated directly by business applications. Instead InitiatorDeal or RespondentDeal must be used dependant on whether the application requests the activation of a deal or just waits for an indication that the peer activates a deal.

Implementation note A number of the methods defined by this class restricts access by requiring a suitable access control capability to be presented. The functionality for verifying the access control capability is not yet implemented and a null access control handle can be specified.

Version:
$Id: ActiveDeal.java,v 1.13 1998/10/06 06:54:15 semper Exp $
Author:
Rolf Michelsen, Stig Mj�lsnes
See Also:
InitiatorDeal, RespondentDeal, SuspendedDeal

Method Index

 o close()
Releases an association.
 o indication(AccessControlHandle)
Returns an indication of a transaction.
 o indication(long, AccessControlHandle)
Returns an indication of a transaction with timeout.
 o setUserData(Object)
Sets the user data object for the deal.

Methods

 o indication
 public final Transaction indication(AccessControlHandle ach) throws AssociationException, TransactionException
Returns an indication of a transaction. When invoked, this method will wait until a transaction indication is received. The transaction object will then be presented to the user for acknowledgement if this is required by the user policy before it is added to the deal and returned to the business application.

If a suitable access control capability is passed the acknowledgement of the transaction by the user will be bypassed. This functionality is not yet implemented, and a null access control handle should be passed to this method.

If the peer has closed the association an association exception with a proper exception code is thrown.

Parameters:
ach - Access control capability for bypassing user acknowledgement of the indicated transaction.
Returns:
The transaction object for the indicated transaction.
Throws: AssociationException
Thrown if something with the association with the peer is preventing the reception of transaction indications. This exception is also thrown if the association has been closed by the peer.
Throws: TransactionException
Thrown if an error occurs while handling the transaction object. This method will throw this exception if an error occurs while writing the transaction to persistent storage in the archive.
 o indication
 public final Transaction indication(long timeout,
                                     AccessControlHandle ach) throws AssociationException, TransactionException
Returns an indication of a transaction with timeout. When invoked, this method will wait until a transaction indication is received or the method times out. The transaction object will then be presented to the user for acknowledgement, if this is required by the user policy, before it is added to the deal and returned to the caller.

If a suitable access control capability is passed the acknowledgement of the transaction by the user will be bypassed. This functionality is not yet implemented, and a null access control handle should be passed to this method.

If the peer has closed the association an association exception with a proper exception code is thrown.

Parameters:
timeout - The number of milliseconds before the operation times out.
ach - Access control capability for bypassing user acknowledgement of the indicated transaction.
Returns:
The transaction object for the indicated transaction or null if no transaction was indicated.
Throws: AssociationException
Thrown if something with the association with the peer is preventing the reception of transaction indications. This exception is also thrown if the association has been closed by the peer.
Throws: TransactionException
Thrown if an error occurs while handling the transaction object. This method will throw this exception if an error occurs while writing the transaction to persistent storage in the archive.
 o close
 public synchronized void close() throws AssociationException, DealException
Releases an association. This method will close the session between the deal entities in an orderly fashion. Both the initiator and the respondent may invoke this method at any time. This method should eventually be invoked even though the deal has been closed by the peer.

Throws: AssociationException
Thrown if something wrong with the association prevents an orderly shutdown of the session.
Throws: DealException
Thrown if a problem with the archive prevents storage of the deal state.
 o setUserData
 public final Object setUserData(Object data)
Sets the user data object for the deal. This method can be used by an application to store application specific data in a deal. This data will not be used in any way by the SEMPER system. The data can be retrieved by using the method getUserData. The user data object is local to one party of the deal.

Only one user data object can be stored in a deal. Any old object stored in the deal will be removed when a new object is set using this method. Specifying a null reference to this method will simply remove any user data object stored in the deal.

The user data object must be serialisable.

Parameters:
data - The user data object to store in the deal.
Returns:
The previously stored user data object.
See Also:
getUserData

All Packages  Class Hierarchy  This Package  Previous  Next  Index