util.rmi
Class AbstractRmiListener.BindingThread

java.lang.Object
  extended by java.lang.Thread
      extended by util.rmi.AbstractRmiListener.BindingThread
All Implemented Interfaces:
Runnable
Enclosing class:
AbstractRmiListener

private class AbstractRmiListener.BindingThread
extends Thread

A thread that initiates a binding to a special service. The remote object that houses the services is indicated via the naming reference passed to this class's constructor. The service to which it should register is indicated by a class passed to this constructor. This is a not very lucky implementation, but was introdued too late into the concept.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
private  Class<?> caster
          This is the class that denotes the service we need.
private  String name
          This is the reference we should try to register to.
private  long period
          Wait period between binding-resolving retries.
private  int retries
          Maximum number of retries, zero for endless.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
private AbstractRmiListener.BindingThread(String castername, Class<?> casterref, int max, long sleep)
          The binding thread is constructed and started.
 
Method Summary
private  String getBindName()
          Returns the binding name we are trying to connect to.
private  Class<?> getService()
          Returns the server class we want to bind to.
 void run()
          Runs this thread until canceled, the number of retries has commenced or bindign was successful.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private String name
This is the reference we should try to register to.


caster

private Class<?> caster
This is the class that denotes the service we need.


retries

private int retries
Maximum number of retries, zero for endless.


period

private long period
Wait period between binding-resolving retries.

Constructor Detail

AbstractRmiListener.BindingThread

private AbstractRmiListener.BindingThread(String castername,
                                          Class<?> casterref,
                                          int max,
                                          long sleep)
The binding thread is constructed and started. It runs until binding was successful or its cancel method was called or the number of retries was exhausted.

Method Detail

run

public void run()
Runs this thread until canceled, the number of retries has commenced or bindign was successful.

Specified by:
run in interface Runnable
Overrides:
run in class Thread

getBindName

private String getBindName()
Returns the binding name we are trying to connect to.


getService

private Class<?> getService()
Returns the server class we want to bind to.