org.granite.gravity
Class AbstractChannel
java.lang.Object
org.granite.gravity.AbstractChannel
- All Implemented Interfaces:
- Channel
- Direct Known Subclasses:
- AsyncChannel, ContinuationChannel, ContinuationChannel, GenericChannel, GlassFishWebSocketChannel, JBossWebChannel, JettyWebSocketChannel, TomcatChannel, TomcatWebSocketChannel, WebLogicChannel
public abstract class AbstractChannel
- extends Object
- implements Channel
- Author:
- Franck WOLFF
| Methods inherited from interface org.granite.gravity.Channel |
close |
id
protected final String id
sessionId
protected final String sessionId
clientType
protected final String clientType
gravity
protected final Gravity gravity
factory
protected final ChannelFactory<? extends Channel> factory
subscriptions
protected final ConcurrentMap<String,Subscription> subscriptions
publishedQueue
protected LinkedList<AsyncPublishedMessage> publishedQueue
publishedQueueLock
protected final Lock publishedQueueLock
receivedQueue
protected LinkedList<AsyncMessage> receivedQueue
receivedQueueLock
protected final Lock receivedQueueLock
publisher
protected final AsyncPublisher publisher
httpReceiver
protected final AsyncReceiver httpReceiver
udpReceiver
protected UdpReceiver udpReceiver
AbstractChannel
protected AbstractChannel(Gravity gravity,
String id,
ChannelFactory<? extends Channel> factory,
String clientType)
hasAsyncHttpContext
protected abstract boolean hasAsyncHttpContext()
acquireAsyncHttpContext
protected abstract AsyncHttpContext acquireAsyncHttpContext()
releaseAsyncHttpContext
protected abstract void releaseAsyncHttpContext(AsyncHttpContext context)
getId
public String getId()
- Specified by:
getId in interface Channel
getClientType
public String getClientType()
- Specified by:
getClientType in interface Channel
getFactory
public ChannelFactory<? extends Channel> getFactory()
- Specified by:
getFactory in interface Channel
getGravity
public Gravity getGravity()
- Specified by:
getGravity in interface Channel
addSubscription
public Subscription addSubscription(String destination,
String subTopicId,
String subscriptionId,
boolean noLocal)
- Specified by:
addSubscription in interface Channel
getSubscriptions
public Collection<Subscription> getSubscriptions()
- Specified by:
getSubscriptions in interface Channel
removeSubscription
public Subscription removeSubscription(String subscriptionId)
- Specified by:
removeSubscription in interface Channel
publish
public void publish(AsyncPublishedMessage message)
throws MessagePublishingException
- Specified by:
publish in interface Channel
- Throws:
MessagePublishingException
hasPublishedMessage
public boolean hasPublishedMessage()
- Specified by:
hasPublishedMessage in interface Channel
runPublish
public boolean runPublish()
- Specified by:
runPublish in interface Channel
receive
public void receive(AsyncMessage message)
throws MessageReceivingException
- Specified by:
receive in interface Channel
- Throws:
MessageReceivingException
hasReceivedMessage
public boolean hasReceivedMessage()
- Specified by:
hasReceivedMessage in interface Channel
runReceive
public boolean runReceive()
- Specified by:
runReceive in interface Channel
newSerializer
public ObjectOutput newSerializer(GraniteContext context,
OutputStream os)
getSerializerContentType
public String getSerializerContentType()
createUdpReceiver
protected void createUdpReceiver(UdpReceiverFactory factory,
AsyncHttpContext asyncHttpContext)
runReceived
public boolean runReceived(AsyncHttpContext asyncHttpContext)
- Specified by:
runReceived in interface Channel
destroy
public void destroy()
destroy
public void destroy(boolean timeout)
- Specified by:
destroy in interface Channel
queueReceiver
protected boolean queueReceiver()
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
toString
public String toString()
- Overrides:
toString in class Object