Show / Hide Table of Contents

Interface IControllable

IControllable interface represents an object quite oftenly referred to as a service that usually operates on its own thread and has a controllable life cycle.

Namespace: Tangosol.Util
Assembly: Coherence.dll
Syntax
public interface IControllable

Properties

IsRunning

Determine whether or not the controllable service is running.

Declaration
bool IsRunning { get; }
Property Value
Type Description
bool

true if the service is running; false otherwise.

Remarks

Returns false before a service is started, while the service is starting, while a service is shutting down and after the service has stopped. It only returns true after completing its start processing and before beginning its shutdown processing.

Methods

Configure(IXmlElement)

Configure the controllable service.

Declaration
void Configure(IXmlElement xml)
Parameters
Type Name Description
IXmlElement xml

An IXmlElement carrying configuration information specific to the IControllable object.

Remarks

This method can only be called before the controllable service is started.
Exceptions
Type Condition
InvalidOperationException

Thrown if the service is already running.

ArgumentException

Thrown if the configuration information is invalid.

Shutdown()

Stop the controllable service.

Declaration
void Shutdown()
Remarks

This is a controlled shut-down, and is preferred to the Stop() method.

This method should only be called once per the life cycle of the controllable service. Calling this method for a service that has already stopped has no effect.

Start()

Start the controllable service.

Declaration
void Start()
Remarks

This method should only be called once per the life cycle of the IControllable service. This method has no affect if the service is already running.
Exceptions
Type Condition
InvalidOperationException

Thrown if a service does not support being re-started, and the service was already started and subsequently stopped and then an attempt is made to start the service again; also thrown if the IControllable service has not been configured.

Stop()

Hard-stop the controllable service.

Declaration
void Stop()
Remarks

Use Shutdown() for normal service termination. Calling this method for a service that has already stopped has no effect.

In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.