gr.uoa.di.madgik.execution.engine
Class ExecutionHandle

java.lang.Object
  extended by gr.uoa.di.madgik.execution.engine.ExecutionHandle
All Implemented Interfaces:
Serializable, Observer

public class ExecutionHandle
extends Object
implements Observer, Serializable

The Class ExecutionHandle.

Author:
gpapanikos
See Also:
Serialized Form

Nested Class Summary
static class ExecutionHandle.HandleState
          The state of the plan
 
Constructor Summary
ExecutionHandle(ExecutionPlan Plan, String hostingNodeInfo)
          Instantiates a new execution handle.
 
Method Summary
 void AddContextHandler(NozzleHandler Handler)
          Adds the context handler.
 void Cancel()
          Cancel.
 void CleanUpStorageSystem()
           
 void DecreaseActionsRunning()
          Decrease actions running.
 void Dispose()
          Dispose this instance, unregisters from registered events, and disposes the context nozzles that were requested to be kept alive until the execution of the handle was completed.
 void EmitEvent(ExecutionStateEvent Event)
          Emit event.
 void FinalizeIsolation()
          Finalize isolation.
 void ForceRecheckOfPendingActions()
          Force re-check of pending actions.
 int GetActionsRunning()
          Gets the number of actions running.
 ExecutionException GetCompletionError()
          Gets the completion error.
 ExecutionStateEvent GetEvent(ExecutionStateEvent.EventName Event)
          Gets the event.
 Collection<ExecutionStateEvent> GetEvents()
          Gets the events.
 ExecutionHandle.HandleState GetHandleState()
          Gets the handle state.
 String getHostingNodeInfo()
           
 File GetIsolatedFile(File original)
          Gets the isolated file.
 BoundaryIsolationInfo GetIsolationInfo()
          Gets the isolation info.
 ExecutionPlan GetPlan()
          Gets the plan.
 Object GetSynchActionsRunning()
          Gets the synch actions running synchronization object
 void IncreaseActionsRunning()
          Increase actions running.
 void InitializeIsolation()
          Initialize isolation.
 boolean IsCompleted()
          Checks if is completed.
 boolean IsCompletedWithError()
          Checks if is completed with error.
 boolean IsCompletedWithSuccess()
          Checks if is completed with success.
 boolean IsIsolationRequested()
          Checks if is isolation requested.
 void Pause()
          Pause.
protected  void PlanCompleted()
          Plan completed.
protected  void PlanRunning()
          Plan running.
 void RegisterObserver(Observer HandleObserver)
          Register observer for the events the handle emits
 void Resume()
          Resume.
protected  void SetCompletionError(ExecutionException CompletionError)
          Sets the completion error.
protected  void SetIsCompleted(boolean IsCompleted)
          Sets the is completed.
protected  void SetIsCompletedWithError(boolean IsCompletedWithError)
          Sets the is completed with error.
protected  void SetIsCompletedWithSuccess(boolean IsCompletedWithSuccess)
          Sets the is completed with success.
 void SetIsolationInfo(BoundaryIsolationInfo IsolationInfo)
          Sets the isolation info.
 void update(Observable o, Object arg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecutionHandle

public ExecutionHandle(ExecutionPlan Plan,
                       String hostingNodeInfo)
Instantiates a new execution handle.

Parameters:
Plan - the plan
Method Detail

getHostingNodeInfo

public String getHostingNodeInfo()

IncreaseActionsRunning

public void IncreaseActionsRunning()
Increase actions running.


DecreaseActionsRunning

public void DecreaseActionsRunning()
Decrease actions running.


ForceRecheckOfPendingActions

public void ForceRecheckOfPendingActions()
Force re-check of pending actions.


GetSynchActionsRunning

public Object GetSynchActionsRunning()
Gets the synch actions running synchronization object

Returns:
the object

GetActionsRunning

public int GetActionsRunning()
Gets the number of actions running.

Returns:
the number

IsCompleted

public boolean IsCompleted()
Checks if is completed.

Returns:
true, if successful

AddContextHandler

public void AddContextHandler(NozzleHandler Handler)
Adds the context handler.

Parameters:
Handler - the handler

GetIsolatedFile

public File GetIsolatedFile(File original)
Gets the isolated file.

Parameters:
original - the original
Returns:
the file

IsIsolationRequested

public boolean IsIsolationRequested()
Checks if is isolation requested.

Returns:
true, if successful

SetIsolationInfo

public void SetIsolationInfo(BoundaryIsolationInfo IsolationInfo)
Sets the isolation info.

Parameters:
IsolationInfo - the isolation info

GetIsolationInfo

public BoundaryIsolationInfo GetIsolationInfo()
Gets the isolation info.

Returns:
the boundary isolation info

InitializeIsolation

public void InitializeIsolation()
                         throws ExecutionValidationException,
                                ExecutionRunTimeException
Initialize isolation.

Throws:
ExecutionValidationException - A validation error occurred
ExecutionRunTimeException - A runtime error occurred

FinalizeIsolation

public void FinalizeIsolation()
                       throws ExecutionValidationException,
                              ExecutionRunTimeException
Finalize isolation.

Throws:
ExecutionValidationException - An execution validation error occurred
ExecutionRunTimeException - An runtime error occurred

SetIsCompleted

protected void SetIsCompleted(boolean IsCompleted)
Sets the is completed.

Parameters:
IsCompleted - the is completed

IsCompletedWithSuccess

public boolean IsCompletedWithSuccess()
Checks if is completed with success.

Returns:
true, if successful

SetIsCompletedWithSuccess

protected void SetIsCompletedWithSuccess(boolean IsCompletedWithSuccess)
Sets the is completed with success.

Parameters:
IsCompletedWithSuccess - the is completed with success

IsCompletedWithError

public boolean IsCompletedWithError()
Checks if is completed with error.

Returns:
true, if successful

SetIsCompletedWithError

protected void SetIsCompletedWithError(boolean IsCompletedWithError)
Sets the is completed with error.

Parameters:
IsCompletedWithError - the is completed with error

GetCompletionError

public ExecutionException GetCompletionError()
Gets the completion error.

Returns:
the execution exception

SetCompletionError

protected void SetCompletionError(ExecutionException CompletionError)
Sets the completion error.

Parameters:
CompletionError - the completion error

RegisterObserver

public void RegisterObserver(Observer HandleObserver)
Register observer for the events the handle emits

Parameters:
HandleObserver - the handle observer

EmitEvent

public void EmitEvent(ExecutionStateEvent Event)
Emit event.

Parameters:
Event - the event

GetEvent

public ExecutionStateEvent GetEvent(ExecutionStateEvent.EventName Event)
Gets the event.

Parameters:
Event - the event
Returns:
the execution state event

GetEvents

public Collection<ExecutionStateEvent> GetEvents()
Gets the events.

Returns:
the collection< execution state event>

GetPlan

public ExecutionPlan GetPlan()
Gets the plan.

Returns:
the execution plan

GetHandleState

public ExecutionHandle.HandleState GetHandleState()
Gets the handle state.

Returns:
the execution handle. handle state

PlanRunning

protected void PlanRunning()
Plan running.


PlanCompleted

protected void PlanCompleted()
Plan completed.


Pause

public void Pause()
Pause.


Resume

public void Resume()
Resume.


Cancel

public void Cancel()
Cancel.


update

public void update(Observable o,
                   Object arg)
Specified by:
update in interface Observer

Dispose

public void Dispose()
Dispose this instance, unregisters from registered events, and disposes the context nozzles that were requested to be kept alive until the execution of the handle was completed.


CleanUpStorageSystem

public void CleanUpStorageSystem()


Copyright © 2013. All Rights Reserved.