com.codemonster.surinam.export.lifecycle
Interface ManagedService

All Known Implementing Classes:
PlaceholderProviderImplementation, ServiceAdapter, SimpleServiceWrapper

public interface ManagedService

This interface is to allow a service to accept requests from the framework to set its internal status flag. The flag itself is the mechanism by which, the framework is able to tell whether the designated organization impl for the contract is ready to accept requests. Note that this is a dynamic runtime mechanism.
Also, there is a method that allows the framework to poll the status of the organization implementation with regard to its ability to handle requests. This model may be fertile ground for additional models that are more efficient, like polling the status of each organization impl every so many millseconds or every so many invocations.

Note that this interface IS REQUIRED for all Service Implemenations. Any service that does not will fail its deployment. For POJOs who would like to keep their API decoupled from the framework, wrappers are recommended.


Method Summary
 ServiceAvailability getServiceAvailability()
          This is a request to set the availability flag to false, which will tell the framework that this implementation is not ready to accept calls.
 String getVersion()
          A managed implementation will have a version associated with it.
 VersionedProviderImplementationName getVersionedProviderImplementationName()
          Service implementations are versioned, and therefore must provide an appropriate object that allows the framework to discriminate between different versions of the same service class.
 boolean isServiceEnabled()
          This is a accessor method that will allow the framework to determine whether or not it should route invocations to the object.
 void setServiceAvailability(ServiceAvailability availabilityState)
          This is a request to set the availability flag to the given value, which will tell the framework that this implementation is now ready to accept calls.
 String toString()
          Each service should be able to deliver a useful service summary in string form.
 

Method Detail

setServiceAvailability

void setServiceAvailability(ServiceAvailability availabilityState)
This is a request to set the availability flag to the given value, which will tell the framework that this implementation is now ready to accept calls.

Parameters:
availabilityState - The ServiceAvailability state that is requested.

getServiceAvailability

ServiceAvailability getServiceAvailability()
This is a request to set the availability flag to false, which will tell the framework that this implementation is not ready to accept calls.

Returns:
Returns the current state.

isServiceEnabled

boolean isServiceEnabled()
This is a accessor method that will allow the framework to determine whether or not it should route invocations to the object.

Returns:
Returns the boolean result of the question of whether the state is ServiceAvailability.AVAILABLE

getVersionedProviderImplementationName

VersionedProviderImplementationName getVersionedProviderImplementationName()
Service implementations are versioned, and therefore must provide an appropriate object that allows the framework to discriminate between different versions of the same service class. Here, we make it easy to get a versioned key in cases where you already have the impl object.

Returns:
Returns a key that uniquely identifies a service implementation by name and version.

getVersion

String getVersion()
A managed implementation will have a version associated with it. The implementation class can use any mechanism they see fit but we want to be able to acquire the implementation's version identifier at runtime. This, along with the fully-qualified class name should serve to indentify this implementation class. Implementation versions are strings because there is no suggestion that must be a number.

Returns:
Returns a string the represents this implementation's current version.

toString

String toString()
Each service should be able to deliver a useful service summary in string form.

Overrides:
toString in class Object
Returns:
Returns the object in a descriptive string format.


Copyright © 2010. All Rights Reserved.