public abstract class Distributor
extends java.lang.Object
For CMI to load this configuration, the class has to be named under the
form : full.ServerClass_Cmi
It must provide a constructor without parameter. The results should be constant in the cluster so that each server and client uses the same configuration.
Constructor and Description |
---|
Distributor()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
StubData |
choose(java.lang.reflect.Method method,
java.lang.Object[] parameters)
Choose a stub among the stub list
Default algorithm : round robin
The application deployer can override this method to make its own choices.
|
StubData |
chooseLocalFirst(java.lang.reflect.Method method,
java.lang.Object[] parameters)
Choose a stub among the stub list with a local preference
The application deployer can override this method to make its own choices.
|
abstract boolean |
equivAtBind()
To be overriden
|
abstract boolean |
equivAtExport()
To be overriden
|
protected java.util.Set |
getCurrentState()
Get the current state of the stubs
|
ClusterId |
getMyServerId()
Get the local server id
|
ServerStubList |
getStubList()
Get the stub list
|
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
- do nothing
The application deployer can override this method to make its own choices.
|
void |
preInvoke(java.lang.reflect.Method method,
java.lang.Object[] parameters)
Callback invoked just before the method call
The application deployer can override this method
|
void |
read(java.io.ObjectInput in)
Read the specific distributor data
|
protected void |
removeStub(ClusterId serverId)
Remove a stub in the list by its serverId
|
protected void |
removeStub(StubData sd)
Remove a stub in the list
|
java.lang.String |
toContentsString()
Build a readable view of the stub list
|
java.lang.String |
toString() |
void |
write(java.io.ObjectOutput out)
Write the specific distributor data
|
protected java.util.Set getCurrentState()
protected void removeStub(StubData sd)
sd
- stubprotected void removeStub(ClusterId serverId)
sd
- stubpublic ServerStubList getStubList()
public ClusterId getMyServerId()
public abstract boolean equivAtBind()
public abstract boolean equivAtExport()
public void preInvoke(java.lang.reflect.Method method, java.lang.Object[] parameters)
method
- calling methodparameters
- parameters of the calling methodpublic StubData choose(java.lang.reflect.Method method, java.lang.Object[] parameters) throws NoServerException
method
- calling methodparameters
- parameters of the calling methodNoServerException
- if no server availablepublic StubData chooseLocalFirst(java.lang.reflect.Method method, java.lang.Object[] parameters) throws NoServerException
method
- calling methodparameters
- parameters of the calling methodNoServerException
- if no server availablepublic Decision onException(java.lang.reflect.Method method, java.lang.Object[] parameters, StubData sd, java.lang.Exception ex)
method
- calling methodparameters
- parameters of the calling methodsd
- stub dataex
- exceptionpublic Decision onReturn(java.lang.reflect.Method method, java.lang.Object[] parameters, StubData sd, java.lang.Object retVal)
method
- calling methodparameters
- parameters of the calling methodsd
- stub dataretVal
- return valuepublic java.lang.String toContentsString()
public java.lang.String toString()
toString
in class java.lang.Object
public void write(java.io.ObjectOutput out) throws java.io.IOException
out
- outputjava.io.IOException
- if an I/O error occurspublic void read(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
in
- inputjava.io.IOException
- if an I/O error occursjava.lang.ClassNotFoundException
- if the expected class can not be created