flex.messaging
Class MessageClient

java.lang.Object
  extended by flex.messaging.MessageClient
All Implemented Interfaces:
flex.messaging.util.TimeoutCapable, Serializable

public class MessageClient
extends Object
implements Serializable, flex.messaging.util.TimeoutCapable

Represents a client-side MessageAgent instance. Currently a server-side MessageClient is only created if its client-side counterpart has subscribed to a destination for pushed data (e.g. Consumer). Client-side Producers do not result in the creation of corresponding server-side MessageClient instances. Client-side MessageAgents communicate with the server over a Channel that corresponds to a FlexSession. Server-side MessageClient instances are always created in the context of a FlexSession and when the FlexSession is invalidated any associated MessageClients are invalidated as well. MessageClients may also be timed out on a per-destination basis and this is based on subscription inactivity. If no messages are pushed to the MessageClient within the destination's subscription timeout period the MessageClient will be shutdown even if the associated FlexSession is still active and connected. Per-destination subscription timeout is an optional configuration setting, and should only be used when inactive subscriptions should be shut down opportunistically to preserve server resources.

See Also:
Serialized Form

Field Summary
static String MESSAGE_CLIENT_LOG_CATEGORY
          Log category for MessageClient related messages.
 
Method Summary
static void addMessageClientCreatedListener(MessageClientListener listener)
          Adds a MessageClient created listener.
 void addMessageClientDestroyedListener(MessageClientListener listener)
          Adds a MessageClient destroy listener.
 Object getClientId()
          Returns the clientId for the MessageClient.
 String getDestinationId()
          Returns the destination the MessageClient is subscribed to.
 String getEndpointId()
          Returns the Id for the endpoint the MessageClient subscription was created over.
 FlexClient getFlexClient()
          Returns the FlexClient associated with this MessageClient.
 FlexSession getFlexSession()
          Returns the FlexSession associated with this MessageClient.
 void invalidate()
          Invalidates the MessageClient.
 boolean isValid()
          Returns true if the MessageClient is valid; false if it has been invalidated.
static void removeMessageClientCreatedListener(MessageClientListener listener)
          Removes a MessageClient created listener.
 void removeMessageClientDestroyedListener(MessageClientListener listener)
          Removes a MessageClient destroyed listener.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface flex.messaging.util.TimeoutCapable
cancelTimeout, getLastUse, getTimeoutPeriod, setTimeoutFuture, timeout
 

Field Detail

MESSAGE_CLIENT_LOG_CATEGORY

public static final String MESSAGE_CLIENT_LOG_CATEGORY
Log category for MessageClient related messages.

See Also:
Constant Field Values
Method Detail

addMessageClientCreatedListener

public static void addMessageClientCreatedListener(MessageClientListener listener)
Adds a MessageClient created listener.

Parameters:
listener - The listener to add.
See Also:
MessageClientListener

removeMessageClientCreatedListener

public static void removeMessageClientCreatedListener(MessageClientListener listener)
Removes a MessageClient created listener.

Parameters:
listener - The listener to remove.
See Also:
MessageClientListener

getClientId

public Object getClientId()
Returns the clientId for the MessageClient.

Returns:
The clientId for the MessageClient.

getDestinationId

public String getDestinationId()
Returns the destination the MessageClient is subscribed to.

Returns:
The destination the MessageClient is subscribed to.

getEndpointId

public String getEndpointId()
Returns the Id for the endpoint the MessageClient subscription was created over.

Returns:
The Id for the endpoint the MessageClient subscription was created over.

getFlexClient

public FlexClient getFlexClient()
Returns the FlexClient associated with this MessageClient.

Returns:
The FlexClient assocaited with this MessageClient.

getFlexSession

public FlexSession getFlexSession()
Returns the FlexSession associated with this MessageClient.

Returns:
The FlexSession associated with this MessageClient.

addMessageClientDestroyedListener

public void addMessageClientDestroyedListener(MessageClientListener listener)
Adds a MessageClient destroy listener.

Parameters:
listener - The listener to add.
See Also:
MessageClientListener

removeMessageClientDestroyedListener

public void removeMessageClientDestroyedListener(MessageClientListener listener)
Removes a MessageClient destroyed listener.

Parameters:
listener - The listener to remove.
See Also:
flex.messaging.client.MessageClientListener

isValid

public boolean isValid()
Returns true if the MessageClient is valid; false if it has been invalidated.

Returns:
true if the MessageClient is valid; otherwise false.

invalidate

public void invalidate()
Invalidates the MessageClient.



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