org.restlet.service
Class Service

java.lang.Object
  extended by org.restlet.service.Service
Direct Known Subclasses:
ConnectorService, ConverterService, DecoderService, LogService, MetadataService, RangeService, StatusService, TaskService, TunnelService

public abstract class Service
extends java.lang.Object

Generic service associated to a component or an application. The lifecycle of a service is tigthly related to the one of the associated component or application.

If you want to use a specific service, you can always disable it before it is actually started via the setEnabled(boolean) method.

Author:
Jerome Louvel

Constructor Summary
Service()
          Constructor.
Service(boolean enabled)
          Constructor.
 
Method Summary
 boolean isEnabled()
          Indicates if the service should be enabled.
 boolean isStarted()
          Indicates if the Restlet is started.
 boolean isStopped()
          Indicates if the Restlet is stopped.
 void setEnabled(boolean enabled)
          Indicates if the service should be enabled.
 void start()
          Starts the Restlet.
 void stop()
          Stops the Restlet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Service

public Service()
Constructor. Enables the service by default.


Service

public Service(boolean enabled)
Constructor.

Parameters:
enabled - True if the service has been enabled.
Method Detail

isStarted

public boolean isStarted()
Indicates if the Restlet is started.

Returns:
True if the Restlet is started.

isStopped

public boolean isStopped()
Indicates if the Restlet is stopped.

Returns:
True if the Restlet is stopped.

start

public void start()
           throws java.lang.Exception
Starts the Restlet.

Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Stops the Restlet.

Throws:
java.lang.Exception

isEnabled

public boolean isEnabled()
Indicates if the service should be enabled.

Returns:
True if the service should be enabled.

setEnabled

public void setEnabled(boolean enabled)
Indicates if the service should be enabled.

Parameters:
enabled - True if the service should be enabled.


Copyright © 2005-2008 Noelios Technologies.