|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectflex.management.ManageableComponent
flex.messaging.services.AbstractService
public abstract class AbstractService
This is the default implementation of Service, which provides a
convenient base for behavior and associations common to all Services.
| Field Summary | |
|---|---|
static String |
LOG_CATEGORY
Log category for AbstractService. |
static String |
LOG_CATEGORY_STARTUP_DESTINATION
Log category that captures startup information for service's destinations. |
| Constructor Summary | |
|---|---|
AbstractService()
Constructs an unmanaged AbstractService. |
|
AbstractService(boolean enableManagement)
Constructs an AbstractService with the indicated management. |
|
| Method Summary | |
|---|---|
void |
addDefaultChannel(String id)
Adds the channel to the list of channels of the AbstractService. |
void |
addDestination(Destination destination)
Adds the Destination instance to the list of destinations
known by the AbstractService. |
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. |
ConfigMap |
describeService(Endpoint endpoint)
Returns a ConfigMap service properties that the client needs. |
String |
getDefaultAdapter()
Returns the id of the default adapter of the AbstractService. |
List |
getDefaultChannels()
Returns the list of channel ids of the AbstractService. |
Destination |
getDestination(Message message)
Returns the Destination that the Message targets. |
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. |
MessageBroker |
getMessageBroker()
Returns the MessageBroker of the AbstractService. |
Map |
getRegisteredAdapters()
Returns the adapters registered with the AbstractService. |
String |
registerAdapter(String id,
String adapterClass)
Registers the adapter with the AbstractService. |
boolean |
removeDefaultChannel(String id)
Removes the channel from the list of channels for the AbstractService. |
Destination |
removeDestination(String id)
Removes the Destination from the list of destinations known
by the AbstractService. |
Object |
serviceCommand(CommandMessage message)
Handles a command routed to the service by the MessageBroker. |
abstract Object |
serviceMessage(Message message)
Processes messages by invoking the requested destination's adapter. |
void |
setDefaultAdapter(String id)
Sets the default adapter of the AbstractService. |
void |
setDefaultChannels(List ids)
Sets the channel list of the AbstractService. |
void |
setId(String id)
Sets the id of the AbstractService. |
void |
setMessageBroker(MessageBroker broker)
Sets the MessageBroker of the AbstractService. |
void |
start()
Starts the service if its associated MessageBroker is started. |
void |
stop()
The default implementation of this method stops all of the destinations of the service. |
String |
unregisterAdapter(String id)
Unregistered the adapter with the AbstractService and
set the default adapter to null if needed. |
| Methods inherited from class flex.management.ManageableComponent |
|---|
getControl, getId, getParent, initialize, isManaged, isStarted, isValid, setControl, setManaged, setParent |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface flex.messaging.services.Service |
|---|
getId |
| Methods inherited from interface flex.management.Manageable |
|---|
getControl, isManaged, setControl, setManaged |
| Methods inherited from interface flex.messaging.FlexComponent |
|---|
isStarted |
| Methods inherited from interface flex.messaging.FlexConfigurable |
|---|
initialize |
| Field Detail |
|---|
public static final String LOG_CATEGORY
AbstractService.
public static final String LOG_CATEGORY_STARTUP_DESTINATION
| Constructor Detail |
|---|
public AbstractService()
AbstractService.
public AbstractService(boolean enableManagement)
AbstractService with the indicated management.
enableManagement - true if the AbstractService
is manageable; otherwise false.| Method Detail |
|---|
public void start()
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().
start in interface FlexComponentstart in class ManageableComponentpublic void stop()
super.stop().
stop in interface FlexComponentstop in class ManageableComponentpublic Map getRegisteredAdapters()
AbstractService.
getRegisteredAdapters in interface Service
public String registerAdapter(String id,
String adapterClass)
AbstractService.
registerAdapter in interface Serviceid - The id of the adapter.adapterClass - The class of the adapter.
public String unregisterAdapter(String id)
AbstractService and
set the default adapter to null if needed.
unregisterAdapter in interface Serviceid - The id of the adapter.
public String getDefaultAdapter()
AbstractService.
getDefaultAdapter in interface ServiceAbstractService.public void setDefaultAdapter(String id)
AbstractService.
setDefaultAdapter in interface Serviceid - The id of the default adapter.public List getDefaultChannels()
AbstractService.
getDefaultChannels in interface ServiceService.public void addDefaultChannel(String id)
AbstractService.
MessageBroker has to know the channel. Otherwise, the channel
is not added to the list.
addDefaultChannel in interface Serviceid - The id of the channel.public void setDefaultChannels(List ids)
AbstractService.
MessageBroker has to know the channels, otherwise they
are not added to the list.
setDefaultChannels in interface Serviceids - List of channel ids.public boolean removeDefaultChannel(String id)
AbstractService.
removeDefaultChannel in interface Serviceid - The id of the channel.
true if the list contained the channel id.public Destination getDestination(Message message)
Destination that the Message targets.
getDestination in interface Servicemessage - The message.
Destination that the Message targets.
MessageException - if no such Destination exists.public Destination getDestination(String id)
Destination with the specified id or null if no
Destination with id exists.
getDestination in interface Serviceid - The id of the Destination.
Destination with the specified id or null.public Map getDestinations()
Destination ids and instances.
getDestinations in interface ServiceDestination ids and instances.public Destination createDestination(String id)
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.
createDestination in interface Serviceid - The id of the Destination.
Destination instanced created.public void addDestination(Destination destination)
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.
addDestination in interface Servicedestination - The Destination instance to be added.public Destination removeDestination(String id)
Destination from the list of destinations known
by the AbstractService.
removeDestination in interface Serviceid - The id of the Destination.
Destination associated with the id.public void setId(String id)
AbstractService. If the AbstractService
has a MessageBroker assigned, it also updates the id in the
MessageBroker.
setId in interface ServicesetId in class ManageableComponentid - The id of the ManageableComponent.public MessageBroker getMessageBroker()
MessageBroker of the AbstractService.
getMessageBroker in interface ServiceAbstractService.public void setMessageBroker(MessageBroker broker)
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.
setMessageBroker in interface Servicebroker - MessageBroker of the AbstractService.public ConfigMap describeService(Endpoint endpoint)
ConfigMap service properties that the client needs.
By default, it returns null. Subclasses can override to return properties
relevant to their implementation.
describeService in interface Serviceendpoint - Endpoint used to filter the destinations of the service.
public abstract Object serviceMessage(Message message)
serviceMessage in interface Servicemessage - The message sent by the MessageBroker.
public Object serviceCommand(CommandMessage message)
Service
serviceCommand in interface Servicemessage - The message sent by the MessageBroker.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/blazeds/1/javadoc/flex/messaging/services/AbstractService.html