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
  1. Add the aglet.a4compatibility package to the import list
          package your.package;
          import aglet.a4compatibility.*;
        
  2. replace the name of superclass 'Aglet' with 'OldAglet'.
  3. 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);
          }
        
  4. The exceptions thrown by the method on Aglet class has been changed. Please made modification where the compiler complains about the exceptions.

Constructor Index

 o OldAglet()

Method Index

 o getIconImage()
 o getItinerary()
 o getProperty(String)
Gets the aglet property indicated by the key.
 o getProperty(String, String)
Gets the aglet property indicated by the key and default value.
 o getPropertyKeys()
Enumerates all the property keys.
 o onActivation()
 o onActivation(PersistencyEvent)
 o onArrival()
 o onArrival(MobilityEvent)
 o onClone()
 o onClone(CloneEvent)
 o onCloned(CloneEvent)
 o onCloning()
Old Callbacks
 o onCloning(CloneEvent)
 o onCreation(Object)
 o onDeactivating(long)
 o onDeactivating(PersistencyEvent)
 o onDispatching(MobilityEvent)
 o onDispatching(URL)
 o onReverting(MobilityEvent)
 o onReverting(URL)
 o readExternal(ObjectInput)
Reads a state of this aglet from the ObjectInput.
 o setItinerary(Itinerary)
Assigns an Itinerary object to the aglet.
 o setProperty(String, String)
Sets the aglet property indicated by the key and the value.
 o writeExternal(ObjectOutput)
Writes a state of this aglet to the ObjectOutput.

Constructors

 o OldAglet
  public OldAglet()

Methods

 o onCreation
  public void onCreation(Object ini)
Overrides:
onCreation in class Aglet
 o onCloning
  public void onCloning()
Old Callbacks
 o onClone
  public void onClone()
 o onDispatching
  public void onDispatching(URL url)
 o onArrival
  public void onArrival()
 o onReverting
  public void onReverting(URL remoteURL)
 o onDeactivating
  public void onDeactivating(long duaration)
 o onActivation
  public void onActivation()
 o onCloning
  public final void onCloning(CloneEvent ev)
 o onClone
  public final void onClone(CloneEvent ev)
 o onCloned
  public final void onCloned(CloneEvent ev)
 o onDispatching
  public final void onDispatching(MobilityEvent ev)
 o onArrival
  public final void onArrival(MobilityEvent ev)
 o onReverting
  public final void onReverting(MobilityEvent ev)
 o onDeactivating
  public final void onDeactivating(PersistencyEvent ev)
 o onActivation
  public final void onActivation(PersistencyEvent ev)
 o 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.
 o 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.
 o 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
 o getPropertyKeys
  public final Enumeration getPropertyKeys() throws InvalidAgletException
Enumerates all the property keys.
Returns:
property key enumeration.
 o getIconImage
  public Image getIconImage()
 o 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.
 o getItinerary
  public final Itinerary getItinerary() throws InvalidAgletException
Returns:
the itinerary Object of the aglet; null otherwise.
Throws: InvalidAgletException
if the aglet is not valid.
 o 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
 o 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