Tabnine Logo
WebSocketProcessor.registerWebSocketHandler
Code IndexAdd Tabnine to your IDE (free)

How to use
registerWebSocketHandler
method
in
org.atmosphere.websocket.WebSocketProcessor

Best Java code snippets using org.atmosphere.websocket.WebSocketProcessor.registerWebSocketHandler (Showing top 2 results out of 315)

origin: Atmosphere/atmosphere

/**
 * Add an {@link WebSocketHandler} mapped to the path and the {@link AtmosphereHandler} in case {@link Broadcaster} are
 * used.
 *
 * @param path    a path
 * @param handler a {@link WebSocketHandler}
 * @param h       an {@link AtmosphereHandler}
 * @param l       {@link AtmosphereInterceptor}
 * @return this
 */
public AtmosphereFramework addWebSocketHandler(String path, WebSocketHandler handler, AtmosphereHandler h, List<AtmosphereInterceptor> l) {
  WebSocketProcessorFactory.getDefault().getWebSocketProcessor(this)
      .registerWebSocketHandler(path,
          new WebSocketProcessor.WebSocketHandlerProxy(broadcasterFactory.lookup(path, true).getClass(), handler));
  addAtmosphereHandler(path, h, l);
  return this;
}
origin: Atmosphere/atmosphere

@Override
public void handle(AtmosphereFramework framework, Class<WebSocketHandler> annotatedClass) {
  try {
    WebSocketHandlerService m = annotatedClass.getAnnotation(WebSocketHandlerService.class);
    atmosphereConfig(m.atmosphereConfig(), framework);
    framework.addAtmosphereHandler(m.path(), AtmosphereFramework.REFLECTOR_ATMOSPHEREHANDLER).initWebSocket();
    framework.setDefaultBroadcasterClassName(m.broadcaster().getName());
    filters(m.broadcastFilters(), framework);
    final LinkedList<AtmosphereInterceptor> l = new LinkedList<AtmosphereInterceptor>();
    AtmosphereInterceptor aa = listeners(m.listeners(), framework);
    if (aa != null) {
      l.add(aa);
    }
    AnnotationUtil.interceptorsForHandler(framework, Arrays.asList(m.interceptors()), l);
    framework.setBroadcasterCacheClassName(m.broadcasterCache().getName());
    WebSocketProcessor p = WebSocketProcessorFactory.getDefault().getWebSocketProcessor(framework);
    framework.addAtmosphereHandler(m.path(), REFLECTOR_ATMOSPHEREHANDLER, l);
    p.registerWebSocketHandler(m.path(), new WebSocketProcessor.WebSocketHandlerProxy(broadcasterClass(framework, m.broadcaster()),
        framework.newClassInstance(WebSocketHandler.class, annotatedClass)));
  } catch (Throwable e) {
    logger.warn("", e);
  }
}
org.atmosphere.websocketWebSocketProcessorregisterWebSocketHandler

Javadoc

Register a WebSocketHandler

Popular methods of WebSocketProcessor

  • close
  • open
  • invokeWebSocketProtocol
  • handshake
  • notifyListener
  • configure
    Configure, or post construct a WebSocketProcessor
  • destroy
    Destroy all resources associated with this class.

Popular in Java

  • Making http requests using okhttp
  • getContentResolver (Context)
  • getApplicationContext (Context)
  • startActivity (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now