Package org.cometd.bayeux.server

Examples of org.cometd.bayeux.server.ServerChannel.publish()


        channel.addListener(messageListener);
        oort.observeChannel(channelName);

        // Notify other nodes of our initial value.
        // Must be done after registering listeners, to avoid missing responses from other nodes.
        channel.publish(getLocalSession(), info);

        if (logger.isDebugEnabled())
            logger.debug("{} started", this);
    }
View Full Code Here


                                {
                                    try
                                    {
                                        sleep(delay);
                                        ServerChannel channel = oort2.getBayeuxServer().getChannel(message.getChannel());
                                        channel.publish(oort2.getOortSession(), message);
                                    }
                                    catch (InterruptedException ignored)
                                    {
                                    }
                                }
View Full Code Here

        Assert.assertTrue(connector.isStopped());
        Assert.assertTrue(client.waitFor(5000, BayeuxClient.State.UNCONNECTED));

        // Send messages while client is offline
        for (int i = count; i < 2 * count; ++i)
            chatChannel.publish(null, "hello_" + i);

        Thread.sleep(1000);
        Assert.assertEquals(0, messages.size());

        connector.setPort(port);
View Full Code Here

        Assert.assertNull(_bayeux.getChannel(fooBar.getId()));

        ServerSessionImpl session0 = newServerSession();
        ServerMessage.Mutable message = _bayeux.newMessage();
        message.setData("test");
        fooBar.publish(session0, message);

        Assert.assertEquals(1, session1.getQueue().size());
    }

    @Test
View Full Code Here

        synchronized (state.queuedEventsLock)
        {
          state.queuedEvents.add(event);
        }

        channel.publish(null, "pollEvents", state.channel.getCometdChannelEventId());
      }
    }
    else
      LOG.warn("Unsupported push channel type {}", pushChannel);
  }
View Full Code Here

  {
    final ServerChannel channel = _getBayeuxServerChannel(pushChannel);
    if (channel == null)
      LOG.warn("No cometd channel found for {}", pushChannel);
    else
      channel.publish(null, "javascript:" + javascript, pushChannel.getCometdChannelEventId());
  }

  /**
   * {@inheritDoc}
   */
 
View Full Code Here

      {
        synchronized (state.queuedEventsLock)
        {
          state.queuedEvents.add(ctx);
        }
        cchannel.publish(null, "pollEvents", state.node.getCometdChannelEventId());
      }
    }
  }

  /**
 
View Full Code Here

          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);
View Full Code Here

  {
    final ServerChannel channel = _getBayeuxServerChannel(node);
    if (channel == null)
      LOG.warn("No cometd channel found for {}", node);
    else
      channel.publish(null, "javascript:" + javascript, node.getCometdChannelEventId());
  }

  /**
   * Directly sends JavaScript code to all nodes listeing to the given push channel via a cometd
   * channel without an additional Wicket AJAX request roundtrip.
View Full Code Here

    data.put("siteId", siteId);
    data.put("username", username);

    log.fine(data.toString());

    channel.publish(from, data, null);
  }

  public String toString() {
    return "LateJoinHandler";
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.