org.gcube.vremanagement.executor.state
Class TaskResource

java.lang.Object
  extended by org.gcube.common.core.utils.handlers.GCUBEServiceClientImpl
      extended by org.gcube.common.core.state.GCUBEStatefulResource<org.gcube.common.core.state.GCUBEWSResourceKey>
          extended by org.gcube.common.core.state.GCUBEWSResource
              extended by org.gcube.vremanagement.executor.state.TaskResource
All Implemented Interfaces:
org.gcube.common.core.utils.handlers.GCUBEServiceClient, org.globus.wsrf.PersistenceCallback, org.globus.wsrf.Resource, org.globus.wsrf.ResourceLifetime, org.globus.wsrf.ResourceProperties, org.globus.wsrf.TopicListAccessor

public class TaskResource
extends org.gcube.common.core.state.GCUBEWSResource

An extension of GCUBEWSResource that provides and publishes a runtime environment for a ExecutorTask.

Author:
Fabio Simeoni (University of Strathclyde)

Nested Class Summary
 class TaskResource.TaskLog
          Extends GCUBELog to forward a selection of log messages to the log RP.
 
Nested classes/interfaces inherited from class org.gcube.common.core.state.GCUBEStatefulResource
org.gcube.common.core.state.GCUBEStatefulResource.LOCK, org.gcube.common.core.state.GCUBEStatefulResource.TaskContext
 
Field Summary
 
Fields inherited from class org.gcube.common.core.state.GCUBEStatefulResource
logger, uuidGen
 
Constructor Summary
TaskResource()
           
 
Method Summary
 ExecutorPluginContext getContext()
          Returns the context of the task's plugin.
 String getError()
          Returns the value of the error RP.
 Map<String,Object> getInputs()
          Returns (a copy of) the task inputs.
 String getLog()
          Returns the contents of the log.
 Map<String,Object> getOutputs()
          Returns the task outputs.
 String[] getPropertyNames()
          
 Calendar getStartTime()
          Gets the value of the start time RP.
 ExecutorTask getTask()
          Returns the task.
protected  String[] getTopicNames()
          
protected  void initialise(Object... args)
          
 void launch(org.gcube.common.core.scope.GCUBEScope scope)
          Launches the task in a given scope.
 void setContext(ExecutorPluginContext context)
          Sets the context of the task's plugin.
 void setError(String value)
          Sets the value of the error RP.
 void setInputs(Map<String,Object> inputs)
          Sets the task inputs.
 void setLog(String value)
          Sets the value of the log RP.
 void setOutputs(Map<String,Object> outputs)
          Sets the taks's outputs.
 void setStartTime(Calendar value)
          Sets the value of the start time RP.
 void setState(String value)
          Sets the value of the state RP.
protected  void setType(org.gcube.vremanagement.executor.stubs.TaskDescription value)
          Sets the value of the type RP.
 void stop()
          Attempts to stop execution.
 void store()
          
 
Methods inherited from class org.gcube.common.core.state.GCUBEWSResource
getCurrentTime, getEPR, getPorttypeContext, getProperty, getPublisher, getResourcePropertySet, getServiceContext, getTerminationTime, getTopicList, initialise, initialiseContainers, inScope, load, publish, setPortTypeContext, setTerminationTime, unpublish
 
Methods inherited from class org.gcube.common.core.state.GCUBEStatefulResource
getID, getLock, getScheduledTasks, getScope, launchTask, onRemove, setID, setPersistenceDelegate, stopTask
 
Methods inherited from class org.gcube.common.core.utils.handlers.GCUBEServiceClientImpl
getPortTypeMap, setPortTypeMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskResource

public TaskResource()
Method Detail

getPropertyNames

public String[] getPropertyNames()

Overrides:
getPropertyNames in class org.gcube.common.core.state.GCUBEWSResource

getTopicNames

protected String[] getTopicNames()

Overrides:
getTopicNames in class org.gcube.common.core.state.GCUBEWSResource

initialise

protected void initialise(Object... args)
                   throws Exception

Specified by:
initialise in class org.gcube.common.core.state.GCUBEWSResource
Throws:
Exception

getContext

public ExecutorPluginContext getContext()
Returns the context of the task's plugin.

Returns:
the context.

setContext

public void setContext(ExecutorPluginContext context)
Sets the context of the task's plugin.

Parameters:
context - the context.

getTask

public ExecutorTask getTask()
Returns the task.

Returns:
the task.

setStartTime

public void setStartTime(Calendar value)
Sets the value of the start time RP.

Parameters:
value - the value.

getStartTime

public Calendar getStartTime()
Gets the value of the start time RP.

Returns:
value the value.

setType

protected void setType(org.gcube.vremanagement.executor.stubs.TaskDescription value)
Sets the value of the type RP.

Parameters:
value - the value.

setState

public void setState(String value)
Sets the value of the state RP.

Parameters:
value - the value.

setInputs

public void setInputs(Map<String,Object> inputs)
Sets the task inputs.

Parameters:
inputs - the inputs.

getInputs

public Map<String,Object> getInputs()
Returns (a copy of) the task inputs.

Returns:
the inputs.

setOutputs

public void setOutputs(Map<String,Object> outputs)
Sets the taks's outputs.

Parameters:
outputs - the outputs.

getOutputs

public Map<String,Object> getOutputs()
Returns the task outputs.

Returns:
the inputs.

setError

public void setError(String value)
Sets the value of the error RP.

Parameters:
value - the value.

getError

public String getError()
Returns the value of the error RP.

Returns:
the value.

setLog

public void setLog(String value)
Sets the value of the log RP.

Parameters:
value - the contents.

getLog

public String getLog()
Returns the contents of the log.

Returns:
the contents.

stop

public void stop()
          throws OperationNotSupportedException,
                 Exception
Attempts to stop execution.

Throws:
UnsupportedOperationException - if the task cannot be stopped.
Exception - if the task could not be stopped.
OperationNotSupportedException

launch

public void launch(org.gcube.common.core.scope.GCUBEScope scope)
            throws Exception
Launches the task in a given scope.

Parameters:
scope - the scope.
Throws:
Exception - if the task could not launched.

store

public void store()

Specified by:
store in interface org.globus.wsrf.PersistenceCallback
Overrides:
store in class org.gcube.common.core.state.GCUBEStatefulResource<org.gcube.common.core.state.GCUBEWSResourceKey>


Copyright © 2013. All Rights Reserved.