jason.core
Class ServicesManager

java.lang.Object
  |
  +--jason.core.ServicesManager

public class ServicesManager
extends java.lang.Object

Created Wed Mar 27 10:46:33 2002

This is a toolkit for parsing and managing services. This services are added by the domain or by the user.

See Also:
Domain, Service, ServiceContainer, ServicePropertyManager

Field Summary
static int SERVICE_HOST_SKILL_CRITERIA
          Criteria for getting a set of service for host management
static int SERVICE_NO_SKILL_CRITERIA
          No criteria for a skill evaluation
static int SERVICE_REQUEST_SKILL_CRITERIA
          Criteria for getting a set of service for inner request management
 
Method Summary
 void addService(java.io.File location)
           
 ServiceContainer addService(java.lang.String location)
          This is called by the domain for adding one service in an xml document
 void addServiceContainer(ServiceContainer sc)
          Add a service container.
 void addServices(java.lang.String location)
          Deprecated.  
 ServiceContainer buildServiceContainerFromFile(java.lang.String location)
          This is a ServiceContainer builder for a file location
 Domain getDomain()
           
 MessageHandler getMessageHandler()
           
 ServiceContainerDataModel getModel()
           
 java.lang.Object getPrivateObject()
           
 Service[] getServiceForType(ServiceType type)
           
 Service[] getServiceForType(ServiceType type, int criteria)
          This method will sort the services available for a type by degree of performance from the best performant service to the worst.
 Service[] getServices()
           
 boolean isVerbose()
           
 void removeServiceContainer(ServiceContainer sc)
          Remove the service container.
 void setModel(ServiceContainerDataModel model)
          Set a data model for ServiceContainer
 void setPropertyForServiceLocation(java.lang.String location, java.lang.String property, java.lang.String value)
          Overrided a property from an existing service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_NO_SKILL_CRITERIA

public static final int SERVICE_NO_SKILL_CRITERIA
No criteria for a skill evaluation

See Also:
Constant Field Values

SERVICE_HOST_SKILL_CRITERIA

public static final int SERVICE_HOST_SKILL_CRITERIA
Criteria for getting a set of service for host management

See Also:
Constant Field Values

SERVICE_REQUEST_SKILL_CRITERIA

public static final int SERVICE_REQUEST_SKILL_CRITERIA
Criteria for getting a set of service for inner request management

See Also:
Constant Field Values
Method Detail

isVerbose

public boolean isVerbose()

getMessageHandler

public MessageHandler getMessageHandler()

getDomain

public Domain getDomain()

getPrivateObject

public java.lang.Object getPrivateObject()

addService

public ServiceContainer addService(java.lang.String location)
                            throws JasonException
This is called by the domain for adding one service in an xml document

Parameters:
location - a service xml file for the service.dtd
JasonException

buildServiceContainerFromFile

public ServiceContainer buildServiceContainerFromFile(java.lang.String location)
                                               throws JasonException
This is a ServiceContainer builder for a file location

JasonException

addService

public void addService(java.io.File location)
                throws JasonException
JasonException

addServices

public void addServices(java.lang.String location)
                 throws JasonException
Deprecated.  

Parameters:
location - a services xml file for the services.dtd
JasonException

removeServiceContainer

public void removeServiceContainer(ServiceContainer sc)
Remove the service container. The sub service is stopped if it is not already


addServiceContainer

public void addServiceContainer(ServiceContainer sc)
Add a service container. Note that this method can remove existing service that can be overrided


setPropertyForServiceLocation

public void setPropertyForServiceLocation(java.lang.String location,
                                          java.lang.String property,
                                          java.lang.String value)
                                   throws JasonException
Overrided a property from an existing service

Parameters:
location - an xml file service location
property - a property name
value - a property value
Throws:
JasonException - for invalid property overriding

getServices

public Service[] getServices()
Returns:
available service

getServiceForType

public Service[] getServiceForType(ServiceType type)
Returns:
available service matching the type

getServiceForType

public Service[] getServiceForType(ServiceType type,
                                   int criteria)
This method will sort the services available for a type by degree of performance from the best performant service to the worst.

Parameters:
type - ServiceType to found
criteria - use SERVICE_HOST_SKILL_CRITERIA for a service working with clients (like HTTP) or SERVICE_REQUEST_SKILL_CRITERIA for a service working with another services
Returns:
available service matching the type sorting for the criteria

setModel

public void setModel(ServiceContainerDataModel model)
Set a data model for ServiceContainer


getModel

public ServiceContainerDataModel getModel()
Returns:
a model with all ServiceContainer