org.jwarp.service
Interface IService

All Superinterfaces:
IConfigurable, IExceptionProvider
All Known Subinterfaces:
ICacheService, IConfigurationService, IConnectionPoolService, IDisplayService, IGroupService, IIdService, ILocalizationService, ILogService, IMailService, IObjectPoolService, IParamService, IPersistenceService, IPoolService, IScreenService, ISecurityService, IShutDownService, IThreadPoolService, IWebService, IWorkService, IXSLTService
All Known Implementing Classes:
AService

public interface IService
extends IConfigurable, IExceptionProvider

Basic service interface. All JWeb services that can be created and managed by JWeb application contexts must implement this interface.

Version:
1.0
Author:
Anatole Tresch

Field Summary
static int SERVICE_STATUS_CREATED
          Service is created but not configured.
static int SERVICE_STATUS_NOT_AVAILABLE
          Service is not available.
static int SERVICE_STATUS_READY
          Service is ready for use, but not started yet.
static int SERVICE_STATUS_RESUMING
          Service is resuming.
static int SERVICE_STATUS_RUNNING
          Service is up and running.
static int SERVICE_STATUS_STARTING
          Service is in starting process
static int SERVICE_STATUS_STOPPED
          Service is stopped and cannot be used
static int SERVICE_STATUS_STOPPING
          Service is in stopping process
static int SERVICE_STATUS_SUSPENDED
          Service is suspended and cannot be used
 
Method Summary
 void checkContext(IContext context)
          This checks if the given context is a valid context for the service.
 java.lang.String[] getDependencies()
           
 int getLogLevel()
          This method returns if the application actually is running in debugging mode and so printing more detailed information on errors
 java.lang.String getName()
          Get the service's name.
 int getStatus(ITicket ticket)
          Returns the current status of the service
 java.lang.String getType()
          Get the service's type.
 void resume(ITicket ticket)
          Resume the service
 void setContext(IContext context, ITicket user)
          Change the service's context.
 void setDependencies(java.lang.String[] dependencies)
           
 void setLogLevel(int level)
          With this method debugging mode can be switched on and off
 void shutdown(ITicket ticket)
          Shutdown the service
 void start(ITicket ticket)
          Start the service with the given configuration.
 void suspend(ITicket ticket)
          Suspend the service
 
Methods inherited from interface org.jwarp.service.configuration.IConfigurable
configure
 
Methods inherited from interface org.jwarp.common.IExceptionProvider
addExceptionListener, getExceptionListeners, removeAllExceptionListeners, removeExceptionListener
 

Field Detail

SERVICE_STATUS_NOT_AVAILABLE

public static final int SERVICE_STATUS_NOT_AVAILABLE
Service is not available. This is an error condition.

SERVICE_STATUS_CREATED

public static final int SERVICE_STATUS_CREATED
Service is created but not configured. As long as the service is not configured it can not be started.

SERVICE_STATUS_READY

public static final int SERVICE_STATUS_READY
Service is ready for use, but not started yet.

SERVICE_STATUS_RUNNING

public static final int SERVICE_STATUS_RUNNING
Service is up and running.

SERVICE_STATUS_STOPPED

public static final int SERVICE_STATUS_STOPPED
Service is stopped and cannot be used

SERVICE_STATUS_SUSPENDED

public static final int SERVICE_STATUS_SUSPENDED
Service is suspended and cannot be used

SERVICE_STATUS_STARTING

public static final int SERVICE_STATUS_STARTING
Service is in starting process

SERVICE_STATUS_STOPPING

public static final int SERVICE_STATUS_STOPPING
Service is in stopping process

SERVICE_STATUS_RESUMING

public static final int SERVICE_STATUS_RESUMING
Service is resuming.
Method Detail

getType

public java.lang.String getType()
Get the service's type. Types are the basic service types such as MAIL, LOG, DBPOOL, WORKMANAGER
Returns:
The name

getName

public java.lang.String getName()
Get the service's name.
Returns:
The name

start

public void start(ITicket ticket)
           throws ServiceInitializationException,
                  java.lang.SecurityException
Start the service with the given configuration.
Throws:
ServiceInitializationException - If the service could not started
java.lang.SecurityException - If access was denied.

shutdown

public void shutdown(ITicket ticket)
              throws ServiceRuntimeException,
                     java.lang.SecurityException
Shutdown the service
Parameters:
ticket - The user ticket
Throws:
ServiceRuntimeException - If the service could not be shut own
java.lang.SecurityException - If access was denied.

suspend

public void suspend(ITicket ticket)
             throws ServiceRuntimeException,
                    java.lang.SecurityException
Suspend the service
Parameters:
ticket - The user ticket
Throws:
ServiceRuntimeException - If the service could not be suspended
java.lang.SecurityException - If access was denied.

resume

public void resume(ITicket ticket)
            throws ServiceRuntimeException,
                   java.lang.SecurityException
Resume the service
Parameters:
ticket - The user ticket
Throws:
ServiceRuntimeException - If the service could not be resumed
java.lang.SecurityException - If access was denied.

getStatus

public int getStatus(ITicket ticket)
              throws java.lang.SecurityException
Returns the current status of the service
Parameters:
ticket - The user ticket
Throws:
java.lang.SecurityException - If access was denied.

getDependencies

public java.lang.String[] getDependencies()

setDependencies

public void setDependencies(java.lang.String[] dependencies)

checkContext

public void checkContext(IContext context)
                  throws java.lang.SecurityException
This checks if the given context is a valid context for the service.
Parameters:
The - context
Throws:
java.lang.SecurityException - If the context is invalid

setContext

public void setContext(IContext context,
                       ITicket user)
                throws java.lang.SecurityException
Change the service's context. This is an admin and initialization method only.
Parameters:
context - The context
user - The user
Throws:
java.lang.SecurityException - If the context is invalid

getLogLevel

public int getLogLevel()
This method returns if the application actually is running in debugging mode and so printing more detailed information on errors

setLogLevel

public void setLogLevel(int level)
With this method debugging mode can be switched on and off

©   O R C A   S y s t e m s