i3.dragos.core.services.commands
Class CommandService

java.lang.Object
  extended by i3.dragos.core.AbstractService
      extended by i3.dragos.core.services.commands.CommandService
All Implemented Interfaces:
Service

public class CommandService
extends AbstractService

The CommandService provides an interface for standardized optional GraphPool functionality.

Author:
Erhard Weinell <Weinell@cs.RWTH-Aachen.DE>

Nested Class Summary
 
Nested classes/interfaces inherited from interface i3.dragos.core.Service
Service.Result, Service.State
 
Constructor Summary
CommandService()
           
 
Method Summary
 java.lang.Object execute(DataSourceURL url, java.lang.Class<? extends Command> cmdCls, java.lang.Object... paramters)
          Convenience method to create and process a command, and to return its result.
static CommandService getInstance()
          Returns the event manager instance registered by the service manager.
 java.lang.String getName()
          Returns the name of the service.
 void register(DataSourceURL url, CommandProcessor processor, CommandProvider provider)
           
 CommandProcessor retrieveProcessor(DataSourceURL url)
          Retrieve a command processor object by the according logical graph pool URL.
 CommandProvider retrieveProvider(DataSourceURL url)
          Retrieve a command provider object by the according logical graph pool URL.
 Service.Result uninitialize()
          Uninitializes the services and releases all resources used by the service.
 
Methods inherited from class i3.dragos.core.AbstractService
getState, initialize, resume, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandService

public CommandService()
Method Detail

getInstance

public static CommandService getInstance()
Returns the event manager instance registered by the service manager.

Returns:
the rule engine registered by the module manager.

getName

public java.lang.String getName()
Returns the name of the service.

Returns:
the name of the service.

register

public void register(DataSourceURL url,
                     CommandProcessor processor,
                     CommandProvider provider)
Parameters:
url -
processor -
provider -

retrieveProcessor

public CommandProcessor retrieveProcessor(DataSourceURL url)
Retrieve a command processor object by the according logical graph pool URL.

Parameters:
url - the logical graph pool URL.
Returns:
the according processor, or null if none is registered.

retrieveProvider

public CommandProvider retrieveProvider(DataSourceURL url)
Retrieve a command provider object by the according logical graph pool URL.

Parameters:
url - the logical graph pool URL.
Returns:
the according provider, or null if none is registered.

execute

public java.lang.Object execute(DataSourceURL url,
                                java.lang.Class<? extends Command> cmdCls,
                                java.lang.Object... paramters)
                         throws java.lang.IllegalStateException,
                                ExecutionAbortedException
Convenience method to create and process a command, and to return its result.

Parameters:
url - the graph pool's URL to operate on.
cmdCls - the type of command to execute.
paramters - parameters required for command creation.
Returns:
the command's result.
Throws:
ExecutionAbortedException
java.lang.IllegalStateException

uninitialize

public Service.Result uninitialize()
Description copied from class: AbstractService
Uninitializes the services and releases all resources used by the service.

Specified by:
uninitialize in interface Service
Overrides:
uninitialize in class AbstractService
Returns:
OK if the uninitialization was successful, FAILED if it was not and INVALID if the configuration was incorrect.


Copyright © 2002-2008 RWTH Aachen, Department of Computer Science 3 (Software Engineering). All Rights Reserved.