com.abiquo.api.Service Class Reference

A service is a service ready to be deployed on a framework and can operated as a resource. More...

Inherits Resource, and IService.

List of all members.

Public Member Functions

void initGridFromConfiguration () throws FrameworkException
void initGridFromConfiguration (FrameworkConfiguration frameworkConfiguration) throws FrameworkException
void setGridFromFramework (IGridAccess access, FrameworkConfiguration config)
 Service ()
 Instantiates a new empty resource java program.
 Service (IService resource)
 Instantiates a new service by clone from the input service.
 Service (String name, List< Data > javaFiles)
 Instantiates a new resource java program.
List< Data > getJavaFiles ()
String getName ()
void setJavaFiles (List< Data > javaFiles)
void setName (String name)

Static Public Member Functions

static IService deploy (File serviceFile) throws FileNotFoundException, InstantiationException
 Deploy an instance of the service implemented on the class file located at serviceFile.

Protected Member Functions

Method findJobHandlerByName (Class<?> serviceClass, String methodName) throws FrameworkException
 Facility to returns the callback method that matches with the methodName.

Protected Attributes

Grid grid
 The grid object this service must operate, and provide grid initialization on different scenarios.
List< Data > javaFiles
 The content of java file classes implementing this service.


Detailed Description

A service is a service ready to be deployed on a framework and can operated as a resource.

This class is the super class of all user defined services. The service programmer must extends this class to create new api resources. Fills the resource interface and can provide entry point methods (exposed functionalities on api description) and user defined callbacks. Also include its own class file content data.

This class provide the grid object the service uses.

See also:
grid
Todo:
see "Service Deploy Guide"
Author:
abiquo

Constructor & Destructor Documentation

com.abiquo.api.Service.Service (  ) 

Instantiates a new empty resource java program.

Only used on java reflection construction.

Todo:
call resource constructor to fit attributes/funtionalities

com.abiquo.api.Service.Service ( IService  resource  ) 

Instantiates a new service by clone from the input service.

Parameters:
resource the resource want to be copied

com.abiquo.api.Service.Service ( String  name,
List< Data >  javaFiles 
)

Instantiates a new resource java program.

Parameters:
name the desired resource name
javaFiles the content of java class files implementing the resource


Member Function Documentation

static IService com.abiquo.api.Service.deploy ( File  serviceFile  )  throws FileNotFoundException, InstantiationException [static]

Deploy an instance of the service implemented on the class file located at serviceFile.

Parameters:
serviceFile the file containing the implementation of the service
Returns:
the deployed service instance object
Exceptions:
FileNotFoundException if the file is not found
InstantiationException if can not create a new object instance from the class object
Todo:
allow multiple file class implementation

Method com.abiquo.api.Service.findJobHandlerByName ( Class<?>  serviceClass,
String  methodName 
) throws FrameworkException [protected]

Facility to returns the callback method that matches with the methodName.

All user defined callback method must have a job as input parameter.

Parameters:
methodName the desired method name
serviceClass class where the callback method is implemented
Returns:
the desired method ready to invoke
Exceptions:
FrameworkException if the method do not exist or is not accessible
Todo:
extend input parameter to AbstractTask.class


Member Data Documentation

The grid object this service must operate, and provide grid initialization on different scenarios.

NOTE : the grid object can not be used on user defined constructors, as it is not defined yet.

See also:
initGridFromConfiguration()

setGridFromFramework()

List<Data> com.abiquo.api.Service.javaFiles [protected]

The content of java file classes implementing this service.


The documentation for this class was generated from the following file:

Generated on Mon Sep 15 20:13:10 2008 for FrameworkAPI by  doxygen 1.5.5