org.objectweb.carol.cmi
Class DistributorHome

java.lang.Object
  extended by org.objectweb.carol.cmi.Distributor
      extended by org.objectweb.carol.cmi.DistributorHome

public abstract class DistributorHome
extends Distributor

Specific Distributor class for the Home interface load balancing and fail-over logic - default LB algorithm : -> local pref and round robin - default fail-over algorithm : -> retry on ConnectException or ConnectIOException or NoSuchObjectException

Author:
Benoit Pelletier

Constructor Summary
DistributorHome()
           
 
Method Summary
 StubData choose(java.lang.reflect.Method method, java.lang.Object[] parameters)
          choose a stub according to the load balancing algorithm - first local preference - and then round robin The application can override this method
 boolean equivAtBind()
          To be overriden
 boolean equivAtExport()
          To be overriden
 Decision onException(java.lang.reflect.Method method, java.lang.Object[] parameters, StubData sd, java.lang.Exception ex)
          Decision on Exception : - retry on ConnectException or ConnectIOException or NoSuchObjectException The application deployer can override this method to make its own choices.
 Decision onReturn(java.lang.reflect.Method method, java.lang.Object[] parameters, StubData sd, java.lang.Object retVal)
          Decision on return For the SSB, the create method returns a ClusterStub containing a list of Remote stubs (singleton) With the preference local algorithm implemented by the choose method, the local remote stub is also taken in priority Below, the optimization consists not to return a Remote stubs list in this case but just the local Remote Stub.
 
Methods inherited from class org.objectweb.carol.cmi.Distributor
chooseLocalFirst, getCurrentState, getMyServerId, getStubList, preInvoke, read, removeStub, removeStub, toContentsString, toString, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DistributorHome

public DistributorHome()
Method Detail

equivAtBind

public boolean equivAtBind()
Description copied from class: Distributor
To be overriden

Specified by:
equivAtBind in class Distributor
Returns:
true if the bound object have to be clustered
See Also:
The home stub associated with the jndi name has to be replicated at the bind() time

equivAtExport

public boolean equivAtExport()
Description copied from class: Distributor
To be overriden

Specified by:
equivAtExport in class Distributor
Returns:
true if the export object have to be clustered
See Also:
Distributor.equivAtExport()

choose

public StubData choose(java.lang.reflect.Method method,
                       java.lang.Object[] parameters)
                throws NoServerException
choose a stub according to the load balancing algorithm - first local preference - and then round robin The application can override this method

Overrides:
choose in class Distributor
Parameters:
method - called method
parameters - method's parameters list
Returns:
chose stub
Throws:
NoServerException - if no more stub available

onReturn

public Decision onReturn(java.lang.reflect.Method method,
                         java.lang.Object[] parameters,
                         StubData sd,
                         java.lang.Object retVal)
Decision on return For the SSB, the create method returns a ClusterStub containing a list of Remote stubs (singleton) With the preference local algorithm implemented by the choose method, the local remote stub is also taken in priority Below, the optimization consists not to return a Remote stubs list in this case but just the local Remote Stub. Thus, the LB step at the Remote interface is disabled when the SSB is created locally The application deployer can override this method to make its own choices.

Overrides:
onReturn in class Distributor
Parameters:
method - calling method
parameters - parameters of the calling method
sd - stub data
retVal - return value
Returns:
decision

onException

public Decision onException(java.lang.reflect.Method method,
                            java.lang.Object[] parameters,
                            StubData sd,
                            java.lang.Exception ex)
Decision on Exception : - retry on ConnectException or ConnectIOException or NoSuchObjectException The application deployer can override this method to make its own choices.

Overrides:
onException in class Distributor
Parameters:
method - calling method
parameters - parameters of the calling method
sd - stub data
ex - exception
Returns:
decision