public final void destroy() { destroy(false); }
protected boolean queueReceiver() { if (hasReceivedMessage()) { receiver.queue(getGravity()); return true; } return false; }
public boolean runReceive() { return runReceived(null); }
public boolean runReceived(AsyncHttpContext asyncHttpContext) { GravityInternal gravity = getGravity(); createUdpReceiver(factory, asyncHttpContext); return true; asyncHttpContext = acquireAsyncHttpContext(); if (asyncHttpContext == null) return false; log.error(e, "Configuration error for channel: %s", getId()); log.warn(e, "Could not send messages to channel: %s (retrying later)", getId()); GravityConfig gravityConfig = getGravity().getGravityConfig(); if (gravityConfig.isRetryOnError()) { receivedQueueLock.lock(); log.warn( "Channel %s has reached its maximum queue capacity %s (throwing %s messages)", getId(), gravityConfig.getMaxMessagesQueuedPerChannel(), messages.size() releaseAsyncHttpContext(asyncHttpContext);
throw new NullPointerException("message cannot be null"); GravityInternal gravity = getGravity(); log.debug(e, "Closing unreachable UDP channel %s", getId()); udpReceiver.close(false); log.error(e, "Cannot access UDP channel %s", getId()); throw new MessageReceivingException(message, "Could not queue message (channel's queue is full) for channel: " + this); log.debug("Channel %s queue message %s for client %s", getId(), message.getMessageId(), message.getClientId()); receivedQueue.add(message); if (hasAsyncHttpContext()) receiver.queue(gravity);
public void publish(AsyncPublishedMessage message) throws MessagePublishingException { if (message == null) throw new NullPointerException("message cannot be null"); publishedQueueLock.lock(); try { publishedQueue.add(message); } finally { publishedQueueLock.unlock(); } publisher.queue(getGravity()); }
releaseAsyncHttpContext(asyncHttpContext);
public void destroy(boolean timeout) { try { GravityInternal gravity = getGravity(); gravity.cancel(publisher); gravity.cancel(receiver); subscriptions.clear(); } finally { if (udpReceiver != null) { if (!udpReceiver.isClosed()) udpReceiver.close(timeout); udpReceiver = null; } } }
@Override public void destroy(boolean timeout) { try { super.destroy(timeout); } finally { close(); } }
@Override public void destroy(boolean timeout) { try { super.destroy(timeout); } finally { close(); } }
@Override public void destroy(boolean timeout) { try { super.destroy(timeout); } finally { synchronized (this) { close(); } } } }
@Override public void destroy(boolean timeout) { try { super.destroy(timeout); } finally { close(); } }
@Override public void destroy(boolean timeout) { try { super.destroy(timeout); } finally { close(); } }
@Override public void destroy(boolean timeout) { try { super.destroy(timeout); } finally { close(); } }
@Override public void destroy(boolean timeout) { try { super.destroy(timeout); } finally { synchronized (this) { close(); } } } }
@Override public void destroy(boolean timeout) { try { super.destroy(timeout); } finally { synchronized (this) { close(); } } } }