|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.aglets.AgletContextImpl
The AgletContextImpl class is the execution context for running aglets. It provides means for maintaining and managing running aglets in an environment where the aglets are protected from each other and the host system is secured against malicious aglets.
Method Summary | |
void |
addContextListener(ContextListener o)
Adds the specified context listener to receive context events from this context. |
void |
clearCache(java.net.URL codebase)
Clear the cache |
AgletProxy |
createAglet(java.net.URL url,
java.lang.String classname,
java.lang.Object init)
Creates an instance of the specified aglet located at the specified URL. |
java.util.Enumeration |
getAgletProxies()
Gets the aglet proxies in the current execution context. |
java.util.Enumeration |
getAgletProxies(int type)
Gets the aglet proxies in the current execution context. |
AgletProxy |
getAgletProxy(AgletID aid)
Gets the proxy for an aglet specified by its identity. |
AgletProxy |
getAgletProxy(java.net.URL host,
AgletID aid)
Deprecated. |
java.applet.AudioClip |
getAudioClip(java.net.URL url)
Gets an audio clip. |
java.net.URL |
getHostingURL()
Returns the URL of the daemon serving all current execution contexts. |
java.awt.Image |
getImage(ImageData d)
Gets an image. |
java.awt.Image |
getImage(java.net.URL url)
Gets an image. |
ImageData |
getImageData(java.net.URL url)
Gets an image data. |
java.lang.String |
getName()
Gets the name of the context |
Persistence |
getPersistence()
|
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. |
ResourceManagerFactory |
getResourceManagerFactory()
|
ReplySet |
multicastMessage(Message msg)
Sends a multicast message to the subscribers in the context. |
void |
postEvent(ContextEvent event,
boolean sync)
|
void |
postEvent0(ContextEvent event)
|
void |
receiveAglet(Name agent_name,
ClassName[] classnames,
java.lang.String codebase,
byte[] agent,
java.lang.String sender)
Receives an aglet. |
void |
removeContextListener(ContextListener o)
Removes the specified context listener. |
AgletProxy |
retractAglet(Ticket ticket,
AgletID aid)
|
AgletProxy |
retractAglet(java.net.URL url)
Deprecated. |
AgletProxy |
retractAglet(java.net.URL url,
AgletID aid)
Retracts the Aglet specified by its url: scheme://host-domain-name/[user-name]#aglet-identity. |
void |
setPersistence(Persistence p)
|
void |
setProperty(java.lang.String key,
java.lang.Object value)
Sets the context property |
void |
setResourceManagerFactory(ResourceManagerFactory rmf)
|
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 |
void |
start(boolean reactivate)
Starts the context. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public void addContextListener(ContextListener o)
AgletContext
addContextListener
in interface AgletContext
com.ibm.aglet.AgletContext
listener
- the context listenerjava.lang.SecurityException
- public void clearCache(java.net.URL codebase)
clearCache
in interface AgletContext
com.ibm.aglet.AgletContext
codebase
- the codebase of the cache to clean up. if null,
entire cache in this context is cleared.public AgletProxy createAglet(java.net.URL url, java.lang.String classname, java.lang.Object init) throws java.io.IOException, AgletException, java.lang.ClassNotFoundException, java.lang.InstantiationException
createAglet
in interface AgletContext
url
- the URL to load the aglet class from.name
- the aglet's class name.java.lang.ClassNotFoundException
- if the class was not foundjava.lang.InstantiationException
- if failed to instantiate the Aglet.public java.util.Enumeration getAgletProxies()
getAgletProxies
in interface AgletContext
public java.util.Enumeration getAgletProxies(int type)
getAgletProxies
in interface AgletContext
public AgletProxy getAgletProxy(AgletID aid)
getAgletProxy
in interface AgletContext
aid
- the identity of the aglet.public AgletProxy getAgletProxy(java.net.URL host, AgletID aid)
getAgletProxy
in interface AgletContext
aid
- the identity of the aglet.public java.applet.AudioClip getAudioClip(java.net.URL url)
AgletContext
getAudioClip
in interface AgletContext
com.ibm.aglet.AgletContext
audio
- an absolute URL giving the location of the audio file.public java.net.URL getHostingURL()
getHostingURL
in interface AgletContext
AgletException
- if the hosting URL cannot be determined.public java.awt.Image getImage(ImageData d)
AgletContext
getImage
in interface AgletContext
com.ibm.aglet.AgletContext
image
- a serializable image data.public java.awt.Image getImage(java.net.URL url)
AgletContext
getImage
in interface AgletContext
com.ibm.aglet.AgletContext
image
- an absolute URL giving the location of the image file.public ImageData getImageData(java.net.URL url)
AgletContext
getImageData
in interface AgletContext
com.ibm.aglet.AgletContext
image
- an absolute URL giving the location of the image file.public java.lang.String getName()
getName
in interface AgletContext
public Persistence getPersistence() throws java.io.IOException
public java.lang.Object getProperty(java.lang.String key)
getProperty
in interface AgletContext
key
- the name of the context property.public java.lang.Object getProperty(java.lang.String key, java.lang.Object def)
getProperty
in interface AgletContext
key
- the name of the context property.def
- the value to use if this property is not set.public ResourceManagerFactory getResourceManagerFactory()
public ReplySet multicastMessage(Message msg)
AgletContext
multicastMessage
in interface AgletContext
com.ibm.aglet.AgletContext
message
- to sendpublic void postEvent(ContextEvent event, boolean sync)
public void postEvent0(ContextEvent event)
public void receiveAglet(Name agent_name, ClassName[] classnames, java.lang.String codebase, byte[] agent, java.lang.String sender) throws AgletException, java.lang.ClassNotFoundException
aglet
- the aglet to be received by the context.AgletException
- if it is not received.public void removeContextListener(ContextListener o)
AgletContext
removeContextListener
in interface AgletContext
com.ibm.aglet.AgletContext
listener
- the context listenerjava.lang.SecurityException
- public AgletProxy retractAglet(Ticket ticket, AgletID aid) throws java.io.IOException, AgletException
public AgletProxy retractAglet(java.net.URL url) throws java.io.IOException, AgletException
retractAglet
in interface AgletContext
url
- the location and aglet identity of the aglet to be retracted.AgletException
- when the method failed to retract the aglet.public AgletProxy retractAglet(java.net.URL url, AgletID aid) throws java.io.IOException, AgletException
retractAglet
in interface AgletContext
url
- the location and aglet identity of the aglet to be retracted.aid
- the aglet identity of the aglet to be retracted.AgletException
- when the method failed to retract the aglet.public void setPersistence(Persistence p) throws AgletException
public void setProperty(java.lang.String key, java.lang.Object value)
setProperty
in interface AgletContext
com.ibm.aglet.AgletContext
key
- the name of the context property.value
- the value to be stored.public void setResourceManagerFactory(ResourceManagerFactory rmf)
public void showDocument(java.net.URL url)
showDocument
in interface AgletContext
url
- an url to be shownpublic void shutdown()
AgletContext
shutdown
in interface AgletContext
com.ibm.aglet.AgletContext
java.lang.SecurityException
- if the current execution context is not
allowd to shutdownstart
public void shutdown(Message msg)
AgletContext
shutdown
in interface AgletContext
com.ibm.aglet.AgletContext
java.lang.SecurityException
- if the current execution context is not
allowd to shutdownstart
public void start()
start
in interface AgletContext
com.ibm.aglet.AgletContext
java.lang.SecurityException
- public void start(boolean reactivate)
AgletContext
start
in interface AgletContext
com.ibm.aglet.AgletContext
reactivate
- if false, it does not activate aglets in the deactivation spooljava.lang.SecurityException
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |