Any ActiveSpaces® Transactions Managed Object can be a distributed object. A distributed object transparently provides remote method invocation and access to object fields across nodes. The full transactional guarantees made by ActiveSpaces® Transactions for non-distributed objects are also true for distributed objects.
Access to a distributed object is through a normal Java object reference. All Managed Object references contain data to identify the node where the object was created.
The same instance of an object cannot exist on multiple nodes. Copies of an object's state may be located on multiple nodes to improve performance or robustness, but the master copy is located on a single node - by default the node where the object was created.
All object methods transparently execute on the master node for an object. Any methods invoked on an object reference are sent to the master node and executed there.
Objects of the same type can be created on multiple nodes. This is done by installing the application class files, or implementation, on multiple nodes. This is a common application architecture to support object partitioning and caching or service availability mechanisms.
Figure 6.1, “Distributed method execution” shows an
Order
class that has its implementation installed on two
nodes - Node One
and Node Two
. Two
instances of the Order
class have been created, one on
Node One
and one on Node Two
. When the
Order.cancel()
method is executed on Node
One,
using the order(Node Two)
instance, the
method is executed on Node Two
. The opposite is true for
the order(Node One)
instance.