public interface ConfigurationObject extends ServiceConfigurationValidator
Title: Open Service Framework
Description: The main interface for a service configuration object.
The interface is of a generic Service Configuration Object
scope. It is used to generically
represent a service configuration. It will be implemented by the base abstract AbstractServiceConfigurationObject
and may be used to scope a limited version of the service configuration. For example to obtain a view of the
configuration that only exposes configuration critical parameters.
Copyright: Copyright (c) 2009
Company: StreamScape Technologies
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getEIMPluginName()
Gets the
Event Identity Manager name for this service. |
InvokeMode |
getInvokeMode()
Gets the invoke mode for this service.
|
java.lang.String |
getServiceClassName()
Returns the name of the Class that implements the service.
|
ServiceConfigurationProperties |
getServiceConfigurationProperties()
Returns the
Service Configuration Properties object |
java.lang.String |
getServiceDescription()
Returns the description of this services functional capabilities.
|
java.lang.String |
getServiceDisplayName()
Returns the display name (user friendly name) of the service.
|
java.lang.String |
getServiceName()
Sets the name of the Service instance.
|
java.lang.String |
getServiceType()
Gets the Service Type for this service.
|
java.lang.String |
getValidatorName()
Get the name of the
Validator class to be used by this service. |
boolean |
hasEIMPlugin()
Checks whether this service has an
Event Identity Manager plugin defined. |
boolean |
isDaemonService() |
boolean |
isInterruptableService()
Returns
true if this service may be interrupted by calling it's cancel()
method by using the Event Handler with the same name. |
void |
setDaemonService(boolean isDaemon)
Enables this service to run as a daemon thread in the
Service Hosting Framework . |
void |
setDefaults()
Sets default values for all configuration properties.
|
void |
setEIMPluginName(java.lang.String name)
Sets the
Event Identity Manager class for this service. |
void |
setInterruptableService(boolean isInterruptable)
Sets the status of the service to interruptable or non-interruptable.
|
void |
setInvokeMode(InvokeMode type)
Sets the invoke model for this service.
|
void |
setServiceClassName(java.lang.String className)
Sets the name of the Class that implements this Service.
|
void |
setServiceDescription(java.lang.String desc)
Sets the description of this services functional capabilities.
|
void |
setServiceDisplayName(java.lang.String type)
Sets the user friendly name of the service.
|
void |
setServiceName(java.lang.String name)
Sets the name of the Service instance.
|
void |
setServiceType(java.lang.String type)
Sets the Service Type denoting the function a service performs (ie.
|
void |
setValidatorName(java.lang.String validatorClassName)
Sets the name of the
Validator class to be used by this service when validating
service configuration properties. |
validate
void setServiceClassName(java.lang.String className)
className
- String Class name that implements the Service.java.lang.String getServiceClassName()
void setServiceName(java.lang.String name)
Entity Repository
when set by a factory class.name
- String Service Instance Namejava.lang.String getServiceDisplayName()
void setServiceDisplayName(java.lang.String type)
type
- Stringjava.lang.String getServiceName()
void setServiceType(java.lang.String type)
Repository
when set by a factory class.type
- String Service type.java.lang.String getServiceType()
void setServiceDescription(java.lang.String desc)
desc
- Stringjava.lang.String getServiceDescription()
void setEIMPluginName(java.lang.String name)
Event Identity Manager
class for this service. The EIM sets dynamic values for
CorrelationID
, EventGroup
and EventKey
for a given service.
These values can be used to correlate Events, Notifications and other objects back to the Units of Work
that initiated them, allowing such units to be composed into pipelines or processes by monitoring and
process visualisation tools.name
- String Plugin class name.java.lang.String getEIMPluginName()
Event Identity Manager
name for this service.boolean hasEIMPlugin()
Event Identity Manager
plugin defined.True
if the plugin is registered and false
if not.void setInvokeMode(InvokeMode type)
Fabric Event Dispatcher
. Types are specified in InvokeMode
and signify the following:
type
- InvokeMode Invoke type.InvokeMode
InvokeMode getInvokeMode()
InvokeMode
boolean isDaemonService()
void setDaemonService(boolean isDaemon)
Service Hosting Framework
. Due to
Java limitations on multiple inheritance services may not extend the service framework as well as Thread
interfaces. Daemon mechanisms however, allow a service to be run as a thread under control of a given
run-time environment of a service. Whether a daemon service is invoked in a separate Java thread or a container-
managed thread is up to the implementer. Typically a daemon implementation will launch a service
on a separate Java thread as runnable. Alternative mechanism may be available depending on the hosting environment.
A daemon service is analogies to a worker thread in Java parlance and must have a single active method called
run()
with an associate Event Handler
registered. It's life cycle is managed by the Service
Hosting Container
. After a daemon service is started and the start()
method completes the hosting
framework will automatically invoke the run()
method.
Setting this parameter to true
will implicitly add an appropriate daemon Event Handler
to the configuration.
If the value is set to false
the event handler is automatically removed from the configuration.
Given the decoupled nature of a service configuration and the class that it is describing any
inconsistencies should be resolved by invoking the EventHandlerValidator
on the service.
WARNING!! When a Service is declared as a Daemon Service
by setting this parameter to true
all Event Handler definitions on this service are dropped and a run()
Event Handler method is automatically added.
This overrides all prior Event Handler definitions.
When this parameter is set to false
the run()
Event Handler method is dropped from the configuration.
Only those Services declared as Daemon Service
may have a run()
Event Handler method. If a standard
Service contains such a method a ServiceConfigurationException
is thrown during validation.
isDaemon
- booleanboolean isInterruptableService()
true
if this service may be interrupted by calling it's cancel()
method by using the Event Handler
with the same name. An interruptable service must
have a cancel()
method.void setInterruptableService(boolean isInterruptable) throws ServiceConfigurationException
cancel()
method that, when invoked will interrupt and abort the execution of an
Event Handler
method. For example if an Event Handler
method is executing a database
query or a network operation, such an operation may be interrupted after some time by calling the service cancel()
method.
When this parameter is set to true
an appropriate interruptable Event Handler
will be added to the service configuration. When set to false
, if a handler for the cancel()
method exists it will be removed from the configuration. Given the decoupled nature of a service configuration
and the class it describes any inconsistencies should be resolved by invoking the EventHandlerValidator
on the service. An interruptable service need not have all of its Event Handlers
specify a timeout. Each
handler has the option of specifying its own timeout.
isInterruptable
- booleanServiceConfigurationException
void setValidatorName(java.lang.String validatorClassName)
Validator
class to be used by this service when validating
service configuration properties.validatorClassName
- String Name of the validator class.java.lang.String getValidatorName()
Validator
class to be used by this service.void setDefaults()
ServiceConfigurationProperty
instances and invokes their ServiceConfigurationProperty.applyDefault()
method.ServiceConfigurationProperties getServiceConfigurationProperties()
Service Configuration Properties
objectCopyright © 2015-2024 StreamScape Technologies. All rights reserved.