net.officefloor.frame.impl.execute.governance
Class ActiveGovernanceImpl<I,F extends Enum<F>>

java.lang.Object
  extended by net.officefloor.frame.impl.execute.governance.ActiveGovernanceImpl<I,F>
All Implemented Interfaces:
ActiveGovernance<I,F>, ActiveGovernanceControl<F>, ActiveGovernanceManager<I,F>

public class ActiveGovernanceImpl<I,F extends Enum<F>>
extends Object
implements ActiveGovernanceManager<I,F>, ActiveGovernance<I,F>, ActiveGovernanceControl<F>

ActiveGovernance implementation.

Author:
Daniel Sagenschneider

Constructor Summary
ActiveGovernanceImpl(GovernanceContainer<I,F> governanceContainer, GovernanceMetaData<I,F> metaData, GovernanceControl<I,F> governanceControl, I extensionInterface, ManagedObjectContainer managedObject, WorkContainer<?> workContainer, int registeredIndex)
          Initiate.
 
Method Summary
 GovernanceActivity<I,F> createGovernActivity()
          Creates the GovernanceActivity to provide Governance on the ManagedObject.
 ActiveGovernance<I,F> getActiveGovernance()
          Obtains the ActiveGovernance being managed.
 int getManagedObjectRegisteredIndex()
           Obtains the index by which the ManagedObject has registered this ActiveGovernance.
 boolean governManagedObject(GovernanceContext<F> governanceContext, JobContext jobContext, JobNode jobNode, JobNodeActivateSet activateSet, ContainerContext context)
          Provides the Governance over the ManagedObject.
 boolean isActive()
          Indicates if the Governance is still active.
 boolean isManagedObjectReady(JobContext jobContext, JobNode jobNode, JobNodeActivateSet activateSet, ContainerContext context)
          Indicates if the ManagedObject is ready.
 void unregisterManagedObject(JobNodeActivateSet activateSet, TeamIdentifier currentTeam)
          Unregisters the ManagedObject from Governance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActiveGovernanceImpl

public ActiveGovernanceImpl(GovernanceContainer<I,F> governanceContainer,
                            GovernanceMetaData<I,F> metaData,
                            GovernanceControl<I,F> governanceControl,
                            I extensionInterface,
                            ManagedObjectContainer managedObject,
                            WorkContainer<?> workContainer,
                            int registeredIndex)
Initiate.

Parameters:
governanceContainer - GovernanceContainer.
metaData - GovernanceMetaData.
governanceControl - GovernanceControl.
extensionInterface - Extension interface.
managedObject - ManagedObjectContainer.
workContainer - WorkContainer.
registeredIndex - Registered index within the ManagedObjectContainer.
Method Detail

getActiveGovernance

public ActiveGovernance<I,F> getActiveGovernance()
Description copied from interface: ActiveGovernanceManager
Obtains the ActiveGovernance being managed.

Specified by:
getActiveGovernance in interface ActiveGovernanceManager<I,F extends Enum<F>>
Returns:
ActiveGovernance being managed.

isManagedObjectReady

public boolean isManagedObjectReady(JobContext jobContext,
                                    JobNode jobNode,
                                    JobNodeActivateSet activateSet,
                                    ContainerContext context)
Description copied from interface: ActiveGovernanceManager
Indicates if the ManagedObject is ready.

Specified by:
isManagedObjectReady in interface ActiveGovernanceManager<I,F extends Enum<F>>
Parameters:
jobContext - JobContext.
jobNode - JobNode.
activateSet - JobNodeActivateSet.
context - ContainerContext.
Returns:
true if the ManagedObject is ready.

unregisterManagedObject

public void unregisterManagedObject(JobNodeActivateSet activateSet,
                                    TeamIdentifier currentTeam)
Description copied from interface: ActiveGovernanceManager
Unregisters the ManagedObject from Governance.

Specified by:
unregisterManagedObject in interface ActiveGovernanceManager<I,F extends Enum<F>>
Parameters:
activateSet - JobNodeActivateSet.
currentTeam - TeamIdentifier of the current Team unregistering the ManagedObject.

getManagedObjectRegisteredIndex

public int getManagedObjectRegisteredIndex()
Description copied from interface: ActiveGovernance

Obtains the index by which the ManagedObject has registered this ActiveGovernance.

This allows the ManagedObject to quickly find the ActiveGovernance for unregistering it.

Specified by:
getManagedObjectRegisteredIndex in interface ActiveGovernance<I,F extends Enum<F>>
Returns:
Index by which the ManagedObject has registered this ActiveGovernance.

isActive

public boolean isActive()
Description copied from interface: ActiveGovernance
Indicates if the Governance is still active.

Specified by:
isActive in interface ActiveGovernance<I,F extends Enum<F>>
Returns:
true if the Governance is still active.

createGovernActivity

public GovernanceActivity<I,F> createGovernActivity()
Description copied from interface: ActiveGovernance
Creates the GovernanceActivity to provide Governance on the ManagedObject.

Specified by:
createGovernActivity in interface ActiveGovernance<I,F extends Enum<F>>
Returns:
GovernanceActivity to provide Governance on the ManagedObject.

governManagedObject

public boolean governManagedObject(GovernanceContext<F> governanceContext,
                                   JobContext jobContext,
                                   JobNode jobNode,
                                   JobNodeActivateSet activateSet,
                                   ContainerContext context)
                            throws Throwable
Description copied from interface: ActiveGovernanceControl
Provides the Governance over the ManagedObject.

Specified by:
governManagedObject in interface ActiveGovernanceControl<F extends Enum<F>>
Throws:
Throwable - If fails to provide Governance over the ManagedObject.


Copyright © 2005-2013. All Rights Reserved.