de.jiac.micro.agent
Class AbstractActiveBehaviour

java.lang.Object
  extended by de.jiac.micro.core.feature.AbstractSchedulable
      extended by de.jiac.micro.core.feature.AbstractPeriodicRunnable
          extended by de.jiac.micro.agent.AbstractActiveBehaviour
All Implemented Interfaces:
IAgentElement, ILifecycleAware

public abstract class AbstractActiveBehaviour
extends AbstractPeriodicRunnable
implements IAgentElement, ILifecycleAware

Describes an abstract active behaviour of an agent. It is scheduled and executed periodically, according to the specified period.

Author:
Marcel Patzlaff

Constructor Summary
protected AbstractActiveBehaviour()
           
 
Method Summary
 void cleanup()
          This method is invoked once immediately before the current instance is disposed.
 void initialise()
          This method is invoked after the current instance is fully configured.
protected abstract  void runShort()
           
 void start()
          Default implementation just enables the current behaviour.
 void stop()
          Default implementation just disables the current behaviour.
 
Methods inherited from class de.jiac.micro.core.feature.AbstractPeriodicRunnable
getPeriod, getStart, setPeriod, setStart
 
Methods inherited from class de.jiac.micro.core.feature.AbstractSchedulable
disable, enable, getCost, getCostOverrunHandler, getDeadline, getDeadlineMissHandler, getPriority, isEnabled, setCost, setCostOverrunHandler, setDeadline, setDeadlineMissHandler, setPriority
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractActiveBehaviour

protected AbstractActiveBehaviour()
Method Detail

cleanup

public void cleanup()
Description copied from interface: ILifecycleAware
This method is invoked once immediately before the current instance is disposed. Implementers have to ensure that every resource that was obtained during the call of ILifecycleAware.initialise() is released!

Specified by:
cleanup in interface ILifecycleAware

initialise

public void initialise()
Description copied from interface: ILifecycleAware
This method is invoked after the current instance is fully configured. It is safe to acquire system resources or handles here. Nevertheless container handles should not be acquired here because the associated handle provider is most likely not intialised yet.

If the current instance is also a handle provider, the handle must be available after this method completes!

Specified by:
initialise in interface ILifecycleAware

start

public void start()
Default implementation just enables the current behaviour.

Specified by:
start in interface ILifecycleAware

stop

public void stop()
Default implementation just disables the current behaviour.

Specified by:
stop in interface ILifecycleAware

runShort

protected abstract void runShort()
Specified by:
runShort in class AbstractPeriodicRunnable


Copyright © 2008-2011 DAI-Labor. All Rights Reserved.