org.glassfish.tyrus
Class AnnotatedEndpoint

java.lang.Object
  extended by javax.net.websocket.Endpoint
      extended by org.glassfish.tyrus.AnnotatedEndpoint

public class AnnotatedEndpoint
extends Endpoint

AnnotatedEndpoint of a class annotated using the WebSocketEndpoint annotations

Author:
Martin Matula (martin.matula at oracle.com)

Constructor Summary
AnnotatedEndpoint(Class<?> annotatedClass)
           
 
Method Summary
 void onClose(Session session, CloseReason closeReason)
          Developers may implement this method to be notified when an active conversation has just been terminated.
 void onError(Throwable thr, Session session)
          Developers may implement this method when a web socket connection, represented by the session, creates some kind of error that is not modeled in the web socket protocol.
 void onOpen(Session session)
          Developers may implement this method to be notified when a new conversation has just begun.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotatedEndpoint

public AnnotatedEndpoint(Class<?> annotatedClass)
Method Detail

onClose

public void onClose(Session session,
                    CloseReason closeReason)
Description copied from class: Endpoint
Developers may implement this method to be notified when an active conversation has just been terminated.

Overrides:
onClose in class Endpoint

onError

public void onError(Throwable thr,
                    Session session)
Description copied from class: Endpoint
Developers may implement this method when a web socket connection, represented by the session, creates some kind of error that is not modeled in the web socket protocol. This may for example be a notification that an incoming message is too big to handle, or that the incoming message could not be encoded.

There are a number of categories of exception that this method is (currently) defined to handle:-
- connection problems, for example, a socket failure that occurs before the web socket connection can be formally closed.
- errors thrown by developer create message handlers calls.
- conversion errors encoding incoming messages before any message handler has been called.
TBD We may come up with less of a 'catch-all' mechanism for handling exceptions, especially given the varying nature of these categories of exception.

Overrides:
onError in class Endpoint

onOpen

public void onOpen(Session session)
Description copied from class: Endpoint
Developers may implement this method to be notified when a new conversation has just begun.

Specified by:
onOpen in class Endpoint


Copyright © 2012. All Rights Reserved.