net.officefloor.frame.spi.team
Interface JobContext

All Known Implementing Classes:
LeaderFollowerTeam.TeamMember, OnePersonTeam.OnePerson, PassiveTeam.PassiveJobContext

public interface JobContext

Context for the execution of a Job.

Author:
Daniel Sagenschneider

Method Summary
 boolean continueExecution()
          Indicates whether to continue execution.
 TeamIdentifier getCurrentTeam()
          Obtains the TeamIdentifier of the current Team executing the Job.
 long getTime()
           Obtains the current time in milliseconds.
 

Method Detail

getTime

long getTime()

Obtains the current time in milliseconds.

This should return similar to System.currentTimeMillis() but is provided to cache time for multiple quick operations that require only estimates of time - such as check if asynchronous operations by the ManagedObject instances have not timed out.

Note CPU operations should be in the nano-seconds.

Returns:
Time measured in milliseconds.

getCurrentTeam

TeamIdentifier getCurrentTeam()
Obtains the TeamIdentifier of the current Team executing the Job.

Returns:
TeamIdentifier of the current Team executing the Job.

continueExecution

boolean continueExecution()
Indicates whether to continue execution. This provides a hint to allow a Job to be more responsive in shutting down.

Returns:
true if should continue executing or false if execution has stopped and the Job should stop.


Copyright © 2005-2013. All Rights Reserved.