Package com.sun.sgs.app

Examples of com.sun.sgs.app.ClientSessionListener


   * in the data service if: the AppListener.loggedIn callback
   * either threw a non-retryable exception or returned a
   * null listener, or the application removed the
   * ClientSessionListener object from the data service.
   */
  ClientSessionListener listener = null;
  try {
      ManagedObject obj = dataService.getServiceBinding(listenerKey);
      dataService.removeServiceBinding(listenerKey);
       if (obj instanceof ListenerWrapper) {
    dataService.removeObject(obj);
    listener = ((ListenerWrapper) obj).get();
      } else {
    listener = (ClientSessionListener) obj;
      }

  } catch (NameNotBoundException e) {
      logger.logThrow(
    Level.FINE, e,
    "removing ClientSessionListener for session:{0} throws",
    this);
  }

  /*
   * Remove event queue and associated binding.
   */
  try {
      ManagedObject eventQueue =
    dataService.getServiceBinding(eventQueueKey);
      dataService.removeServiceBinding(eventQueueKey);
      dataService.removeObject(eventQueue);
  } catch (NameNotBoundException e) {
      logger.logThrow(
    Level.FINE, e,
    "removing EventQueue for session:{0} throws",
    this);
  }

  /*
   * Invoke listener's 'disconnected' callback if 'notify'
   * is true and a listener exists for this client session.  If the
   * 'disconnected' callback throws a non-retryable exception,
   * schedule a task to remove this session and its associated
   * bindings without invoking the listener, and rethrow the
   * exception so that the currently executing transaction aborts.
   */
  if (notify && listener != null) {
      try {
    listener.disconnected(graceful);
      } catch (RuntimeException e) {
    if (!isRetryableException(e)) {
        logger.logThrow(
      Level.WARNING, e,
      "invoking disconnected callback on listener:{0} " +
View Full Code Here


      AppListener appListener = getAppListener();
      logger.log(
    Level.FINEST,
    "invoking AppListener.loggedIn session:{0}", identity);

      ClientSessionListener returnedListener = null;
      RuntimeException ex = null;

      ClientSessionImpl sessionImpl =
    ClientSessionImpl.getSession(dataService, sessionRefId);
      try {
View Full Code Here

      AppListener appListener = getAppListener();
      logger.log(
    Level.FINEST,
    "invoking AppListener.loggedIn session:{0}", identity);

      ClientSessionListener returnedListener = null;
      RuntimeException ex = null;

      ClientSessionImpl sessionImpl =
    ClientSessionImpl.getSession(dataService, sessionRefId);
      try {
View Full Code Here

   * in the data service if: the AppListener.loggedIn callback
   * either threw a non-retryable exception or returned a
   * null listener, or the application removed the
   * ClientSessionListener object from the data service.
   */
  ClientSessionListener listener = null;
  try {
      ManagedObject obj = null;
      try {
    obj = dataService.getServiceBinding(listenerKey);
      } catch (ObjectNotFoundException ignore) {
    // listener already removed
      }
      dataService.removeServiceBinding(listenerKey);
       if (obj instanceof ListenerWrapper) {
    dataService.removeObject(obj);
    listener = ((ListenerWrapper) obj).get();
      } else {
    listener = (ClientSessionListener) obj;
      }

  } catch (NameNotBoundException e) {
      logger.logThrow(
    Level.FINE, e,
    "removing ClientSessionListener for session:{0} throws",
    this);
  }

  /*
   * Remove event queue and associated binding.
   */
  try {
      ManagedObject eventQueue =
    dataService.getServiceBinding(eventQueueKey);
      dataService.removeServiceBinding(eventQueueKey);
      dataService.removeObject(eventQueue);
  } catch (NameNotBoundException e) {
      logger.logThrow(
    Level.FINE, e,
    "removing EventQueue for session:{0} throws",
    this);
  }

  /*
   * Invoke listener's 'disconnected' callback if 'notify'
   * is true and a listener exists for this client session.  If the
   * 'disconnected' callback throws a non-retryable exception,
   * schedule a task to remove this session and its associated
   * bindings without invoking the listener, and rethrow the
   * exception so that the currently executing transaction aborts.
   */
  if (notify && listener != null) {
      try {
    listener.disconnected(graceful);
      } catch (RuntimeException e) {
    if (!isRetryableException(e)) {
        logger.logThrow(
      Level.WARNING, e,
      "invoking disconnected callback on listener:{0} " +
View Full Code Here

   * in the data service if: the AppListener.loggedIn callback
   * either threw a non-retryable exception or returned a
   * null listener, or the application removed the
   * ClientSessionListener object from the data service.
   */
  ClientSessionListener listener = null;
  try {
      ManagedObject obj = dataService.getServiceBinding(listenerKey);
      dataService.removeServiceBinding(listenerKey);
       if (obj instanceof ListenerWrapper) {
    dataService.removeObject(obj);
    listener = ((ListenerWrapper) obj).get();
      } else {
    listener = (ClientSessionListener) obj;
      }

  } catch (NameNotBoundException e) {
      logger.logThrow(
    Level.FINE, e,
    "removing ClientSessionListener for session:{0} throws",
    this);
  }

  /*
   * Remove event queue and associated binding.
   */
  try {
      ManagedObject eventQueue =
    dataService.getServiceBinding(eventQueueKey);
      dataService.removeServiceBinding(eventQueueKey);
      dataService.removeObject(eventQueue);
  } catch (NameNotBoundException e) {
      logger.logThrow(
    Level.FINE, e,
    "removing EventQueue for session:{0} throws",
    this);
  }

  /*
   * Invoke listener's 'disconnected' callback if 'notify'
   * is true and a listener exists for this client session.  If the
   * 'disconnected' callback throws a non-retryable exception,
   * schedule a task to remove this session and its associated
   * bindings without invoking the listener, and rethrow the
   * exception so that the currently executing transaction aborts.
   */
  if (notify && listener != null) {
      try {
    listener.disconnected(graceful);
      } catch (RuntimeException e) {
    if (!isRetryableException(e)) {
        logger.logThrow(
      Level.WARNING, e,
      "invoking disconnected callback on listener:{0} " +
View Full Code Here

      AppListener appListener = getAppListener();
      logger.log(
    Level.FINEST,
    "invoking AppListener.loggedIn session:{0}", identity);

      ClientSessionListener returnedListener = null;
      RuntimeException ex = null;

      ClientSessionImpl sessionImpl =
    ClientSessionImpl.getSession(dataService, sessionRefId);
      try {
View Full Code Here

TOP

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

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.