org.granite.client.messaging.channel
Class AbstractHTTPChannel
java.lang.Object
org.granite.client.messaging.channel.AbstractChannel<Transport>
org.granite.client.messaging.channel.AbstractHTTPChannel
- All Implemented Interfaces:
- Runnable, Channel, TransportStopListener
- Direct Known Subclasses:
- AbstractAMFChannel
public abstract class AbstractHTTPChannel
- extends AbstractChannel<Transport>
- implements TransportStopListener, Runnable
- Author:
- Franck WOLFF
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pinged
protected volatile boolean pinged
authenticated
protected volatile boolean authenticated
maxConcurrentRequests
protected volatile int maxConcurrentRequests
defaultTimeToLive
protected volatile long defaultTimeToLive
AbstractHTTPChannel
public AbstractHTTPChannel(Transport transport,
String id,
URI uri,
int maxConcurrentRequests)
createTransportMessage
protected abstract TransportMessage createTransportMessage(AsyncToken token)
throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
decodeResponse
protected abstract ResponseMessage decodeResponse(InputStream is)
throws IOException
- Throws:
IOException
schedule
protected boolean schedule(TimerTask timerTask,
long delay)
getDefaultTimeToLive
public long getDefaultTimeToLive()
- Specified by:
getDefaultTimeToLive in interface Channel
setDefaultTimeToLive
public void setDefaultTimeToLive(long defaultTimeToLive)
- Specified by:
setDefaultTimeToLive in interface Channel
isAuthenticated
public boolean isAuthenticated()
- Specified by:
isAuthenticated in interface Channel
getMaxConcurrentRequests
public int getMaxConcurrentRequests()
onStop
public void onStop(Transport transport)
- Specified by:
onStop in interface TransportStopListener
start
public boolean start()
- Specified by:
start in interface Channel
isStarted
public boolean isStarted()
- Specified by:
isStarted in interface Channel
stop
public boolean stop()
- Specified by:
stop in interface Channel
run
public void run()
- Specified by:
run in interface Runnable
getRequest
protected RequestMessage getRequest(String id)
send
public ResponseMessageFuture send(RequestMessage request,
ResponseListener... listeners)
- Specified by:
send in interface Channel
logout
public ResponseMessageFuture logout(ResponseListener... listeners)
- Specified by:
logout in interface Channel
onMessage
public void onMessage(InputStream is)
- Specified by:
onMessage in interface Channel
onError
public void onError(TransportMessage message,
Exception e)
- Specified by:
onError in interface Channel
onCancelled
public void onCancelled(TransportMessage message)
- Specified by:
onCancelled in interface Channel