events
Class VSAbstractEvent

java.lang.Object
  extended by prefs.VSPrefs
      extended by prefs.VSSerializablePrefs
          extended by events.VSAbstractEvent
All Implemented Interfaces:
VSSerializable
Direct Known Subclasses:
VSAbstractInternalEvent, VSAbstractProtocol, VSProcessCrashEvent, VSProcessRecoverEvent

public abstract class VSAbstractEvent
extends VSSerializablePrefs

The class VSAbstractEvent. This abstract class defines the basic framework of each event. an event is used to fullfill a specific task. An event object will get stored in a VSTask object.

Author:
Paul C. Buetow

Field Summary
 VSPrefs prefs
          The prefs.
 VSAbstractProcess process
          The process.
 
Fields inherited from class prefs.VSPrefs
BOOLEAN_PREFIX, COLOR_PREFIX, FLOAT_PREFIX, id, INTEGER_PREFIX, LONG_PREFIX, STRING_PREFIX, VECTOR_PREFIX
 
Constructor Summary
VSAbstractEvent()
           
 
Method Summary
 void deserialize(VSSerialize serialize, java.io.ObjectInputStream objectInputStream)
          Deserializes
 boolean equals(VSAbstractEvent event)
          Checks if the event equals to another event..
 java.lang.String getClassname()
          Gets the classname.
 VSAbstractEvent getCopy()
          Creates a copy of the event.
 VSAbstractEvent getCopy(VSInternalProcess theProcess)
          Creates a copy of the event and using a new process.
 java.lang.String getName()
          Gets the name.
 VSAbstractProcess getProcess()
          Gets the process.
 java.lang.String getShortname()
          Gets the shortname.
 void init()
          Inits the event without setting the processes and prefs variables of the object.
 void init(VSInternalProcess process)
          Inits the event.
 void log(java.lang.String message)
          Logg a specific message.
abstract  void onInit()
          Every event has its own initialize method.
abstract  void onStart()
          Every event can get started.
 void serialize(VSSerialize serialize, java.io.ObjectOutputStream objectOutputStream)
          Serializes
 void setClassname(java.lang.String eventClassname)
          Sets the classname.
 void setShortname(java.lang.String eventShortname)
          Sets the shortname.
 
Methods inherited from class prefs.VSPrefs
clear, copyBooleans, copyColors, copyFloats, copyIntegers, copyLongs, copyStrings, deserialize_, getAllFullKeys, getBoolean, getBooleanKeySet, getBooleanObj, getColor, getColorKeySet, getDescription, getFloat, getFloatKeySet, getFloatObj, getID, getInteger, getIntegerKeySet, getIntegerObj, getLong, getLongKeySet, getLongObj, getObject, getRestriction, getString, getStringKeySet, getUnit, getVector, getVectorKeySet, initBoolean, initBoolean, initBoolean, initColor, initColor, initDescription, initFloat, initFloat, initFloat, initFloat, initInteger, initInteger, initInteger, initInteger, initInteger, initInteger, initLong, initLong, initLong, initLong, initRestriction, initString, initString, initUnit, initVector, initVector, initVector, isEmpty, objectExists, removeObject, serialize_, setBoolean, setBoolean, setColor, setFloat, setFloat, setInteger, setInteger, setLong, setLong, setObject, setString, setVector, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

prefs

public VSPrefs prefs
The prefs.


process

public VSAbstractProcess process
The process.

Constructor Detail

VSAbstractEvent

public VSAbstractEvent()
Method Detail

getCopy

public final VSAbstractEvent getCopy(VSInternalProcess theProcess)
                              throws VSEventNotCopyableException
Creates a copy of the event and using a new process.

Parameters:
theProcess - The new process
Returns:
The copy
Throws:
VSEventNotCopyableException

getCopy

public final VSAbstractEvent getCopy()
                              throws VSEventNotCopyableException
Creates a copy of the event.

Returns:
The copy
Throws:
VSEventNotCopyableException

init

public void init(VSInternalProcess process)
Inits the event.

Parameters:
process - the process

init

public void init()
Inits the event without setting the processes and prefs variables of the object.


setClassname

public final void setClassname(java.lang.String eventClassname)
Sets the classname.

Parameters:
eventClassname - the new classname

getClassname

public java.lang.String getClassname()
Gets the classname.

Returns:
the classname

getName

public java.lang.String getName()
Gets the name.

Returns:
the name

setShortname

public void setShortname(java.lang.String eventShortname)
Sets the shortname.

Parameters:
eventShortname - the new shortname

getShortname

public java.lang.String getShortname()
Gets the shortname.

Returns:
the shortname

getProcess

public VSAbstractProcess getProcess()
Gets the process.

Returns:
the process

log

public void log(java.lang.String message)
Logg a specific message.

Parameters:
message - the loging message

equals

public boolean equals(VSAbstractEvent event)
Checks if the event equals to another event..

Parameters:
event - the event to compare against.
Returns:
true, if the events are the same (have the same event id)

onInit

public abstract void onInit()
Every event has its own initialize method.


onStart

public abstract void onStart()
Every event can get started. This method get's executed if the event takes place.


serialize

public void serialize(VSSerialize serialize,
                      java.io.ObjectOutputStream objectOutputStream)
               throws java.io.IOException
Description copied from interface: VSSerializable
Serializes

Specified by:
serialize in interface VSSerializable
Overrides:
serialize in class VSSerializablePrefs
Parameters:
serialize - The serialize object
objectOutputStream - The object output stream
Throws:
java.io.IOException

deserialize

public void deserialize(VSSerialize serialize,
                        java.io.ObjectInputStream objectInputStream)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Description copied from interface: VSSerializable
Deserializes

Specified by:
deserialize in interface VSSerializable
Overrides:
deserialize in class VSSerializablePrefs
Parameters:
serialize - The serialize object
objectInputStream - The object input stream
Throws:
java.io.IOException
java.lang.ClassNotFoundException