Class aglet.a4compatibility.OldAglet
All Packages Class Hierarchy This Package Previous Next Index
Class aglet.a4compatibility.OldAglet
java.lang.Object
|
+----aglet.Aglet
|
+----aglet.a4compatibility.OldAglet
- public class OldAglet
- extends Aglet
- implements MobilityListener, CloneListener, PersistencyListener
OldAglet class provides a backward compatibility interface for the
alpha4 aglets. To update the aglets written in Alpha4 API to
Alpha5 API, follow the instruction below
- Add the aglet.a4compatibility package to the import list
package your.package;
import aglet.a4compatibility.*;
- replace the name of superclass 'Aglet' with 'OldAglet'.
- If the aglet has the method 'onCreation' defined,
add the statement super.onCreation(null) at the bottom
of that onCreation method.
public void onCreation(Object init) {
// your code goes here
super.onCreation(null);
}
- The exceptions thrown by the method on Aglet class has been changed.
Please made modification where the compiler complains about the
exceptions.
-
OldAglet()
-
-
getIconImage()
-
-
getItinerary()
-
-
getProperty(String)
- Gets the aglet property indicated by the key.
-
getProperty(String, String)
- Gets the aglet property indicated by the key and default value.
-
getPropertyKeys()
- Enumerates all the property keys.
-
onActivation()
-
-
onActivation(PersistencyEvent)
-
-
onArrival()
-
-
onArrival(MobilityEvent)
-
-
onClone()
-
-
onClone(CloneEvent)
-
-
onCloned(CloneEvent)
-
-
onCloning()
- Old Callbacks
-
onCloning(CloneEvent)
-
-
onCreation(Object)
-
-
onDeactivating(long)
-
-
onDeactivating(PersistencyEvent)
-
-
onDispatching(MobilityEvent)
-
-
onDispatching(URL)
-
-
onReverting(MobilityEvent)
-
-
onReverting(URL)
-
-
readExternal(ObjectInput)
- Reads a state of this aglet from the ObjectInput.
-
setItinerary(Itinerary)
- Assigns an Itinerary object to the aglet.
-
setProperty(String, String)
- Sets the aglet property indicated by the key and the value.
-
writeExternal(ObjectOutput)
- Writes a state of this aglet to the ObjectOutput.
OldAglet
public OldAglet()
onCreation
public void onCreation(Object ini)
- Overrides:
- onCreation in class Aglet
onCloning
public void onCloning()
- Old Callbacks
onClone
public void onClone()
onDispatching
public void onDispatching(URL url)
onArrival
public void onArrival()
onReverting
public void onReverting(URL remoteURL)
onDeactivating
public void onDeactivating(long duaration)
onActivation
public void onActivation()
onCloning
public final void onCloning(CloneEvent ev)
onClone
public final void onClone(CloneEvent ev)
onCloned
public final void onCloned(CloneEvent ev)
onDispatching
public final void onDispatching(MobilityEvent ev)
onArrival
public final void onArrival(MobilityEvent ev)
onReverting
public final void onReverting(MobilityEvent ev)
onDeactivating
public final void onDeactivating(PersistencyEvent ev)
onActivation
public final void onActivation(PersistencyEvent ev)
getProperty
public final String getProperty(String key) throws InvalidAgletException
- Gets the aglet property indicated by the key.
- Parameters:
- key - the name of the aglet property.
- Returns:
- the value of the specified key.
getProperty
public final String getProperty(String key,
String defValue) throws InvalidAgletException
- Gets the aglet property indicated by the key and default value.
- Parameters:
- key - the name of the aglet property.
- defValue - the default value to use if this property is not set.
- Returns:
- the value of the specified key.
setProperty
public final void setProperty(String key,
String value) throws InvalidAgletException
- Sets the aglet property indicated by the key and the value.
- Parameters:
- key - the name of the aglet property.
- value - the value to put
getPropertyKeys
public final Enumeration getPropertyKeys() throws InvalidAgletException
- Enumerates all the property keys.
- Returns:
- property key enumeration.
getIconImage
public Image getIconImage()
setItinerary
public final synchronized void setItinerary(Itinerary i) throws AgletException
- Assigns an Itinerary object to the aglet. This assignment is
allowed only once during the life-time of the aglet.
- Parameters:
- itinerary - the Itinerary object.
- Throws: AgletException
- if the aglet was already assigned an
itinerary.
getItinerary
public final Itinerary getItinerary() throws InvalidAgletException
- Returns:
- the itinerary Object of the aglet; null otherwise.
- Throws: InvalidAgletException
- if the aglet is not valid.
writeExternal
protected void writeExternal(ObjectOutput s) throws IOException
- Writes a state of this aglet to the ObjectOutput. this is used
by a subclass which implemetns Externalizable
readExternal
protected void readExternal(ObjectInput s) throws IOException, ClassNotFoundException
- Reads a state of this aglet from the ObjectInput. this is used
by a subclass which implemetns Externalizable
All Packages Class Hierarchy This Package Previous Next Index