flex.messaging
Class Destination

java.lang.Object
  extended by flex.management.ManageableComponent
      extended by flex.messaging.Destination
All Implemented Interfaces:
Manageable, FlexComponent, FlexConfigurable, Serializable
Direct Known Subclasses:
FactoryDestination, HTTPProxyDestination

public class Destination
extends ManageableComponent
implements Serializable

The Destination class is a source and sink for messages sent through a service destination and uses an adapter to process messages.

See Also:
Serialized Form

Field Summary
static String LOG_CATEGORY
          Default log category for Destination.
 
Constructor Summary
Destination()
          Constructs an unmanaged Destination instance.
Destination(boolean enableManagement)
          Constructs a Destination with the indicated management.
 
Method Summary
 void addChannel(String id)
          Adds a channel to the list of channels known by the Destination.
 ServiceAdapter createAdapter(String id)
          Creates a ServiceAdapter instance, sets its id, sets it manageable if the Destination that created it is manageable, and set its Destination to the Destination that created it.
 ConfigMap describeDestination()
          Returns a ConfigMap of destination properties that the client needs.
 ServiceAdapter getAdapter()
          Returns the ServiceAdapter for the Destination.
 List getChannels()
          Returns the list of channel ids of the Destination.
 NetworkSettings getNetworkSettings()
          Get the NetworkSettings of the Destination.
 flex.messaging.config.SecurityConstraint getSecurityConstraint()
          Returns the SecurityConstraint of the Destination.
 Service getService()
          Returns the Service managing this Destination.
 String getServiceType()
          Returns the Java class name for the Service managing this Destination.
 void initialize(String id, ConfigMap properties)
          Initializes the Destination with the properties.
 boolean isBackendShared()
          The destination may be not clustered at all, may be clustered for channel failover and destination sharing, or it may be clustered for channel failover and also have a common backend, such as a common database or backend clustered JMS topic.
 boolean isClustered()
          The destination may be not clustered at all, may be clustered for channel failover only, or it may be clustered for channel failover and also have shared back ends.
 boolean removeChannel(String id)
          Removes the channel from the list of channels for the Destination.
 void setAdapter(ServiceAdapter adapter)
          Sets the ServiceAdapter of the Destination.
 void setChannels(List ids)
          Sets the channel list of the Destination.
 void setId(String id)
          Sets the id of the Destination.
 void setNetworkSettings(NetworkSettings networkSettings)
          Set the NetworkSettings of the Destination.
 void setSecurityConstraint(flex.messaging.config.SecurityConstraint securityConstraint)
          Sets the SecurityConstraint of the Destination.
 void setSecurityConstraint(String ref)
          Sets the SecurityConstraint reference of the Destination.
 void setService(Service service)
          Sets the Service managing this Destination.
 void start()
          Starts the destination if its associated Service is started and if the destination is not already running.
 void stop()
          The default implementation of this method stops all of the adapters of the destination.
 
Methods inherited from class flex.management.ManageableComponent
getControl, getId, getParent, isManaged, isStarted, isValid, setControl, setManaged, setParent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_CATEGORY

public static final String LOG_CATEGORY
Default log category for Destination.

See Also:
Constant Field Values
Constructor Detail

Destination

public Destination()
Constructs an unmanaged Destination instance.


Destination

public Destination(boolean enableManagement)
Constructs a Destination with the indicated management.

Parameters:
enableManagement - true if the Destination is manageable; otherwise false.
Method Detail

initialize

public void initialize(String id,
                       ConfigMap properties)
Initializes the Destination with the properties. If subclasses override, they must call super.initialize().

Specified by:
initialize in interface FlexConfigurable
Overrides:
initialize in class ManageableComponent
Parameters:
properties - Properties for the Destination.
id - Id of the ManageableComponent.

start

public void start()
Starts the destination if its associated Service is started and if the destination is not already running. The default implementation of this method starts the adapter of the destination. If subclasses override, they must call super.start().

Specified by:
start in interface FlexComponent
Overrides:
start in class ManageableComponent

stop

public void stop()
The default implementation of this method stops all of the adapters of the destination. If subclasses override, they must call super.stop().

Specified by:
stop in interface FlexComponent
Overrides:
stop in class ManageableComponent

getAdapter

public ServiceAdapter getAdapter()
Returns the ServiceAdapter for the Destination.

Returns:
The ServiceAdapter for the Destination.

createAdapter

public ServiceAdapter createAdapter(String id)
Creates a ServiceAdapter instance, sets its id, sets it manageable if the Destination that created it is manageable, and set its Destination to the Destination that created it. In order to use this method, Destination should have an assigned Service and the id provided for the adapter should already be registered with the Service.

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

setAdapter

public void setAdapter(ServiceAdapter adapter)
Sets the ServiceAdapter of the Destination. ServiceAdapter needs to be started if the Destination is already running.

Parameters:
adapter -

isBackendShared

public boolean isBackendShared()
The destination may be not clustered at all, may be clustered for channel failover and destination sharing, or it may be clustered for channel failover and also have a common backend, such as a common database or backend clustered JMS topic. If the destination is clustered and has a common backend to coordinate the cluster, this method returns true; otherwise it return false. Note that this method returns false if the Destination is not runnning.

Returns:
true if the clustered Destination shares a common backend; otherwise false.

getChannels

public List getChannels()
Returns the list of channel ids of the Destination.


addChannel

public void addChannel(String id)
Adds a channel to the list of channels known by the Destination. MessageBroker has to know the channel. Otherwise, the channel is not added to the list.

Parameters:
id - The id of the channel.

removeChannel

public boolean removeChannel(String id)
Removes the channel from the list of channels for the Destination.

Parameters:
id - The id of the channel.
Returns:
true if the list contained the channel id.

setChannels

public void setChannels(List ids)
Sets the channel list of the Destination. MessageBroker has to know the channels, otherwise they are not added to the list.

Parameters:
ids - List of channel ids.

isClustered

public boolean isClustered()
The destination may be not clustered at all, may be clustered for channel failover only, or it may be clustered for channel failover and also have shared back ends. If the destination is clustered, regardless of whether or not it relies on a shared back end for cluster configuration, this method returns true. Note that this method returns false if the Destination is not runnning.

Returns:
true if the Destination is clustered; otherwise false.

setId

public void setId(String id)
Sets the id of the Destination. If the Destination has a Service assigned, it also updates the id in the Service.

Overrides:
setId in class ManageableComponent
Parameters:
id - The id of the ManageableComponent.

getNetworkSettings

public NetworkSettings getNetworkSettings()
Get the NetworkSettings of the Destination.

Returns:
The NetworkSettings of the Destination.

setNetworkSettings

public void setNetworkSettings(NetworkSettings networkSettings)
Set the NetworkSettings of the Destination.

Parameters:
networkSettings - The NetworkSettings of the Destination.

getService

public Service getService()
Returns the Service managing this Destination.

Returns:
The Service managing this Destination.

setService

public void setService(Service service)
Sets the Service managing this Destination. Removes the Destination from the old service (if there was one) and adds to the list of destination in the new service.

Parameters:
service - The Service managing this Destination.

getServiceType

public String getServiceType()
Returns the Java class name for the Service managing this Destination. Returns null if there is no Service assigned to the Destination yet.

Returns:
The Java class name for the Service manageing this Destination.

getSecurityConstraint

public flex.messaging.config.SecurityConstraint getSecurityConstraint()
Returns the SecurityConstraint of the Destination. SecurityConstraint is constructed as the Destination starts up. Therefore, this could return null even if the SecurityConstraint reference is set but Destination is not started yet.


setSecurityConstraint

public void setSecurityConstraint(flex.messaging.config.SecurityConstraint securityConstraint)
Sets the SecurityConstraint of the Destination.

Parameters:
securityConstraint -

setSecurityConstraint

public void setSecurityConstraint(String ref)
Sets the SecurityConstraint reference of the Destination. MessageBroker has to know the SecurityConstraint reference. Note that getSecurityConstraint can return null if the reference is set but the Destination is not started yet.

Parameters:
ref - SecurityConstraint reference.

describeDestination

public ConfigMap describeDestination()
Returns a ConfigMap of destination properties that the client needs. By default, it returns a ConfigMap of destination id under "id" key and channel ids that the destination uses under "channels" key. Subclasses should add additional properties to super.describeDestination, or return null if they don't want their properties to be sent to the client.



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/Destination.html