Behavior Class 

All classes which should be uploaded to the server must be derived from this class. The Behavior class can use assistant classes which will be uploaded automatically by the server on demand. But they can be uploaded only while a Behavior class upload transaction or an 'instance create' transaction. The assistant classes must not be derived from Behavior. Clients can create only instances of Behavior classes.

A distinction must be made between 'behavior' classes and 'assistant' classes. Assistant classes must not be derived from Behavior and are only helping classes for a behavior class. Each behavior class has its own assistant classes. If two behavior classes uses the same assistant class then this assistant class will be uploaded twice (and stored twice). A client can only upload behavior classes. The assistant classes will be requested by the server within the 'upload' or the 'instance new' transaction.

The most important method of the Behavior class is the run method:

public void run()

The 'Runner' thread of the behavior server goes periodically through the instances of the uploaded classes. It calls the 'run' method of each instance whose status is RUNNING. Before the 'run' method will be called the variables Behavior.currentCallTime, Behavior.lastCallTime and Behavior.diffCallTime of the instance will be set.

For a more detailed description take a look at the API of the Behavior Class.


Related Topics