flex.messaging.services
Interface Service

All Superinterfaces:
FlexComponent, FlexConfigurable, Manageable
All Known Implementing Classes:
AbstractBootstrapService, AbstractService, DataService, HTTPProxyService, MessageService, RemotingService

public interface Service
extends Manageable, FlexComponent

The MessageBroker has endpoints on one end and services on the other. The Service interface defines the contract between the MessageBroker and all Service implementations.


Method Summary
 void addDefaultChannel(String id)
          Adds the channel to the list of channels of the Service.
 void addDestination(Destination destination)
          Adds the Destination to the Service.
 Destination createDestination(String id)
          Creates a Destination instance, sets its id, sets it manageable if the Service that created it is manageable, and sets its Service to the Service that created it.
 ConfigMap describeService(Endpoint endpoint)
          Describes the service for the client.
 String getDefaultAdapter()
          Returns the id of the default adapter of the Service.
 List getDefaultChannels()
          Returns the list of channel ids of the Service.
 Destination getDestination(Message message)
          Retrieves the destination in this service for which the given message is intended.
 Destination getDestination(String id)
          Returns the Destination with the specified id or null if no Destination with id exists.
 Map getDestinations()
          Returns the Map of Destination ids and instances.
 String getId()
          Returns the id for the service.
 MessageBroker getMessageBroker()
          All services must be managed by a single MessageBroker, and must be capable of returning a reference to that broker.
 Map getRegisteredAdapters()
          Returns the adapters registered with the Service.
 String registerAdapter(String id, String className)
          Registers the adapter with the Service.
 boolean removeDefaultChannel(String id)
          Removes the channel from the list of channels for the AbstractService.
 Destination removeDestination(String id)
          Remove the Destination from the Service.
 Object serviceCommand(CommandMessage message)
          Handles a command routed to the service by the MessageBroker.
 Object serviceMessage(Message message)
          Handles a message routed to the service by the MessageBroker.
 void setDefaultAdapter(String id)
          Sets the id of the default adapter of the Service.
 void setDefaultChannels(List ids)
          Sets the channel list of the Service.
 void setId(String id)
          Sets the id for the service.
 void setMessageBroker(MessageBroker broker)
          Sets the MessageBroker of the Service.
 String unregisterAdapter(String id)
          Unregistered the adapter with the Service and set the default adapter to null if needed.
 
Methods inherited from interface flex.management.Manageable
getControl, isManaged, setControl, setManaged
 
Methods inherited from interface flex.messaging.FlexComponent
isStarted, start, stop
 
Methods inherited from interface flex.messaging.FlexConfigurable
initialize
 

Method Detail

getRegisteredAdapters

Map getRegisteredAdapters()
Returns the adapters registered with the Service.

Returns:
The Map of adapter id and classes.

registerAdapter

String registerAdapter(String id,
                       String className)
Registers the adapter with the Service.

Parameters:
id - The id of the adapter.
adapterClass - The class of the adapter.
Returns:
The previous adapter class that the id was associated with.

unregisterAdapter

String unregisterAdapter(String id)
Unregistered the adapter with the Service 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.

getDefaultAdapter

String getDefaultAdapter()
Returns the id of the default adapter of the Service.

Returns:
The id of the default adapter of the Service.

setDefaultAdapter

void setDefaultAdapter(String id)
Sets the id of the default adapter of the Service.

Parameters:
id - The id of the default adapter of the Service.

getDefaultChannels

List getDefaultChannels()
Returns the list of channel ids of the Service.


addDefaultChannel

void addDefaultChannel(String id)
Adds the channel to the list of channels of the Service. MessageBroker has to know the channel. Otherwise, the channel should not added to the list.

Parameters:
id - The id of the channel.

setDefaultChannels

void setDefaultChannels(List ids)
Sets the channel list of the Service. MessageBroker has to know the channels, otherwise they should not be added to the list.

Parameters:
ids - List of channel ids.

removeDefaultChannel

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.

getDestination

Destination getDestination(Message message)
Retrieves the destination in this service for which the given message is intended.


getDestination

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.

getDestinations

Map getDestinations()
Returns the Map of Destination ids and instances.

Returns:
The Map of Destination ids and instances.

createDestination

Destination createDestination(String id)
Creates a Destination instance, sets its id, sets it manageable if the Service that created it is manageable, and sets its Service to the Service that created it.

Parameters:
id - The id of the Destination.
Returns:
The Destination instanced created.

addDestination

void addDestination(Destination destination)
Adds the Destination to the Service.

Parameters:
destination - The Destination to be added.

removeDestination

Destination removeDestination(String id)
Remove the Destination from the Service.

Parameters:
id - The id of the Destination.
Returns:
Previous Destination associated with the id.

getId

String getId()
Returns the id for the service.

Returns:
The id for the service.

setId

void setId(String id)
Sets the id for the service.

Parameters:
id - The id for the service.

getMessageBroker

MessageBroker getMessageBroker()
All services must be managed by a single MessageBroker, and must be capable of returning a reference to that broker. This broker is used when a service wishes to push a message to one or more endpoints managed by the broker.

Returns:
broker The MessageBroker instance which manages this service

setMessageBroker

void setMessageBroker(MessageBroker broker)
Sets the MessageBroker of the Service.

Parameters:
broker - The MessageBroker of the Service.

describeService

ConfigMap describeService(Endpoint endpoint)
Describes the service for the client.

Parameters:
endpoint - Endpoint used to filter the service destinations.
Returns:
ConfigMap of service properties.

serviceMessage

Object serviceMessage(Message message)
Handles a message routed to the service by the MessageBroker.

Parameters:
message - The message sent by the MessageBroker

serviceCommand

Object serviceCommand(CommandMessage message)
Handles a command routed to the service by the MessageBroker. Usually these are commands sent by one of the endpoints.

Parameters:
message - The message sent by the MessageBroker


Copyright © 2007 Adobe Systems Inc. All Rights Reserved.

 

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

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/lcdsjavadoc/flex/messaging/services/Service.html