org.huihoo.jfox.system
Class ServiceWrapper

java.lang.Object
  extended byorg.huihoo.jfox.system.ComponentSupport
      extended byorg.huihoo.jfox.system.ServiceSupport
          extended byorg.huihoo.jfox.system.ServiceWrapper
All Implemented Interfaces:
Component, Loggable, Persistentable, java.lang.Runnable, java.io.Serializable, Service

public class ServiceWrapper
extends ServiceSupport
implements java.lang.Runnable

wrap a remote system and export it's stub to a speicific port

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.huihoo.jfox.system.ComponentSupport
logger, name, proxyInstance, sequence, state
 
Constructor Summary
ServiceWrapper(java.lang.Class remoteObjectClass, int port)
           
ServiceWrapper(java.rmi.Remote remoteObject, int port)
           
ServiceWrapper(java.lang.String remoteObjectClassName, int port)
           
 
Method Summary
protected  void doDestroy()
          do actually destory action
protected  void doInit()
          do actually create action
protected  void doStart()
          do actually start action
protected  void doStop()
          do actually stop action
 int getPort()
           
 java.rmi.Remote getRemoteObject()
           
 void run()
          When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.
 
Methods inherited from class org.huihoo.jfox.system.ServiceSupport
isRunning, start, stop
 
Methods inherited from class org.huihoo.jfox.system.ComponentSupport
destroy, getLogger, getName, getState, init, parseName, setLogger, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.huihoo.jfox.system.Component
destroy, getName, getState, init
 
Methods inherited from interface org.huihoo.jfox.system.Loggable
getLogger
 

Constructor Detail

ServiceWrapper

public ServiceWrapper(java.rmi.Remote remoteObject,
                      int port)

ServiceWrapper

public ServiceWrapper(java.lang.Class remoteObjectClass,
                      int port)

ServiceWrapper

public ServiceWrapper(java.lang.String remoteObjectClassName,
                      int port)
Method Detail

doInit

protected void doInit()
               throws java.lang.Exception
Description copied from class: ComponentSupport
do actually create action

Specified by:
doInit in class ComponentSupport
Throws:
java.lang.Exception

doStart

protected void doStart()
                throws java.lang.Exception
Description copied from class: ServiceSupport
do actually start action

Specified by:
doStart in class ServiceSupport
Throws:
java.lang.Exception

doStop

protected void doStop()
               throws java.lang.Exception
Description copied from class: ServiceSupport
do actually stop action

Specified by:
doStop in class ServiceSupport
Throws:
java.lang.Exception

doDestroy

protected void doDestroy()
                  throws java.lang.Exception
Description copied from class: ComponentSupport
do actually destory action

Specified by:
doDestroy in class ComponentSupport
Throws:
java.lang.Exception

getPort

public int getPort()

getRemoteObject

public java.rmi.Remote getRemoteObject()

run

public void run()
Description copied from interface: java.lang.Runnable
When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.

The general contract of the method run is that it may take any action whatsoever.

Specified by:
run in interface java.lang.Runnable
See Also:
Thread.run()