Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions
ipcITransactionService Interface Reference

import "ipcITransactionService.idl";

Inheritance diagram for ipcITransactionService:
Inheritance graph
[legend]
Collaboration diagram for ipcITransactionService:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void init (in ACString aNamespace)
 Connects the application to the transaction manager, defines the namespace and initializes internal storage.
void attach (in ACString aDomainName, in ipcITransactionObserver aObserver, in PRBool aLockingCall)
 Links the observer passed in with the domain specified.
void detach (in ACString aDomainName)
 Sends a detach message to the Transaction Manager to unlink the observer associated with the domain passed in.
void flush (in ACString aDomainName, in PRBool aLockingCall)
 Sends a flush message to the Transaction Manager to remove all transactions for the domain.
void postTransaction (in ACString aDomainName,[array, const, size_is(aDataLen)] in octet aData, in unsigned long aDataLen)
 Send the data to the Transaction Manager to be broadcast to any applications that have registered as observers of this particular namespace/domain pairing.

Detailed Description

Definition at line 87 of file ipcITransactionService.idl.


Member Function Documentation

void ipcITransactionService::attach ( in ACString  aDomainName,
in ipcITransactionObserver  aObserver,
in PRBool  aLockingCall 
)

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.

Parameters:
aDomainNamethe name of the domain, in the current namespace, to listen for transactions from. i.e. cookies
aObserverthis will be used to notify the application when transactions and messages come in.
aLockingCallHave 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.
Returns:
NS_OK if the attach message was sent to the Transaction Manager.
an NS_ERROR_<foo> code specific to the failure otherwise
TM_ERROR_QUEUE_EXISTS if the queue already exists which means someone has already attached to it.
void ipcITransactionService::detach ( in ACString  aDomainName)

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.

Parameters:
aDomainNamethe domain, in the current namespace, from which the client should be removed.
Returns:
NS_OK if the detach message is sent to the Transaction Manager
NS_ERROR_FAILURE is something goes wrong
NS_ERRROR_UNEXPECTD if the domain does not have an observer attached
void ipcITransactionService::flush ( in ACString  aDomainName,
in PRBool  aLockingCall 
)

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.

Parameters:
aDomainNameThe domain, in the current namespace, to flush.
aLockingCallHave 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.
Returns:
NS_OK if the flush message is sent to the Transaction Manager
NS_ERROR_FAILURE is something goes wrong
NS_ERRROR_UNEXPECTD if the domain does not have an observer attached
void ipcITransactionService::init ( in ACString  aNamespace)

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

Parameters:
aNamespaceA 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).
Returns:
NS_OK if all memory allocated properly and the IPC service was reached and attached to successfully.
an NS_ERROR_<foo> code specific to the failure otherwise
void ipcITransactionService::postTransaction ( in ACString  aDomainName,
[array, const, size_is(aDataLen)] in octet  aData,
in unsigned long  aDataLen 
)

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 necessary with the synch attach call.

Note: This call is an asynchronous call.

Parameters:
aDomainNamethe domain, in the current namespace, to which the data will be sent.
aDataThe actual data to be sent.
aDataLenThe length of the data argument

The documentation for this interface was generated from the following file: