flex.messaging.endpoints
Class BasePollingHTTPEndpoint

java.lang.Object
  extended by flex.management.ManageableComponent
      extended by flex.messaging.endpoints.AbstractEndpoint
          extended by flex.messaging.endpoints.BaseHTTPEndpoint
              extended by flex.messaging.endpoints.BasePollingHTTPEndpoint
All Implemented Interfaces:
Manageable, PollWaitListener, Endpoint, Endpoint2, FlexComponent, FlexConfigurable
Direct Known Subclasses:
AMFEndpoint, HTTPEndpoint

public abstract class BasePollingHTTPEndpoint
extends BaseHTTPEndpoint
implements PollWaitListener

Base for HTTP-based endpoints that support regular polling and long polling which means placing request threads that are polling for messages into a wait state until messages are available to deliver or the configurable wait interval is reached.


Field Summary
 
Fields inherited from class flex.messaging.endpoints.AbstractEndpoint
LOG_CATEGORY
 
Constructor Summary
BasePollingHTTPEndpoint()
          Constructs an unmanaged BasePollingHTTPEndpoint.
BasePollingHTTPEndpoint(boolean enableManagement)
          Constructs an BasePollingHTTPEndpoint with the indicated management.
 
Method Summary
 int getClientWaitInterval()
          Returns the number of milliseconds the client will wait after receiving a response for a poll with server wait before it issues its next poll request.
 int getMaxWaitingPollRequests()
          Returns the maximum number of server poll response threads that will be waiting for messages to arrive for clients.
 long getWaitInterval()
          Returns the number of milliseconds the server poll response thread will be waiting for messages to arrive for the client.
 void initialize(String id, ConfigMap properties)
          Initializes the Endpoint with the properties.
 void setClientWaitInterval(int value)
          Sets the number of milliseconds a client will wait after receiving a response for a poll with server wait before it issues its next poll request.
 void setMaxWaitingPollRequests(int maxWaitingPollRequests)
          Sets the maximum number of server poll response threads that will be waiting for messages to arrive for clients.
 void setWaitInterval(long waitInterval)
          Sets the number of milliseconds the server poll response thread will be waiting for messages to arrive for the client.
 void start()
          Sets up monitoring of waited poll requests so they can be notified and exit when the endpoint stops.
 void stop()
          Ensures that no poll requests in a wait state are left un-notified when the endpoint stops.
 void waitEnd(Object notifier)
          Hook method invoked directly after a wait completes.
 void waitStart(Object notifier)
          Hook method invoked directly before a wait begins.
 
Methods inherited from class flex.messaging.endpoints.BaseHTTPEndpoint
getRedirectURL, isAddNoCacheHeaders, isInvalidateSessionOnDisconnect, service, setAddNoCacheHeaders, setInvalidateSessionOnDisconnect, setRedirectURL, setupFlexClient
 
Methods inherited from class flex.messaging.endpoints.AbstractEndpoint
describeEndpoint, getClientType, getFlexClientOutboundQueueProcessorClass, getFlexClientOutboundQueueProcessorConfig, getMessageBroker, getMessagingVersion, getPort, getSecurityConstraint, getSerializationContext, getServer, getTypeMarshaller, getUrl, isSecure, serviceMessage, setClientType, setFlexClientOutboundQueueProcessorClass, setFlexClientOutboundQueueProcessorConfig, setId, setMessageBroker, setSecurityConstraint, setSerializationContext, setServer, setTypeMarshaller, setupFlexClient, setUrl
 
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
 
Methods inherited from interface flex.messaging.endpoints.Endpoint
getId, isStarted
 
Methods inherited from interface flex.management.Manageable
getControl, isManaged, setControl, setManaged
 

Constructor Detail

BasePollingHTTPEndpoint

public BasePollingHTTPEndpoint()
Constructs an unmanaged BasePollingHTTPEndpoint.


BasePollingHTTPEndpoint

public BasePollingHTTPEndpoint(boolean enableManagement)
Constructs an BasePollingHTTPEndpoint with the indicated management.

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

initialize

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

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

getClientWaitInterval

public int getClientWaitInterval()
Returns the number of milliseconds the client will wait after receiving a response for a poll with server wait before it issues its next poll request. A value of zero or less causes the client to use its default polling interval (based on the channel's polling-interval-millis configuration) and this value is ignored. A value greater than zero will cause the client to wait for the specified interval before issuing its next poll request with a value of 1 triggering an immediate poll from the client as soon as a waited poll response is received.


setClientWaitInterval

public void setClientWaitInterval(int value)
Sets the number of milliseconds a client will wait after receiving a response for a poll with server wait before it issues its next poll request. A value of zero or less causes the client to use its default polling interval (based on the channel's polling-interval-millis configuration) and this value is ignored. A value greater than zero will cause the client to wait for the specified interval before issuing its next poll request with a value of 1 triggering an immediate poll from the client as soon as a waited poll response is received. This property does not effect polling clients that poll the server without a server wait.


getMaxWaitingPollRequests

public int getMaxWaitingPollRequests()
Returns the maximum number of server poll response threads that will be waiting for messages to arrive for clients.


setMaxWaitingPollRequests

public void setMaxWaitingPollRequests(int maxWaitingPollRequests)
Sets the maximum number of server poll response threads that will be waiting for messages to arrive for clients.

Parameters:
maxWaitingPollRequests - The maximum number of server poll response threads that will be waiting for messages to arrive for the client.

getWaitInterval

public long getWaitInterval()
Returns the number of milliseconds the server poll response thread will be waiting for messages to arrive for the client.


setWaitInterval

public void setWaitInterval(long waitInterval)
Sets the number of milliseconds the server poll response thread will be waiting for messages to arrive for the client.

Parameters:
waitInterval - The number of milliseconds the server poll response thread will be waiting for messages to arrive for the client.

start

public void start()
Sets up monitoring of waited poll requests so they can be notified and exit when the endpoint stops.

Specified by:
start in interface Endpoint
Specified by:
start in interface FlexComponent
Overrides:
start in class BaseHTTPEndpoint
See Also:
AbstractEndpoint.start()

stop

public void stop()
Ensures that no poll requests in a wait state are left un-notified when the endpoint stops.

Specified by:
stop in interface Endpoint
Specified by:
stop in interface FlexComponent
Overrides:
stop in class AbstractEndpoint
See Also:
AbstractEndpoint.stop()

waitStart

public void waitStart(Object notifier)
Description copied from interface: PollWaitListener
Hook method invoked directly before a wait begins.

Specified by:
waitStart in interface PollWaitListener
Parameters:
notifier - The Object being used to wait()/notify().
See Also:
PollWaitListener.waitStart(Object)

waitEnd

public void waitEnd(Object notifier)
Description copied from interface: PollWaitListener
Hook method invoked directly after a wait completes.

Specified by:
waitEnd in interface PollWaitListener
Parameters:
notifier - The Object being used to wait()/notify().
See Also:
PollWaitListener.waitEnd(Object)


Copyright © 2008 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/blazeds/1/javadoc/flex/messaging/endpoints/BasePollingHTTPEndpoint.html