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

java.lang.Object
  extended by gr.uoa.di.madgik.execution.engine.QueueableExecutionEngine

public class QueueableExecutionEngine
extends Object

This class is a decorator of ExecutionEngine class with the deviation that the execution tasks are queued until desired requirements are met. When a new plan is called to be executed, it is then added up to a queue. The queued plans are investigated either the threshold of the concurrent executions per node are met, otherwise the plan is overtaken until a maximum of times.

Author:
john.gerbesiotis - DI NKUA

Constructor Summary
QueueableExecutionEngine()
           
 
Method Summary
static void Destroy()
          Terminates monitoring
static void Execute(gr.uoa.di.madgik.execution.engine.ExecutionHandle Handle)
          Start the execution of the plan that is described by the provided ExecutionHandle.
static gr.uoa.di.madgik.execution.engine.EngineStatus GetEngineStatus()
          Retrieves the status of the engine in this node
static void Init(gr.uoa.di.madgik.execution.engine.ExecutionEngineConfig Config, String resourceID)
          Initializes the single instance of the engine;
protected static void RemoveExecutor(gr.uoa.di.madgik.execution.engine.PlanExecutor executor)
          Removes the executor.
static gr.uoa.di.madgik.execution.engine.ExecutionHandle Submit(gr.uoa.di.madgik.execution.plan.ExecutionPlan plan)
          Submit an execution plan to retrieve an ExecutionHandle
static gr.uoa.di.madgik.execution.engine.ExecutionHandle Submit(gr.uoa.di.madgik.execution.plan.ExecutionPlan plan, Float util, Integer passedBy)
          Submit an execution plan to retrieve an ExecutionHandle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueableExecutionEngine

public QueueableExecutionEngine()
Method Detail

Init

public static void Init(gr.uoa.di.madgik.execution.engine.ExecutionEngineConfig Config,
                        String resourceID)
Initializes the single instance of the engine;


Submit

public static gr.uoa.di.madgik.execution.engine.ExecutionHandle Submit(gr.uoa.di.madgik.execution.plan.ExecutionPlan plan)
                                                                throws gr.uoa.di.madgik.execution.exception.ExecutionEngineFullException,
                                                                       gr.uoa.di.madgik.execution.exception.ExecutionValidationException,
                                                                       gr.uoa.di.madgik.execution.exception.ExecutionInternalErrorException
Submit an execution plan to retrieve an ExecutionHandle

Parameters:
plan - the plan
Returns:
the execution handle
Throws:
gr.uoa.di.madgik.execution.exception.ExecutionEngineFullException - the execution engine full
gr.uoa.di.madgik.execution.exception.ExecutionValidationException - A validation error occurred
gr.uoa.di.madgik.execution.exception.ExecutionInternalErrorException - An internal error occurred

Submit

public static gr.uoa.di.madgik.execution.engine.ExecutionHandle Submit(gr.uoa.di.madgik.execution.plan.ExecutionPlan plan,
                                                                       Float util,
                                                                       Integer passedBy)
                                                                throws gr.uoa.di.madgik.execution.exception.ExecutionEngineFullException,
                                                                       gr.uoa.di.madgik.execution.exception.ExecutionValidationException,
                                                                       gr.uoa.di.madgik.execution.exception.ExecutionInternalErrorException
Submit an execution plan to retrieve an ExecutionHandle

Parameters:
plan - the plan
util - the utilization factor. Leave null to keep plan's value.
passedBy - the times a plan may be passed by. Leave null to keep plan's value.
Returns:
the execution handle
Throws:
gr.uoa.di.madgik.execution.exception.ExecutionEngineFullException - the execution engine full
gr.uoa.di.madgik.execution.exception.ExecutionValidationException - A validation error occurred
gr.uoa.di.madgik.execution.exception.ExecutionInternalErrorException - An internal error occurred

Execute

public static void Execute(gr.uoa.di.madgik.execution.engine.ExecutionHandle Handle)
                    throws gr.uoa.di.madgik.execution.exception.ExecutionInternalErrorException
Start the execution of the plan that is described by the provided ExecutionHandle. The plan should be queued if desired requirements are not met.

Parameters:
Handle - the handle
Throws:
gr.uoa.di.madgik.execution.exception.ExecutionInternalErrorException - An internal error occurred

GetEngineStatus

public static gr.uoa.di.madgik.execution.engine.EngineStatus GetEngineStatus()
                                                                      throws gr.uoa.di.madgik.execution.exception.ExecutionInternalErrorException
Retrieves the status of the engine in this node

Returns:
the engine status
Throws:
gr.uoa.di.madgik.execution.exception.ExecutionInternalErrorException - An internal error occurred

RemoveExecutor

protected static void RemoveExecutor(gr.uoa.di.madgik.execution.engine.PlanExecutor executor)
Removes the executor.

Parameters:
executor - the executor

Destroy

public static void Destroy()
Terminates monitoring



Copyright © 2014. All Rights Reserved.