Packageflex.messaging.services
Classpublic class AbstractService
InheritanceAbstractService Inheritance ManageableComponent

This is the default implementation of Service, which provides a convenient base for behavior and associations common to all Services.



Public Methods
 MethodDefined By
  
Constructs an unmanaged AbstractService.
AbstractService
  
AbstractService(boolean enableManagement)
Constructs an AbstractService with the indicated management.
AbstractService
  
void addDefaultChannel(String id)
Adds the channel to the list of channels of the AbstractService.
AbstractService
  
void addDestination(Destination destination)
Adds the Destination instance to the list of destinations known by the AbstractService.
AbstractService
  
Creates a Destination instance, sets its id, sets it manageable if the AbstractService that created it is manageable, and sets its Service to the AbstractService that created it.
AbstractService
  
Returns a ConfigMap service properties that the client needs.
AbstractService
 Inherited
  
Returns the id of the default adapter of the AbstractService.
AbstractService
  
Returns the list of channel ids of the AbstractService.
AbstractService
  
Returns the Destination that the Message targets.
AbstractService
  
Returns the Destination with the specified id or null if no Destination with id exists.
AbstractService
  
Returns the Map of Destination ids and instances.
AbstractService
 Inherited
String getId()
Returns the id of the ManageableComponent.
  
Returns the MessageBroker of the AbstractService.
AbstractService
 Inherited
Returns the parent of the component.
  
Returns the adapters registered with the AbstractService.
AbstractService
 Inherited
void initialize(String id, ConfigMap properties)
Invoked to initialize the ManageableComponent.
 Inherited
boolean isManaged()
 Inherited
boolean isStarted()
Returns if the component is started or not.
 Inherited
boolean isValid()
Returns if the component is valid.
  
String registerAdapter(String id, String adapterClass)
Registers the adapter with the AbstractService.
AbstractService
  
boolean removeDefaultChannel(String id)
Removes the channel from the list of channels for the AbstractService.
AbstractService
  
Removes the Destination from the list of destinations known by the AbstractService.
AbstractService
  
AbstractService
  
Object serviceMessage(Message message)
Processes messages by invoking the requested destination's adapter.
AbstractService
 Inherited
void setControl(BaseControl control)
  
void setDefaultAdapter(String id)
Sets the default adapter of the AbstractService.
AbstractService
  
void setDefaultChannels(List ids)
Sets the channel list of the AbstractService.
AbstractService
  
void setId(String id)
Sets the id of the AbstractService.
AbstractService
 Inherited
void setManaged(boolean enableManagement)
Enables or disables management for the component.
  
Sets the MessageBroker of the AbstractService.
AbstractService
 Inherited
void setParent(Manageable parent)
Sets the parent of the component.
  
void start()
Starts the service if its associated MessageBroker is started.
AbstractService
  
void stop()
The default implementation of this method stops all of the destinations of the service.
AbstractService
  
String unregisterAdapter(String id)
Unregistered the adapter with the AbstractService and set the default adapter to null if needed.
AbstractService
Public Constants
 ConstantDefined By
  LOG_CATEGORY
[static] Log category for AbstractService.
AbstractService
  LOG_CATEGORY_STARTUP_DESTINATION
[static] Log category that captures startup information for service's destinations.
AbstractService
Constructor Detail
AbstractService()
public AbstractService()

Constructs an unmanaged AbstractService.

AbstractService() 
public AbstractService(boolean enableManagement)

Constructs an AbstractService with the indicated management.

Parameters
enableManagementtrue if the AbstractService is manageable; otherwise false.
Method Detail
addDefaultChannel()
public void addDefaultChannel(String id)

Adds the channel to the list of channels of the AbstractService. MessageBroker has to know the channel. Otherwise, the channel is not added to the list.

Parameters

id — The id of the channel.

addDestination() 
public void addDestination(Destination destination)

Adds the Destination instance to the list of destinations known by the AbstractService. It also sets destination's service to this AbstractService instance. Note that Destination cannot be null, it cannot have a null id, and it cannot have an id of a Destination already registered with the AbstractService. Destination needs to be started if the AbstractService is already running.

Parameters

destination — The Destination instance to be added.

createDestination() 
public Destination createDestination(String id)

Creates a Destination instance, sets its id, sets it manageable if the AbstractService that created it is manageable, and sets its Service to the AbstractService that created it.

Parameters

id — The id of the Destination.

Returns
The Destination instanced created.
describeService() 
public ConfigMap describeService(Endpoint endpoint)

Returns a ConfigMap service properties that the client needs. By default, it returns null. Subclasses can override to return properties relevant to their implementation.

Parameters

endpoint — Endpoint used to filter the destinations of the service.

Returns
ConfigMap of service properties.
getDefaultAdapter() 
public String getDefaultAdapter()

Returns the id of the default adapter of the AbstractService.

Returns
defaultAdapterId The id of the default adapter of the AbstractService.
getDefaultChannels() 
public List getDefaultChannels()

Returns the list of channel ids of the AbstractService.

Returns
getDestination() 
public Destination getDestination(Message message)

Returns the Destination that the Message targets.

Parameters

message

Returns
The Destination that the Message targets.

Throws
MessageException — if no such Destination exists.
getDestination() 
public Destination getDestination(String id)

Returns the Destination with the specified id or null if no Destination with id exists.

Parameters

id — The id of the Destination.

Returns
getDestinations() 
public Map getDestinations()

Returns the Map of Destination ids and instances.

Returns
The Map of Destination ids and instances.
getMessageBroker() 
public MessageBroker getMessageBroker()

Returns the MessageBroker of the AbstractService.

Returns
MessageBroker of the AbstractService.
getRegisteredAdapters() 
public Map getRegisteredAdapters()

Returns the adapters registered with the AbstractService.

Returns
The Map of adapter id and classes.
registerAdapter() 
public String registerAdapter(String id, String adapterClass)

Registers the adapter with the AbstractService.

Parameters

id — The id of the adapter.
 
adapterClass — The class of the adapter.

Returns
The previous adapter class that the id was associated with.
removeDefaultChannel() 
public boolean removeDefaultChannel(String id)

Removes the channel from the list of channels for the AbstractService.

Parameters

id — The id of the channel.

Returns
true if the list contained the channel id.
removeDestination() 
public Destination removeDestination(String id)

Removes the Destination from the list of destinations known by the AbstractService.

Parameters

id — The id of the Destination.

Returns
Previous Destination associated with the id.
serviceCommand() 
public Object serviceCommand(CommandMessage message)

Parameters

message

Returns
serviceMessage() 
public Object serviceMessage(Message message)

Processes messages by invoking the requested destination's adapter. Subclasses should provide their implementation.

Parameters

message

Returns
setDefaultAdapter() 
public void setDefaultAdapter(String id)

Sets the default adapter of the AbstractService.

Parameters

id — The id of the default adapter.

setDefaultChannels() 
public void setDefaultChannels(List ids)

Sets the channel list of the AbstractService. MessageBroker has to know the channels, otherwise they are not added to the list.

Parameters

ids — List of channel ids.

setId() 
public void setId(String id)

Sets the id of the AbstractService. If the AbstractService has a MessageBroker assigned, it also updates the id in the MessageBroker.

Parameters

id

setMessageBroker() 
public void setMessageBroker(MessageBroker broker)

Sets the MessageBroker of the AbstractService. Removes the AbstractService from the old broker (if there was one) and adds to the list of services in the new broker.

Parameters

brokerMessageBroker of the AbstractService.

start() 
public void start()

Starts the service if its associated MessageBroker is started. and if the service is not already running. The default implementation of this method starts all of the destinations of the service. If subclasses override, they must call super.start().

stop() 
public void stop()

The default implementation of this method stops all of the destinations of the service. If subclasses override, they must call super.stop().

unregisterAdapter() 
public String unregisterAdapter(String id)

Unregistered the adapter with the AbstractService and set the default adapter to null if needed.

Parameters

id — The id of the adapter.

Returns
The adapter class that the id was associated with.
Constant Detail
LOG_CATEGORYConstant
public static final LOG_CATEGORY

Log category for AbstractService.

LOG_CATEGORY_STARTUP_DESTINATIONConstant 
public static final LOG_CATEGORY_STARTUP_DESTINATION

Log category that captures startup information for service's destinations.





 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/javadoc/flex/messaging/services/AbstractService.html