Package com.sun.sgs.app

Examples of com.sun.sgs.app.Channel.join()


        // We were passed a reference to the first channel.
        channel1.get().join(session);
       
        // We look up the second channel by name.
        Channel channel2 = channelMgr.getChannel(HelloChannels.CHANNEL_2_NAME);
        channel2.join(session);
    }

    /**
     * Returns the session for this listener.
     *
 
View Full Code Here


        // We were passed a reference to the first channel.
        channel1.get().join(session);
       
        // We look up the second channel by name.
        Channel channel2 = channelMgr.getChannel(HelloChannels.CHANNEL_2_NAME);
        channel2.join(session);
    }

    /**
     * Returns the session for this listener.
     *
 
View Full Code Here

    System.err.println("DummyClientSessionListener: join request, " +
           "channel name: " + channelName +
           ", user: " + name);
    Channel channel =
        (Channel) dataManager.getBinding(channelName);
    channel.join(session);
    session.send(message.asReadOnlyBuffer());
      } else if (action.equals("leave")) {
    String channelName = buf.getString();
    System.err.println("DummyClientSessionListener: leave request, " +
           "channel name: " + channelName +
View Full Code Here

    ClientSession session =
        (ClientSession) dataService.getBinding(user);
    Channel channel =
        channelService.createChannel(
      channelName, listener, Delivery.RELIABLE);
    channel.join(session);
      }
  }, taskOwner);

  // Wait for the client to join, and then send a channel message.
  client.assertJoinedChannel(channelName);
View Full Code Here

    public void run() {
        Channel channel = channelService.getChannel(channelName);
        DataManager dataManager = AppContext.getDataManager();
        ClientSession session = (ClientSession)
      dataManager.getBinding(sessionKey);
        channel.join(session);
        channel.leave(session);
    }}, taskOwner);
  }
  long endTime = System.currentTimeMillis();
  System.err.println("join/leave, iterations: " + numIterations +
View Full Code Here

      public void run() {
    Channel channel = getChannel(channelName);
    for (String user : users) {
        ClientSession session =
      (ClientSession) dataService.getBinding(user);
        channel.join(session);
    }
      }
  }, taskOwner);
    }
View Full Code Here

    @Test
    public void testChannelJoinNoTxn() throws Exception {
  Channel channel = createChannel();
  DummyClient client = newClient();
  try {
      channel.join(client.getSession());
      fail("Expected TransactionNotActiveException");
  } catch (TransactionNotActiveException e) {
      System.err.println(e);
  } finally {
      if (client != null) {
View Full Code Here

        Channel channel =
      channelService.createChannel(
          "x", null, Delivery.RELIABLE);
        dataService.removeObject(channel);
        try {
      channel.join(client.getSession());
      fail("Expected IllegalStateException");
        } catch (IllegalStateException e) {
      System.err.println(e);
        }
    }
View Full Code Here

  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() {
    Channel channel =
        channelService.createChannel("x", null, Delivery.RELIABLE);
    try {
        channel.join((ClientSession) null);
        fail("Expected NullPointerException");
    } catch (NullPointerException e) {
        System.err.println(e);
    }
      }
View Full Code Here

      txnScheduler.runTask(new TestAbstractKernelRunnable() {
    public void run() {
        Channel channel = getChannel(channelName);
        ClientSession session =
      (ClientSession) dataService.getBinding(user);
        channel.join(session);
        dataService.removeObject(channel);
        try {
      channel.leave(session);
      fail("Expected IllegalStateException");
        } catch (IllegalStateException e) {
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.