public abstract class AbstractChannel extends java.lang.Object implements Channel
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
clientType |
protected ChannelFactory<? extends Channel> |
factory |
protected GravityInternal |
gravity |
protected java.lang.String |
id |
protected java.util.LinkedList<AsyncPublishedMessage> |
publishedQueue |
protected java.util.concurrent.locks.Lock |
publishedQueueLock |
protected AsyncPublisher |
publisher |
protected java.util.LinkedList<AsyncMessage> |
receivedQueue |
protected java.util.concurrent.locks.Lock |
receivedQueueLock |
protected AsyncReceiver |
receiver |
protected java.lang.String |
sessionId |
protected java.util.concurrent.ConcurrentMap<java.lang.String,Subscription> |
subscriptions |
protected UdpReceiver |
udpReceiver |
protected java.security.Principal |
userPrincipal |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractChannel(GravityInternal gravity,
java.lang.String id,
ChannelFactory<? extends Channel> factory,
java.lang.String clientType) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract AsyncHttpContext |
acquireAsyncHttpContext() |
Subscription |
addSubscription(java.lang.String destination,
java.lang.String subTopicId,
java.lang.String subscriptionId,
boolean noLocal) |
protected void |
createUdpReceiver(UdpReceiverFactory factory,
AsyncHttpContext asyncHttpContext) |
void |
destroy() |
void |
destroy(boolean timeout) |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getClientType() |
ChannelFactory<? extends Channel> |
getFactory() |
GravityInternal |
getGravity() |
java.lang.String |
getId() |
java.util.Collection<Subscription> |
getSubscriptions() |
java.security.Principal |
getUserPrincipal() |
protected abstract boolean |
hasAsyncHttpContext() |
int |
hashCode() |
boolean |
hasPublishedMessage() |
boolean |
hasReceivedMessage() |
boolean |
isAuthenticated() |
boolean |
isConnected() |
void |
publish(AsyncPublishedMessage message) |
protected boolean |
queueReceiver() |
void |
receive(AsyncMessage message) |
protected abstract void |
releaseAsyncHttpContext(AsyncHttpContext context) |
Subscription |
removeSubscription(java.lang.String subscriptionId) |
boolean |
runPublish() |
boolean |
runReceive() |
boolean |
runReceived(AsyncHttpContext asyncHttpContext) |
void |
setUserPrincipal(java.security.Principal principal) |
java.lang.String |
toString() |
protected final java.lang.String id
protected final java.lang.String sessionId
protected final java.lang.String clientType
protected final GravityInternal gravity
protected final ChannelFactory<? extends Channel> factory
protected final java.util.concurrent.ConcurrentMap<java.lang.String,Subscription> subscriptions
protected java.security.Principal userPrincipal
protected java.util.LinkedList<AsyncPublishedMessage> publishedQueue
protected final java.util.concurrent.locks.Lock publishedQueueLock
protected java.util.LinkedList<AsyncMessage> receivedQueue
protected final java.util.concurrent.locks.Lock receivedQueueLock
protected final AsyncPublisher publisher
protected final AsyncReceiver receiver
protected UdpReceiver udpReceiver
protected AbstractChannel(GravityInternal gravity, java.lang.String id, ChannelFactory<? extends Channel> factory, java.lang.String clientType)
protected abstract boolean hasAsyncHttpContext()
protected abstract AsyncHttpContext acquireAsyncHttpContext()
protected abstract void releaseAsyncHttpContext(AsyncHttpContext context)
public java.lang.String getClientType()
getClientType in interface Channelpublic ChannelFactory<? extends Channel> getFactory()
getFactory in interface Channelpublic GravityInternal getGravity()
getGravity in interface Channelpublic Subscription addSubscription(java.lang.String destination, java.lang.String subTopicId, java.lang.String subscriptionId, boolean noLocal)
addSubscription in interface Channelpublic java.util.Collection<Subscription> getSubscriptions()
getSubscriptions in interface Channelpublic Subscription removeSubscription(java.lang.String subscriptionId)
removeSubscription in interface Channelpublic boolean isConnected()
isConnected in interface Channelpublic boolean isAuthenticated()
isAuthenticated in interface Channelpublic java.security.Principal getUserPrincipal()
getUserPrincipal in interface Channelpublic void setUserPrincipal(java.security.Principal principal)
setUserPrincipal in interface Channelpublic void publish(AsyncPublishedMessage message) throws MessagePublishingException
publish in interface ChannelMessagePublishingExceptionpublic boolean hasPublishedMessage()
hasPublishedMessage in interface Channelpublic boolean runPublish()
runPublish in interface Channelpublic void receive(AsyncMessage message) throws MessageReceivingException
receive in interface ChannelMessageReceivingExceptionpublic boolean hasReceivedMessage()
hasReceivedMessage in interface Channelpublic boolean runReceive()
runReceive in interface Channelprotected void createUdpReceiver(UdpReceiverFactory factory, AsyncHttpContext asyncHttpContext)
public boolean runReceived(AsyncHttpContext asyncHttpContext)
runReceived in interface Channelpublic final void destroy()
protected boolean queueReceiver()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object