Concurrency Service
The Concurrency Service defines a framework for managing concurrent access to remote objects from multiple clients. It is analogous to the multithreading support present in some programming languages, such as C++ and Java, but in a distributed context. The Concurrency Service provides facilities for interfacing with the Transaction Service to allow transactional clients to participate in concurrent access to resources from within transaction contexts.
The model used by the Concurrency Service is that of locks acquired by clients on defined resources. Locks can be of different types (read, write, etc.), and different locking models can be specified, such as multiple-possession, two-phase locks, and so on. Clients that attempt to acquire a lock on a resource and are refused because of conflicts with existing locks are queued in a first-come, first-serve basis.
Resources are implicitly represented by the
LockSet
interface, which can be used to request
and relinquish locks on resources. The
TransactionalLockSet
is an equivalent interface
for transactional clients. Lock sets are created using the
LockSetFactory
interface.
The transaction-related interfaces in this service depend on the Transaction Service interfaces.
Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.