Package com.sun.sgs.app

Examples of com.sun.sgs.app.ChannelListener


  DataService dataService = getDataService();
  removeAllSessions();
  getChannelsMap().removeOverride(name);
  dataService.removeObject(this);
  if (listenerRef != null) {
      ChannelListener maybeWrappedListener = listenerRef.get();
      if (maybeWrappedListener instanceof ManagedSerializable) {
    dataService.removeObject(maybeWrappedListener);
      }
  }
  BindingKeyedMap<EventQueue> eventQueuesMap =
View Full Code Here


  // Create a channel with a ValidatingChannelListener and join the
  // client to the channel.
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() {
    ChannelListener listener =
        new ValidatingChannelListener();
    dataService.setBinding(listenerName, listener);
    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);
  client.sendChannelMessage(channelName, 0);

  // Validate that the session passed to the handleChannelMessage
  // method was a wrapped ClientSession.
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() {
    ValidatingChannelListener listener = (ValidatingChannelListener)
        dataService.getBinding(listenerName);
    ClientSession session =
        (ClientSession) dataService.getBinding(user);
    listener.validateSession(session);
    System.err.println("sessions are equal");
      }
  }, taskOwner);
    }
View Full Code Here

     */
    void leaveAll() {
  try {
      checkClosed();
      close(false);
      ChannelListener listener =
    listenerRef != null ? listenerRef.get() : null;
      newInstance(name, listener, delivery, writeBufferCapacity,
      getWrappedChannel());
      logger.log(Level.FINEST, "leaveAll returns");
 
View Full Code Here

  if (removeName) {
      getChannelsMap().removeOverride(name);
  }
  dataService.removeObject(this);
  if (listenerRef != null) {
      ChannelListener maybeWrappedListener = null;
      try {
    maybeWrappedListener = listenerRef.get();
      } catch (ObjectNotFoundException ignore) {
    // listener already removed
      }
View Full Code Here

  // Create a channel with a ValidatingChannelListener and join the
  // client to the channel.
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() {
    ChannelListener listener =
        new ValidatingChannelListener();
    dataService.setBinding(listenerName, listener);
    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);
  client.sendChannelMessage(channelName, 0);

  // Validate that the session passed to the handleChannelMessage
  // method was a wrapped ClientSession.
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() {
    ValidatingChannelListener listener = (ValidatingChannelListener)
        dataService.getBinding(listenerName);
    ClientSession session =
        (ClientSession) dataService.getBinding(user);
    listener.validateSession(session);
    System.err.println("sessions are equal");
      }
  }, taskOwner);
    }
View Full Code Here

     */
    void leaveAll() {
  try {
      checkClosed();
      close(false);
      ChannelListener listener =
    listenerRef != null ? listenerRef.get() : null;
      newInstance(name, listener, delivery, writeBufferCapacity,
      getWrappedChannel());
      logger.log(Level.FINEST, "leaveAll returns");
 
View Full Code Here

  if (removeName) {
      getChannelsMap().removeOverride(name);
  }
  dataService.removeObject(this);
  if (listenerRef != null) {
      ChannelListener maybeWrappedListener = null;
      try {
    maybeWrappedListener = listenerRef.get();
      } catch (ObjectNotFoundException ignore) {
    // listener already removed
      }
View Full Code Here

     */
    void leaveAll() {
  try {
      checkClosed();
      close(false);
      ChannelListener listener =
    listenerRef != null ? listenerRef.get() : null;
      newInstance(name, listener, delivery, writeBufferCapacity,
      getWrappedChannel());
      logger.log(Level.FINEST, "leaveAll returns");
 
View Full Code Here

  if (removeName) {
      getChannelsMap().removeOverride(name);
  }
  dataService.removeObject(this);
  if (listenerRef != null) {
      ChannelListener maybeWrappedListener = listenerRef.get();
      if (maybeWrappedListener instanceof ManagedSerializable) {
    dataService.removeObject(maybeWrappedListener);
      }
  }
  BindingKeyedMap<EventQueue> eventQueuesMap =
View Full Code Here

  // Create a channel with a ValidatingChannelListener and join the
  // client to the channel.
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() {
    ChannelListener listener =
        new ValidatingChannelListener();
    dataService.setBinding(listenerName, listener);
    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);
  client.sendChannelMessage(channelName, 0);

  // Validate that the session passed to the handleChannelMessage
  // method was a wrapped ClientSession.
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() {
    ValidatingChannelListener listener = (ValidatingChannelListener)
        dataService.getBinding(listenerName);
    ClientSession session =
        (ClientSession) dataService.getBinding(user);
    listener.validateSession(session);
    System.err.println("sessions are equal");
      }
  }, taskOwner);
    }
View Full Code Here

TOP

Related Classes of com.sun.sgs.app.ChannelListener

Copyright © 2018 www.massapicom. 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.