org.granite.client.messaging.channel.amf
Class AbstractAMFMessagingChannel
java.lang.Object
org.granite.client.messaging.channel.AbstractChannel<Transport>
org.granite.client.messaging.channel.AbstractHTTPChannel
org.granite.client.messaging.channel.amf.AbstractAMFChannel
org.granite.client.messaging.channel.amf.AbstractAMFMessagingChannel
- All Implemented Interfaces:
- Runnable, Channel, MessagingChannel, SessionAwareChannel, TransportStopListener
- Direct Known Subclasses:
- AMFMessagingChannel, JMFAMFMessagingChannel
public class AbstractAMFMessagingChannel
- extends AbstractAMFChannel
- implements MessagingChannel
- Author:
- Franck WOLFF
| Methods inherited from class org.granite.client.messaging.channel.AbstractHTTPChannel |
getDefaultTimeToLive, getMaxConcurrentRequests, getRequest, isAuthenticated, isStarted, logout, onCancelled, onMessage, onStop, run, schedule, send, setDefaultTimeToLive, start, stop |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.granite.client.messaging.channel.Channel |
getClientId, getCredentials, getDefaultTimeToLive, getId, getTransport, getTransportData, getUri, isAuthenticated, isStarted, logout, onCancelled, onMessage, send, setCredentials, setDefaultTimeToLive, setTransportData, start, stop |
codec
protected final MessagingCodec<Message[]> codec
sessionId
protected String sessionId
consumersMap
protected final ConcurrentMap<String,Consumer> consumersMap
connectMessageId
protected final AtomicReference<String> connectMessageId
reconnectTimerTask
protected final AtomicReference<org.granite.client.messaging.channel.amf.AbstractAMFMessagingChannel.ReconnectTimerTask> reconnectTimerTask
reconnectIntervalMillis
protected volatile long reconnectIntervalMillis
reconnectMaxAttempts
protected volatile long reconnectMaxAttempts
reconnectAttempts
protected volatile long reconnectAttempts
AbstractAMFMessagingChannel
protected AbstractAMFMessagingChannel(MessagingCodec<Message[]> codec,
Transport transport,
String id,
URI uri)
setSessionId
public void setSessionId(String sessionId)
- Specified by:
setSessionId in interface MessagingChannel- Specified by:
setSessionId in interface SessionAwareChannel
connect
protected boolean connect()
addConsumer
public void addConsumer(Consumer consumer)
- Specified by:
addConsumer in interface MessagingChannel
removeConsumer
public boolean removeConsumer(Consumer consumer)
- Specified by:
removeConsumer in interface MessagingChannel
disconnect
public ResponseMessageFuture disconnect(ResponseListener... listeners)
- Specified by:
disconnect in interface MessagingChannel
createTransportMessage
protected TransportMessage createTransportMessage(AsyncToken token)
throws UnsupportedEncodingException
- Specified by:
createTransportMessage in class AbstractHTTPChannel
- Throws:
UnsupportedEncodingException
decodeResponse
protected ResponseMessage decodeResponse(InputStream is)
throws IOException
- Specified by:
decodeResponse in class AbstractHTTPChannel
- Throws:
IOException
onError
public void onError(TransportMessage message,
Exception e)
- Specified by:
onError in interface Channel- Overrides:
onError in class AbstractHTTPChannel
cancelReconnectTimerTask
protected void cancelReconnectTimerTask()
scheduleReconnectTimerTask
protected void scheduleReconnectTimerTask()