/** * {@inheritDoc} */ @Override public boolean isConnected(final IPushNode<?> node) { if (node instanceof CometdPushNode) return _getBayeuxServerChannel((CometdPushNode<?>)node) != null; LOG.warn("Unsupported push node type {}", node); return false; }
/** * Directly sends JavaScript code to the node via a cometd channel without an additional Wicket * AJAX request roundtrip. */ public <EventType> void publishJavascript(final CometdPushNode<EventType> node, final String javascript) { final ServerChannel channel = _getBayeuxServerChannel(node); if (channel == null) LOG.warn("No cometd channel found for {}", node); else channel.publish(null, "javascript:" + javascript, node.getCometdChannelEventId()); }
/** * {@inheritDoc} */ @Override public <EventType> void publish(final IPushNode<EventType> node, final EventType event) { if (node instanceof CometdPushNode) { final ServerChannel cchannel = _getBayeuxServerChannel((CometdPushNode<?>)node); if (cchannel == null) LOG.warn("No cometd channel found for {}", node); else { @SuppressWarnings("unchecked") final PushNodeState<EventType> state = (PushNodeState<EventType>)_nodeStates.get(node); if (state != null) { synchronized (state.queuedEventsLock) { state.queuedEvents.add(new CometdPushEventContext<EventType>(event, null, this)); } cchannel.publish(null, "pollEvents", state.node.getCometdChannelEventId()); } } } else LOG.warn("Unsupported push node type {}", node); }
final CometdPushNode<EventType> node = (CometdPushNode<EventType>)pnode; final ServerChannel cchannel = _getBayeuxServerChannel(node); if (cchannel == null)