All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface mct.admin.MobileCodeStub

public interface MobileCodeStub
This is an interface between mobile code and the daemon. The description on each method can be seen on the MobileCodeManager

The mobile code (class implementing interface MobileCode) may have any access methods to the MobileCodeManager by implementing one or more interfaces:

See Also:
MobileCodeManager

Method Index

 o addJAR(String, byte[])
Add a JAR into the MobileCodeContainer of the running mobile code.
 o destroy()
 o getMobileCodeContainer()
It returns the MobileCodeContainer handle of the running mobile code.
 o getMobileCodeManager()
 o getParameter(Object)
 o getParameterNames()
 o getParameterValues()
 o getStorageManager()
 o getVirtualManagedComponent(String, boolean)
 o getVirtualManagedComponentList()
 o init()
 o instantiate(MobileCodeContainer)
This allows the mobile code implementing this interface to install another mobile code.
Fill with:
if (stub==null) return;
stub.instantiate (mcc);
 o isActive()
 o migrate(MobileCode, boolean)
 o migrate(MobileCode, InetAddress, int, boolean)
 o migrate(String, boolean)
 o migrate(String, InetAddress, int, boolean)
 o putParameter(Object, Object)
 o receive()
 o removeParameter(Object)
 o restore()
 o send(Message)
 o start()
 o stop()
 o verifyMobileCodeContainer()
Return true if the mobile code container is successfully verified; otherwise return false.

Fill with:
if (stub==null) return false; return stub.verify();

Methods

 o isActive
 public abstract boolean isActive()
 o init
 public abstract void init()
 o restore
 public abstract void restore()
 o start
 public abstract void start()
 o stop
 public abstract void stop()
 o destroy
 public abstract void destroy()
 o getParameter
 public abstract Object getParameter(Object paramName)
 o removeParameter
 public abstract Object removeParameter(Object paramName)
 o putParameter
 public abstract void putParameter(Object paramName,
                                   Object paramValue)
 o getParameterNames
 public abstract Enumeration getParameterNames()
 o getParameterValues
 public abstract Enumeration getParameterValues()
 o migrate
 public abstract void migrate(MobileCode mobileCode,
                              boolean flag)
 o migrate
 public abstract void migrate(MobileCode mobileCode,
                              InetAddress ip,
                              int port,
                              boolean flag)
 o migrate
 public abstract void migrate(String mobileCodeName,
                              boolean flag)
 o migrate
 public abstract void migrate(String mobileCodeName,
                              InetAddress ip,
                              int port,
                              boolean flag)
 o getMobileCodeManager
 public abstract Object getMobileCodeManager() throws SecurityException
 o getStorageManager
 public abstract StorageManager getStorageManager() throws SecurityException
 o instantiate
 public abstract void instantiate(MobileCodeContainer mcc)
This allows the mobile code implementing this interface to install another mobile code.
Fill with:
if (stub==null) return;
stub.instantiate (mcc);

Parameters:
mcc - the container of mobile code to be instantiated.
 o addJAR
 public abstract void addJAR(String name,
                             byte bytes[])
Add a JAR into the MobileCodeContainer of the running mobile code. This is usefull when you want to load more classes that are required by your mobile code.
When a JAR is added, it will be verified if the security is enabled.

Note: this is not dynamically class loader, but you can anticipate what classes are going to be needed and you can install it beforehand.

Fill with:
if (stub==null) return;
stub.addJAR(name, bytes);

 o getMobileCodeContainer
 public abstract MobileCodeContainer getMobileCodeContainer()
It returns the MobileCodeContainer handle of the running mobile code. If you add/modify JARs on the MobileCodeContainer, you should call method verifyMobileCodeContainer() to see the classes' changes.

Fill with:
if (stub==null) return null;
return stub.getMobileCodeContainer();

 o verifyMobileCodeContainer
 public abstract boolean verifyMobileCodeContainer()
Return true if the mobile code container is successfully verified; otherwise return false.

Fill with:
if (stub==null) return false; return stub.verify();

 o getVirtualManagedComponent
 public abstract MobileCode getVirtualManagedComponent(String name,
                                                       boolean className)
 o getVirtualManagedComponentList
 public abstract Enumeration getVirtualManagedComponentList()
 o send
 public abstract void send(Message mesg)
 o receive
 public abstract Message[] receive()

All Packages  Class Hierarchy  This Package  Previous  Next  Index