ipcITransactionService

IID:15561efb-8c58-4a47-813a-fa91cf730895
Inherits From:nsISupports

Methods

void attach ( ACString domainName , ipcITransactionObserver observer , PRBool lockingCall ) void detach ( ACString domainName ) void flush ( ACString domainName , PRBool lockingCall ) void init ( ACString namespace ) void postTransaction ( ACString domainName , arrayof PRUint8 data , PRUint32 dataLen )

void attach ( ACString domainName , ipcITransactionObserver observer , PRBool lockingCall )

Links the observer passed in with the domain specified. This will allow the observer to post transactions dealing with this domain as well as receive transactions posted by other applications observing this domain.

Return codes for this method confer information about the success of this call, not of the actual attaching of the observer to the domain. (except the TM_ERROR code - which means the observer can not attach) If the attach is successful the observer will have its OnAttachReply method called before this method returns.

Note: This call is synchronous and will not return until the call to OnAttachReply is made.

Arguments:
domainName: the name of the domain, in the current namespace, to listen for transactions from. i.e. cookies
observer: this will be used to notify the application when transactions and messages come in.
lockingCall: Have the Transaction Sevice acquire a lock based on the domain before attaching. This should be used when persistant storage is being used to prevent data corruption.

void detach ( ACString domainName )

Sends a detach message to the Transaction Manager to unlink the observer associated with the domain passed in.

As in attach, return codes do not indicate success of detachment. The observer will have it's OnDetach method called if it is successfully detached.

Note: This call is an asynchronous call.

Arguments:
domainName: the domain, in the current namespace, from which the client should be removed.

void flush ( ACString domainName , PRBool lockingCall )

Sends a flush message to the Transaction Manager to remove all transactions for the domain. After this call there will be no transactions in the Transaction Manager for the namespace/domain pairing. It is up to the application to coordinate the flushing of the Transaction Manager with the writing of data to files, if needed.

Note: This call is synchronous and will not return until the call to OnFlushReply is made.

Arguments:
domainName: The domain, in the current namespace, to flush.
lockingCall: Have the Transaction Sevice acquire a lock based on the domain before flushing. This should be used when persistant storage is being used to prevent data corruption.

void init ( ACString namespace )

Connects the application to the transaction manager, defines the namespace and initializes internal storage

Arguments:
namespace: A string defining the scope of the transaction domains. It is used internally to seperate process listening to the same domain (ie. preferences) but for two different namespaces (ie. profile1 vs profile2).

void postTransaction ( ACString domainName , arrayof PRUint8 data , PRUint32 dataLen )

Send the data to the Transaction Manager to be broadcast to any applications that have registered as observers of this particular namespace/domain pairing.

If this domain is not being observed (attach has not been called for this domain) the message is queued until the attach is made and then the message is sent to the Transaction Manager with the proper domain information.

XXXjg - this may not be neccessary with the synch attach call.

Note: This call is an asynchronous call.

Arguments:
domainName: the domain, in the current namespace, to which the data will be sent.
data: The actual data to be sent.
dataLen: The length of the data argument

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available
Add a note

Copyright © 1999 - 2005 XULPlanet.com