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:
- Callback having methods such as onInit, onRestore, onStart,
onStop, onDestroy as callback of methods init, restore, start, stop,
and destroy respectively, and also method isActive to see if the mobile
code is started or stopped.
- Parameters having methods to access parameters that can
be carried along by the mobile code.
- Migratable having mehtods to allow the mobile code move from
one host to another.
- MCDExtension having methods to get MobileCodeManager and
StorageManager handlers. By this handle, a mobile code can extend services
of the MobileCodeDaemon that relies on mostly to these two classes.
- VMCAccess having methods to access VirtualManagedComponent installed
in the MobileCodeDaemon.
- MessagingAccess having methods to allow a mobile code communicate
with other by passing message.
- See Also:
- MobileCodeManager
-
addJAR(String, byte[])
- Add a JAR into the MobileCodeContainer of the running mobile code.
-
destroy()
-
-
getMobileCodeContainer()
- It returns the MobileCodeContainer handle of the running mobile code.
-
getMobileCodeManager()
-
-
getParameter(Object)
-
-
getParameterNames()
-
-
getParameterValues()
-
-
getStorageManager()
-
-
getVirtualManagedComponent(String, boolean)
-
-
getVirtualManagedComponentList()
-
-
init()
-
-
instantiate(MobileCodeContainer)
- This allows the mobile code implementing this interface to install
another mobile code.
Fill with:
if (stub==null) return;
stub.instantiate (mcc);
-
isActive()
-
-
migrate(MobileCode, boolean)
-
-
migrate(MobileCode, InetAddress, int, boolean)
-
-
migrate(String, boolean)
-
-
migrate(String, InetAddress, int, boolean)
-
-
putParameter(Object, Object)
-
-
receive()
-
-
removeParameter(Object)
-
-
restore()
-
-
send(Message)
-
-
start()
-
-
stop()
-
-
verifyMobileCodeContainer()
- Return true if the mobile code container is successfully verified;
otherwise return false.
Fill with:
if (stub==null) return false;
return stub.verify();
isActive
public abstract boolean isActive()
init
public abstract void init()
restore
public abstract void restore()
start
public abstract void start()
stop
public abstract void stop()
destroy
public abstract void destroy()
getParameter
public abstract Object getParameter(Object paramName)
removeParameter
public abstract Object removeParameter(Object paramName)
putParameter
public abstract void putParameter(Object paramName,
Object paramValue)
getParameterNames
public abstract Enumeration getParameterNames()
getParameterValues
public abstract Enumeration getParameterValues()
migrate
public abstract void migrate(MobileCode mobileCode,
boolean flag)
migrate
public abstract void migrate(MobileCode mobileCode,
InetAddress ip,
int port,
boolean flag)
migrate
public abstract void migrate(String mobileCodeName,
boolean flag)
migrate
public abstract void migrate(String mobileCodeName,
InetAddress ip,
int port,
boolean flag)
getMobileCodeManager
public abstract Object getMobileCodeManager() throws SecurityException
getStorageManager
public abstract StorageManager getStorageManager() throws SecurityException
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.
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);
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();
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();
getVirtualManagedComponent
public abstract MobileCode getVirtualManagedComponent(String name,
boolean className)
getVirtualManagedComponentList
public abstract Enumeration getVirtualManagedComponentList()
send
public abstract void send(Message mesg)
receive
public abstract Message[] receive()
All Packages Class Hierarchy This Package Previous Next Index