Stilts 0.1.0-SNAPSHOT

org.projectodd.stilts.stomp.client.protocol.websockets
Class WebSocketConnectionNegotiator

java.lang.Object
  extended by org.jboss.netty.channel.SimpleChannelUpstreamHandler
      extended by org.projectodd.stilts.stomp.client.protocol.websockets.WebSocketConnectionNegotiator
All Implemented Interfaces:
org.jboss.netty.channel.ChannelHandler, org.jboss.netty.channel.ChannelUpstreamHandler

public class WebSocketConnectionNegotiator
extends org.jboss.netty.channel.SimpleChannelUpstreamHandler

WebSockets protocol connection negotiator.

This handler reacts to Netty's CONNECTED event and handles the handshake of the WebSockets HTTP upgrade handshake. Upon successful completion, it forwards a CONNECTED event upstream to the underlying protocol making use of the websocket transport. For instance, STOMP.

Author:
Bob McWhirter

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
org.jboss.netty.channel.ChannelHandler.Sharable
 
Constructor Summary
WebSocketConnectionNegotiator(String host, int port)
           
 
Method Summary
 void channelConnected(org.jboss.netty.channel.ChannelHandlerContext context, org.jboss.netty.channel.ChannelStateEvent e)
           
 void messageReceived(org.jboss.netty.channel.ChannelHandlerContext context, org.jboss.netty.channel.MessageEvent e)
           
 
Methods inherited from class org.jboss.netty.channel.SimpleChannelUpstreamHandler
channelBound, channelClosed, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, exceptionCaught, handleUpstream, writeComplete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebSocketConnectionNegotiator

public WebSocketConnectionNegotiator(String host,
                                     int port)
                              throws NoSuchAlgorithmException
Throws:
NoSuchAlgorithmException
Method Detail

channelConnected

public void channelConnected(org.jboss.netty.channel.ChannelHandlerContext context,
                             org.jboss.netty.channel.ChannelStateEvent e)
                      throws Exception
Overrides:
channelConnected in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Throws:
Exception

messageReceived

public void messageReceived(org.jboss.netty.channel.ChannelHandlerContext context,
                            org.jboss.netty.channel.MessageEvent e)
                     throws Exception
Overrides:
messageReceived in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Throws:
Exception

Stilts 0.1.0-SNAPSHOT

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.