public interface ServiceManager
Title: Service Event Fabric Core
Description: Service Manager interface.
Copyright: Copyright (c) 2011
Company: StreamScape Technologies
Modifier and Type | Method and Description |
---|---|
void |
enableManifest(boolean enable)
Enables or disables a use of the persistent Service Manifest.
|
DSLSyntaxFactoryManager |
getDSLSyntaxFactoryManager()
Returns the DSL Syntax Factory Manager.
|
ServiceDescriptor |
getService(java.lang.String serviceName)
Returns a clone of the specified service descriptor.
|
int |
getServiceSequence(java.lang.String serviceName)
Returns the sequence of the service in which it is bootstrapped by the manager.
|
int |
getServiceStartTimeout()
Returns the timeout which is used during a service startup.
|
ComponentState |
getServiceState(java.lang.String serviceName)
Returns a state of the specified service.
|
boolean |
isAbortOnFailure()
Checks if a failure to start any service will lead to abortion of the Runtime startup.
|
boolean |
isServiceLoaded(java.lang.String fullName)
Checks if the specified service is loaded and initialized.
|
boolean |
isServiceRegistered(java.lang.String serviceName)
Checks if the specified service is registered in the manager.
|
boolean |
isServiceRunning(java.lang.String serviceName)
Checks if the specified service is running.
|
java.util.List |
listLoadedServices()
Returns a list of all loaded services.
|
java.util.List |
listRegisteredServices()
Returns a list of all services registered in the Service Manifest.
|
java.util.List |
listRunningServices()
Returns a list of all running services.
|
void |
loadServiceContext(java.lang.String serviceName)
Loads the service context.
|
void |
registerService(int sequence,
ServiceDescriptor service)
Adds the specified service to the specified position of service start-up sequence and loads the service context.
|
void |
registerService(ServiceDescriptor service)
Adds the specified service to the tail of service start-up sequence and loads the service context
|
void |
resumeService(java.lang.String serviceName)
Resumes the specified service.
|
void |
runServiceAs(java.lang.String serviceName,
java.lang.String username,
java.lang.String password)
Configures the specified service to run with specified user credentials.
|
void |
setAbortOnFailure(boolean value)
Sets 'abortOnFailure' flag that indicates if a failure to start any service will lead to abortion of the Runtime startup.
|
void |
setServiceLogBroadcast(java.lang.String serviceName,
boolean broadcast)
Sets the log broadcast option for the specified service.
|
void |
setServiceLogger(java.lang.String serviceName,
Logger logger)
Sets the custom logger for the specified service.
|
void |
setServiceLogLevel(java.lang.String serviceName,
Trace.Level level)
Sets the log level for the specified service.
|
void |
setServiceSequence(java.lang.String serviceName,
int sequence)
Sets the sequence of the service in which it is bootstrapped by the manager.
|
void |
setServiceStartTimeout(int timeout)
Sets timeout which is used during a service startup.
|
void |
startService(java.lang.String serviceName)
Starts specified service.
|
void |
startService(java.lang.String serviceName,
boolean force)
Starts the specified service.
|
void |
stopService(java.lang.String serviceName)
Stops the specified service.
|
void |
suspendService(java.lang.String serviceName)
Suspends the specified service.
|
void |
unloadServiceContext(java.lang.String serviceName)
Destroys the service context.
|
void |
unregisterService(java.lang.String serviceName)
Destroys service context and removes service from the Service Manifest.
|
void |
updateService(ServiceDescriptor descriptor)
Updates the specified service descriptor.
|
java.util.List listRunningServices()
java.util.List listRegisteredServices()
java.util.List listLoadedServices()
boolean isServiceLoaded(java.lang.String fullName)
fullName
- the name of the service.true
if the service is loaded and initialized, false
otherwise.void setServiceStartTimeout(int timeout)
timeout
- the service start timeout.int getServiceStartTimeout()
void setAbortOnFailure(boolean value)
value
- true
if the Runtime startup will be aborted in the case of a service failure, false
otherwise.boolean isAbortOnFailure()
true
if the Runtime startup will be aborted in the case of a service failure, false
otherwise.void registerService(ServiceDescriptor service) throws ServiceManagerException
service
- the service to be registered.ServiceManagerException
- if some error occurs.void runServiceAs(java.lang.String serviceName, java.lang.String username, java.lang.String password) throws ServiceManagerException
serviceName
- the full name of the service.username
- the user name.password
- the user password.ServiceManagerException
- if some error occurs.void setServiceSequence(java.lang.String serviceName, int sequence) throws ServiceManagerException
1
.serviceName
- the full name of the service.sequence
- the sequence to be set.ServiceManagerException
- if the specified service does not exist.int getServiceSequence(java.lang.String serviceName) throws ServiceManagerException
1
.serviceName
- the full name of the service.ServiceManagerException
- if the specified service does not exist.void registerService(int sequence, ServiceDescriptor service) throws ServiceManagerException
sequence
- the sequence of the service.service
- the service to be added.ServiceManagerException
- if some error occurs.void unregisterService(java.lang.String serviceName) throws ServiceManagerException
the
- full name of the service.ServiceManagerException
- if some error occurs.boolean isServiceRegistered(java.lang.String serviceName)
serviceName
- the full name of the service.true
if the service is registered, false
otherwise.void enableManifest(boolean enable) throws ServiceManagerException
enable
- true
if the manifest should be enabled, false
otherwise.ServiceManagerException
- if some error occurs.void startService(java.lang.String serviceName) throws ServiceManagerException
serviceName
- the full name of the service.ServiceManagerException
- if some error occurs.void startService(java.lang.String serviceName, boolean force) throws ServiceManagerException
force
parameter is true
then dependencies are not checked.serviceName
- the full name of the service.force
- indicates if the dependencies should not be checked.ServiceManagerException
- if some error occurs.void stopService(java.lang.String serviceName) throws ServiceManagerException
serviceName
- the full name of the service.ServiceManagerException
- if some error occurs.boolean isServiceRunning(java.lang.String serviceName)
serviceName
- the full name of the service.true
if the specified service is running, false
otherwise.void suspendService(java.lang.String serviceName) throws ServiceManagerException
serviceName
- the full name of the service.ServiceManagerException
- if some error occurs.void resumeService(java.lang.String serviceName) throws ServiceManagerException
serviceName
- the full name of the service.ServiceManagerException
- if some error occurs.void unloadServiceContext(java.lang.String serviceName) throws ServiceManagerException
serviceName
- the full name of the service.ServiceManagerException
- if some error occurs.void loadServiceContext(java.lang.String serviceName) throws ServiceManagerException
serviceName
- the full name of the service.ServiceManagerException
- if some error occurs.ServiceDescriptor getService(java.lang.String serviceName)
serviceName
- the full name of the service.void updateService(ServiceDescriptor descriptor) throws ServiceManagerException
descriptor
- the service descriptor to be updated.ServiceManagerException
- if the specified service is not registered.ComponentState getServiceState(java.lang.String serviceName)
serviceName
- the full name of the service.null
if the service is not registered.void setServiceLogLevel(java.lang.String serviceName, Trace.Level level) throws ServiceManagerException
serviceName
- the full name of the service.level
- the log level to be set.ServiceManagerException
- if the specified service is not registered.void setServiceLogBroadcast(java.lang.String serviceName, boolean broadcast) throws ServiceManagerException
serviceName
- the full name of the service.broadcast
- the value to be set.ServiceManagerException
- if the specified service is not registered.void setServiceLogger(java.lang.String serviceName, Logger logger)
serviceName
- the full name of the service.logger
- the logger to be set.DSLSyntaxFactoryManager getDSLSyntaxFactoryManager()
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.