Package com.sun.sgs.app

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


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


        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 +
         ", elapsed time: " + (endTime - startTime) +
View Full Code Here

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

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

  final DummyClient client = newClient();
  try {
      txnScheduler.runTask(new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        try {
      channel.leave(client.getSession());
      fail("Expected TransactionNotActiveException");
        } catch (TransactionNotActiveException e) {
      System.err.println(e);
        }
    }
View Full Code Here

        ClientSession session =
      (ClientSession) dataService.getBinding(user);
        channel.join(session);
        dataService.removeObject(channel);
        try {
      channel.leave(session);
      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.leave((ClientSession) null);
        fail("Expected NullPointerException");
    } catch (NullPointerException e) {
        System.err.println(e);
    }
      }
View Full Code Here

        channel.join(moe);

        try {
      ClientSession larry =
          (ClientSession) dataService.getBinding(LARRY);
      channel.leave(larry);
      System.err.println("leave of non-member session returned");
     
        } catch (Exception e) {
      System.err.println(e);
      fail("test failed with exception: " + e);
View Full Code Here

   
    txnScheduler.runTask(new TestAbstractKernelRunnable() {
        public void run() {
      Channel channel = getChannel(channelName);
      ClientSession session = getSession(user);
      channel.leave(session);
        }}, taskOwner);

    Thread.sleep(100);
   
    txnScheduler.runTask(new TestAbstractKernelRunnable() {
View Full Code Here

        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 +
         ", elapsed time: " + (endTime - startTime) +
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.