net.sourceforge.sconman.agents
Class AbstractAgent

java.lang.Object
  extended by net.sourceforge.sconman.agents.AbstractAgent
All Implemented Interfaces:
IAgent
Direct Known Subclasses:
FileAdderAgent, MailAdderAgent, OldContentsSweeper

public abstract class AbstractAgent
extends java.lang.Object
implements IAgent

Convenience class to be extended by IAgent implementations.

Author:
mikeshadow

Field Summary
protected  User actor
          The actor to use when doing actions
 
Constructor Summary
AbstractAgent()
           
 
Method Summary
 User getActor()
           
 java.lang.String getName()
          Returns the agent id.
 long getPeriod()
          Returns the execution period in miliseconds.
abstract  void run(Project prj)
          This method will be called by the SCM engine each getPeriod() miliseconds to perform some maintenance task.
 void setActor(User actor)
          Sets the actor that will be used to do actions
 void setName(java.lang.String name)
          Sets the agent id.
 void setPeriod(long period)
          Sets the execution period in miliseconds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actor

protected User actor
The actor to use when doing actions

Constructor Detail

AbstractAgent

public AbstractAgent()
Method Detail

run

public abstract void run(Project prj)
This method will be called by the SCM engine each getPeriod() miliseconds to perform some maintenance task.

Specified by:
run in interface IAgent
Parameters:
prj - The project to operate with

getName

public java.lang.String getName()
Returns the agent id.

Specified by:
getName in interface IAgent
Returns:
String

setName

public void setName(java.lang.String name)
Sets the agent id.

Specified by:
setName in interface IAgent
Parameters:
id - The id to set

getPeriod

public long getPeriod()
Returns the execution period in miliseconds.

Specified by:
getPeriod in interface IAgent
Returns:
The execution period in miliseconds.

setPeriod

public void setPeriod(long period)
Sets the execution period in miliseconds

Specified by:
setPeriod in interface IAgent
Parameters:
period - The period to set

getActor

public User getActor()
Returns:
Returns the actor.

setActor

public void setActor(User actor)
Description copied from interface: IAgent
Sets the actor that will be used to do actions

Specified by:
setActor in interface IAgent
Parameters:
actor - The actor to set.


Copyright null null. All Rights Reserved.