|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
The AgletContext interface is used by an aglet to get information about its environment and to send messages to the environment and other aglets currently active in that environment. It provides means for maintaining and managing running aglets in an environment where the host system is secured against malicious aglets.
| Method Summary | |
void |
addContextListener(ContextListener listener)
Adds the specified context listener to receive context events from this context. |
void |
clearCache(java.net.URL codebase)
Clears class cache in memory. |
AgletProxy |
createAglet(java.net.URL codeBase,
java.lang.String code,
java.lang.Object init)
Creates an instance of the specified aglet class. |
java.util.Enumeration |
getAgletProxies()
Gets an enumeration of all aglets in the current context including deactivated aglets. |
java.util.Enumeration |
getAgletProxies(int type)
Gets an array of aglet proxies in the current context. |
AgletProxy |
getAgletProxy(AgletID id)
Gets a proxy for an aglet in the current context. |
AgletProxy |
getAgletProxy(java.net.URL contextAddress,
AgletID id)
Deprecated. |
java.applet.AudioClip |
getAudioClip(java.net.URL audio)
Gets an audio clip. |
java.net.URL |
getHostingURL()
Returns the URL of the daemon serving this context. |
java.awt.Image |
getImage(ImageData image)
Gets an image. |
java.awt.Image |
getImage(java.net.URL image)
Gets an image. |
ImageData |
getImageData(java.net.URL image)
Gets an image data. |
java.lang.String |
getName()
Gets the name of the context. |
java.lang.Object |
getProperty(java.lang.String key)
Gets the context property indicated by the key. |
java.lang.Object |
getProperty(java.lang.String key,
java.lang.Object def)
Gets the context property indicated by the key and default value. |
ReplySet |
multicastMessage(Message msg)
Sends a multicast message to the subscribers in the context. |
void |
removeContextListener(ContextListener listener)
Removes the specified context listener. |
AgletProxy |
retractAglet(java.net.URL url)
Deprecated. |
AgletProxy |
retractAglet(java.net.URL url,
AgletID aid)
Retracts the aglet specified by its url and id |
void |
setProperty(java.lang.String key,
java.lang.Object value)
Sets the context property indicated by the key and value. |
void |
showDocument(java.net.URL url)
Shows a new document. |
void |
shutdown()
Shutdown the context. |
void |
shutdown(Message msg)
Shutdown the context with the specific message object. |
void |
start()
Starts the context. |
void |
start(boolean reactivate)
Starts the context. |
| Method Detail |
public java.lang.String getName()
public java.util.Enumeration getAgletProxies()
public java.util.Enumeration getAgletProxies(int type)
type - the type of aglets. ACTIVE, INACTIVE or ACTIVE | INACTIVE,Aglet.ACTIVE,
Aglet.INACTIVEpublic AgletProxy getAgletProxy(AgletID id)
id - the identity of the aglet.
public AgletProxy getAgletProxy(java.net.URL contextAddress,
AgletID id)
contextAddress - the address specifing a remote context.id - the identity of the aglet.getName
public AgletProxy createAglet(java.net.URL codeBase,
java.lang.String code,
java.lang.Object init)
throws java.io.IOException,
AgletException,
java.lang.ClassNotFoundException,
java.lang.InstantiationException
codeBase - codeBase specifies the base URL of the aglet class file,
in other words, the (possibly remote) directory that contains the
aglet's code. If this argument is null, then the directories
specified in the local host's aglet search path are searched.
The aglet search path works in a similar way to Java's class path.
It is typically an environment variable that specifies a list of
directories to be searched for aglet code files.code - code gives the name of the file that contains the
aglet's compiled class code. This file is relative to the base URL
of the aglet, and cannot be absolute.init - init is an object passed on to the aglet's onCreation
method.Aglet.onCreation(java.lang.Object)
public AgletProxy retractAglet(java.net.URL url)
throws java.io.IOException,
AgletException
url - the location and aglet identity of the aglet to be retracted.
public AgletProxy retractAglet(java.net.URL url,
AgletID aid)
throws java.io.IOException,
AgletException
url - the location of the aglet to be retracted.id - the aglet identity of the aglet to be retracted.public ReplySet multicastMessage(Message msg)
message - to sendpublic java.net.URL getHostingURL()
public void showDocument(java.net.URL url)
url - an url to be shownpublic java.lang.Object getProperty(java.lang.String key)
key - the name of the context property.
public java.lang.Object getProperty(java.lang.String key,
java.lang.Object def)
key - the name of the context property.def - the value to use if this property is not set.
public void setProperty(java.lang.String key,
java.lang.Object value)
key - the name of the context property.value - the value to be stored.public java.awt.Image getImage(java.net.URL image)
image - an absolute URL giving the location of the image file.public java.applet.AudioClip getAudioClip(java.net.URL audio)
audio - an absolute URL giving the location of the audio file.public ImageData getImageData(java.net.URL image)
image - an absolute URL giving the location of the image file.public java.awt.Image getImage(ImageData image)
image - a serializable image data.public void addContextListener(ContextListener listener)
listener - the context listenerpublic void removeContextListener(ContextListener listener)
listener - the context listenerpublic void start()
public void start(boolean reactivate)
reactivate - if false, it does not activate aglets in the deactivation spoolpublic void clearCache(java.net.URL codebase)
codebase - the codebase of the cache to clean up. if null,
entire cache in this context is cleared.public void shutdown(Message msg)
startpublic void shutdown()
start
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||