|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.ibm.aglet.Aglet
The Aglet class is the abstract base class for aglets. Use this class to create your own personalized aglets.
| Field Summary | |
static int |
ACTIVE
State of Aglet. |
static int |
INACTIVE
|
static short |
MAJOR_VERSION
|
static short |
MINOR_VERSION
|
| Method Summary | |
void |
addCloneListener(CloneListener listener)
Adds the specified clone listener to receive clone events from this aglet. |
void |
addMobilityListener(MobilityListener listener)
Adds the specified mobility listener to receive mobility events from this aglet. |
void |
addPersistencyListener(PersistencyListener listener)
Adds the specified persistency listener to receive persistency events from this aglet. |
java.lang.Object |
clone()
Clones the aglet and the proxy that holds the aglet. |
void |
deactivate(long duration)
Deactivates the aglet. |
void |
dispatch(Ticket ticket)
Dispatches the aglet to the location (host) specified by the ticket as argument. |
void |
dispatch(java.net.URL destination)
Dispatches the aglet to the location (host) specified by the argument. |
void |
dispatchEvent(AgletEvent ev)
Dispatches an event to this aglet |
void |
dispose()
Destroys and removes the aglet from its current aglet context. |
void |
exitMonitor()
Exits the current monitor. |
AgletContext |
getAgletContext()
Gets the context in which the aglet is currently executing. |
AgletID |
getAgletID()
Gets the id of this aglet. |
AgletInfo |
getAgletInfo()
Gets the info object of this aglet |
java.applet.AudioClip |
getAudioData(java.net.URL url)
Gets an audio data |
java.net.URL |
getCodeBase()
Gets the code base URL of this aglet |
java.awt.Image |
getImage(java.net.URL url)
Gets an image |
java.awt.Image |
getImage(java.net.URL url,
java.lang.String name)
Gets an image |
MessageManager |
getMessageManager()
Gets the message manager. |
com.ibm.awb.security.Permissions |
getProtections()
Gets the protections: permission collection about who can send what kind of messages to the aglet |
AgletProxy |
getProxy()
Gets the proxy of aglet. |
java.lang.String |
getText()
Gets the message line of this Aglet. |
boolean |
handleMessage(Message message)
Handles the message form outside. |
void |
notifyAllMessages()
Notifies all of waiting threads. |
void |
notifyMessage()
Notifies a single waiting thread. |
void |
onCreation(java.lang.Object init)
Initializes the new aglet. |
void |
onDisposing()
Is called when an attempt is made to dispose of the aglet. |
void |
removeCloneListener(CloneListener l)
Removes the specified clone listener so it no longer receives clone events. |
void |
removeMobilityListener(MobilityListener l)
Removes the specified mobility listener so it no longer receives mobility events. |
void |
removePersistencyListener(PersistencyListener l)
Removes the specified persistency listener so it no longer receives persistency events. |
void |
run()
Is the entry point for the aglet's own thread of execution. |
void |
setProtections(com.ibm.awb.security.Permissions protections)
Sets the protections: permission collection about who can send what kind of messages to the aglet |
void |
setStub(AgletStub stub)
Sets the proxy for the aglet. |
void |
setText(java.lang.String text)
Sets the text of this Aglet. |
void |
snapshot()
[Preliminary] Save a snapshot of this aglet into a 2nd storage. |
void |
subscribeMessage(java.lang.String name)
Subscribes to a named message. |
void |
suspend(long duration)
This is an experimental feature. |
void |
unsubscribeAllMessages()
Unsubscribes from all message kinds. |
boolean |
unsubscribeMessage(java.lang.String name)
Unsubscribes from a named message. |
void |
waitMessage()
Waits until it is notified. |
void |
waitMessage(long timeout)
Waits until it is notified or the timeout expires |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final short MAJOR_VERSION
public static final short MINOR_VERSION
public static final int ACTIVE
AgletContext.getAgletProxies()public static final int INACTIVE
| Method Detail |
public final java.lang.Object clone()
throws java.lang.CloneNotSupportedException
CloneListener.onCloning(com.ibm.aglet.event.CloneEvent),
CloneListener.onClone(com.ibm.aglet.event.CloneEvent)
public final void dispatch(java.net.URL destination)
throws java.io.IOException,
RequestRefusedException
destination - dispatch destination.MobilityListener.onDispatching(com.ibm.aglet.event.MobilityEvent),
MobilityListener.onArrival(com.ibm.aglet.event.MobilityEvent)
public final void dispatch(Ticket ticket)
throws java.io.IOException,
RequestRefusedException
ticket - ticket to dispatch destination.MobilityListener.onDispatching(com.ibm.aglet.event.MobilityEvent),
MobilityListener.onArrival(com.ibm.aglet.event.MobilityEvent)public final void dispose()
onDisposing()
public final void deactivate(long duration)
throws java.io.IOException
millisecounds - duration of the aglet deactivating.
If this is 0, it will be activeted at the next startup time.
public final void suspend(long duration)
throws AgletException,
java.lang.IllegalArgumentException
This is almost like deactivate(long duration), but there are some differences.
duration - duration of the aglet deactivating in milliseconds.
If this is 0, it will be activeted at the next startup time.
public final void snapshot()
throws java.io.IOException
public void run()
onCreation(java.lang.Object),
CloneListener.onClone(com.ibm.aglet.event.CloneEvent),
MobilityListener.onArrival(com.ibm.aglet.event.MobilityEvent),
PersistencyListener.onActivation(com.ibm.aglet.event.PersistencyEvent)public void onCreation(java.lang.Object init)
init - the argument with which the aglet is initialized.AgletContext.createAglet(java.net.URL, java.lang.String, java.lang.Object)public final void addCloneListener(CloneListener listener)
listener - the mobility listenerpublic final void addMobilityListener(MobilityListener listener)
listener - the mobility listenerpublic final void addPersistencyListener(PersistencyListener listener)
listener - the persistency listenerpublic final void removeCloneListener(CloneListener l)
l - the clone listenerpublic final void removeMobilityListener(MobilityListener l)
l - the mobility listenerpublic final void removePersistencyListener(PersistencyListener l)
l - the persistency listenerpublic final void dispatchEvent(AgletEvent ev)
ev - the aglet eventpublic void onDisposing()
dispose(),
AgletProxy.dispose()public boolean handleMessage(Message message)
msg - the message sent to the agletFutureReply.getReply(),
Message.sendReply(java.lang.Object),
AgletProxy.sendMessage(com.ibm.aglet.Message)public void waitMessage()
MessageManager.waitMessage(),
notifyMessage,
notifyAllMessagespublic void waitMessage(long timeout)
timeout - the maximum value to wait in millisecondsMessageManager.waitMessage(),
notifyMessage,
notifyAllMessagespublic void notifyMessage()
notifyMessage(),
waitMessage,
notifyAllMessagespublic void notifyAllMessages()
notifyAllMessages(),
waitMessage,
notifyMessagepublic void exitMonitor()
exitMonitor(),
waitMessage,
notifyMessage,
notifyAllMessagespublic final AgletProxy getProxy()
public final AgletContext getAgletContext()
public final MessageManager getMessageManager()
public final AgletID getAgletID()
aglet.AgletIDpublic final java.net.URL getCodeBase()
aglet.AgletIDpublic final AgletInfo getAgletInfo()
aglet.AgletIDpublic final java.lang.String getText()
public final void setText(java.lang.String text)
message - the message.public void setProtections(com.ibm.awb.security.Permissions protections)
protections - collection of protections about who can send
what kind of messages to the agletpublic com.ibm.awb.security.Permissions getProtections()
public final void subscribeMessage(java.lang.String name)
name - the message kind.public final boolean unsubscribeMessage(java.lang.String name)
name - the message kind.public final void unsubscribeAllMessages()
public final java.awt.Image getImage(java.net.URL url)
throws java.io.IOException
public final java.awt.Image getImage(java.net.URL url,
java.lang.String name)
throws java.io.IOException
public final java.applet.AudioClip getAudioData(java.net.URL url)
throws java.io.IOException
public final void setStub(AgletStub stub)
proxy - the proxy to set
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||