de.janrufmonitor.service
Interface IServiceFactory


public interface IServiceFactory

This interface must be implemented by a service factory object, which should be used in the framework. The service factory takes care about all registered services.

Author:
Thilo Brandt

Method Summary
 String[] getAllServiceIDs()
          Gets a list with all service IDs.
 List getAllServices()
          Gets a list with all service objects.
 IService getService(String id)
          Gets a service for a certain ID.
 boolean isServiceAvailable(String id)
          Checks if the service with the specified ID is available.
 boolean isServiceEnabled(String id)
          Checks if a service is started.
 void restartService(String id)
          Restarts the requested service explicitly
 void shutdown()
          Shuts down the service factory and all its started services.
 void startService(String id)
          Starts the requested service explicitly
 void startup()
          Starts up the service factory and all its registered services.
 void stopService(String id)
          Stops the requested service explicitly
 

Method Detail

shutdown

void shutdown()
Shuts down the service factory and all its started services.


startup

void startup()
Starts up the service factory and all its registered services.


getService

IService getService(String id)
Gets a service for a certain ID.

Parameters:
id - the service ID
Returns:
a service object

getAllServices

List getAllServices()
Gets a list with all service objects.

Returns:
list with all services.

getAllServiceIDs

String[] getAllServiceIDs()
Gets a list with all service IDs.

Returns:
a list with all service IDs.

isServiceAvailable

boolean isServiceAvailable(String id)
Checks if the service with the specified ID is available.

Parameters:
id - service ID
Returns:
true if service is available, false if not

isServiceEnabled

boolean isServiceEnabled(String id)
Checks if a service is started.

Parameters:
id - service ID
Returns:
true if service is enabled, false if not

startService

void startService(String id)
Starts the requested service explicitly

Parameters:
id - service id

restartService

void restartService(String id)
Restarts the requested service explicitly

Parameters:
id - service id

stopService

void stopService(String id)
Stops the requested service explicitly

Parameters:
id - service id


Copyright © 2010 by Thilo Brandt. All Rights Reserved.