TibrvCmTransport()
Method
Declaration
TibrvCmTransport
(
TibrvRvdTransport transport)
throws TibrvExceptionTibrvCmTransport
(
TibrvRvdTransport transport,
java.lang.String cmName,
boolean requestOld)
throws TibrvExceptionTibrvCmTransport
(
TibrvRvdTransport transport,
java.lang.String cmName,
boolean requestOld,
java.lang.String ledgerName,
boolean syncLedger)
throws TibrvExceptionTibrvCmTransport
(
TibrvRvdTransport transport,
java.lang.String cmName,
boolean requestOld,
java.lang.String ledgerName,
boolean syncLedger)
throws TibrvException
Purpose
Create a transport for certified delivery.
Remarks
The new certified delivery transport must employ a valid transport for network communications.
The certified delivery transport remains valid until the program explicitly destroys it.
Parameter |
Description |
|
The new TibrvCmTransport employs this transport object for network communications. This object must be a TibrvRvdTransport. Destroying the TibrvCmTransport does not affect this TibrvRvdTransport object. |
|
Bind this reusable name to the new TibrvCmTransport, so the TibrvCmTransport represents a persistent correspondent with this name. If non- If omitted or For more information, see Name. |
This parameter indicates whether a persistent correspondent requires delivery of messages sent to a previous certified delivery transport with the same name, for which delivery was not confirmed. Its value affects the behavior of other CM sending transports. If this parameter is If this parameter is |
|
If this argument is non- If omitted or For more information, see Ledger File. |
|
|
If this argument is If this argument is |
Method Forms
With only a transport, create a transient correspondent, with a unique, non-reusable name. (Supplying null
as the cmName
has the same effect.)
All other parameters are optional, with default values when omitted.
Name
If cmName
is null
, then TibrvCmTransport() generates a unique, non-reusable name for the new certified delivery transport.
If cmName
is non-null
, then the new transport binds that name. A correspondent can persist beyond transport destruction only when it has both a reusable name and a file-based ledger.
For more information about the use of reusable names, see CM Correspondent Name in
, and Persistent Correspondents in . For details of reusable name syntax, see Reusable Names in .Ledger File
Every certified delivery transport stores the state of its certified communications in a ledger.
If ledgerFile
is null
, then the new transport stores its ledger exclusively in process-based storage. When you destroy the transport or the process terminates, all information in the ledger is lost.
If ledgerFile
specifies a valid file name, then the new transport uses that file for ledger storage. If the transport is destroyed or the process terminates with incomplete certified communications, the ledger file records that state. When a new transport binds the same reusable name, it reads the ledger file and continues certified communications from the state stored in the file.
Even though a transport uses a ledger file, it may sometimes replicate parts of the ledger in process-based storage for efficiency; however, programmers cannot rely on this replication.
The syncLedger
parameter determines whether writing to the ledger file is a synchronous operation:
• | To specify synchronous writing, supply true . Each time Rendezvous software writes a ledger item, the call does not return until the data is safely stored in the storage medium. |
• | To specify asynchronous writing (the default), supply false . Certified delivery calls may return before the data is safely stored in the storage medium, which results in greater speed at the cost of certainty. The ledger file might not accurately reflect program state in cases of hardware or operating system kernel failure (but it is accurate in cases of sudden program failure). Despite this small risk, we strongly recommend this option for maximum performance. |
A program that uses an asynchronous ledger file can explicitly synchronize it by calling TibrvCmTransport.syncLedger().
Destroying a transport with a file-based ledger always leaves the ledger file intact; it neither erases nor removes a ledger file.
The ledger file must reside on the same host computer as the program that uses it.