org.objectweb.perseus.distribution.api
Interface DistResCoordinatorFactory


public interface DistResCoordinatorFactory


Method Summary
 DistResCoordinator newCoordinator(DistResCoordinatorService drcs, java.io.Serializable nodeId, java.lang.Object copy, java.lang.Object resId)
          This method is called each time a coordinator of an resource needs to be created.
 

Method Detail

newCoordinator

public DistResCoordinator newCoordinator(DistResCoordinatorService drcs,
                                         java.io.Serializable nodeId,
                                         java.lang.Object copy,
                                         java.lang.Object resId)
This method is called each time a coordinator of an resource needs to be created. However, either a new coordinator instance can be created for each resource or the same one can be shared for several or all resources. Thus the method can return a reference to an already existing object. A copy is passed if the call is a consuquence of a coordinator migration or replication. It contains the state relative to the resource that has been returned by the freeze method of the migrated/replicated coordinator. In a implementation with one coordinator per ressource, the freeze method of the coordinator returns 'this' and all the factory has to do is to initialize the field of the object that haven't been transmitted (e.g. the reference to the coordinator service).

Parameters:
drcs - the service that will have to be used for this resource by the coordinator
nodeId - the id of the local node
copy - a copy of the state relative to the resource if the call is due to a coordinator replication or a migration
resId - the id of the related resource
Returns:
a new coordinator, or an exesting one if it manages multiple resources


Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.