Package org.jboss.netty.channel

Examples of org.jboss.netty.channel.SimpleChannelUpstreamHandler


                                                                      workerExecutor, workerThreadPoolSize));
    bootstrap.setOptions(channelConfigs);

    resourceHandler.init(handlerContext);

    final ChannelUpstreamHandler connectionTracker = new SimpleChannelUpstreamHandler() {
      @Override
      public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e) throws Exception {
        channelGroup.add(e.getChannel());
        super.handleUpstream(ctx, e);
      }
View Full Code Here


   * asia.stampy.server.listener.login.AbstractLoginMessageListener#ensureCleanup
   * ()
   */
  @Override
  protected void ensureCleanup() {
    getGateway().addHandler(new SimpleChannelUpstreamHandler() {
      public void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
        HostPort hostPort = new HostPort((InetSocketAddress) ctx.getChannel().getRemoteAddress());
        if (loggedInConnections.contains(hostPort)) {
          log.debug("{} session terminated before DISCONNECT message received, cleaning up", hostPort);
          loggedInConnections.remove(hostPort);
View Full Code Here

   * asia.stampy.server.listener.connect.AbstractConnectStateListener#ensureCleanup
   * ()
   */
  @Override
  protected void ensureCleanup() {
    getGateway().addHandler(new SimpleChannelUpstreamHandler() {
      public void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
        HostPort hostPort = new HostPort((InetSocketAddress) ctx.getChannel().getRemoteAddress());
        if (connectedClients.contains(hostPort)) {
          log.debug("{} session terminated with outstanding connection, cleaning up", hostPort);
          connectedClients.remove(hostPort);
View Full Code Here

   * @see asia.stampy.server.listener.transaction.AbstractTransactionListener#
   * ensureCleanup()
   */
  @Override
  protected void ensureCleanup() {
    getGateway().addHandler(new SimpleChannelUpstreamHandler() {
      public void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
        HostPort hostPort = new HostPort((InetSocketAddress) ctx.getChannel().getRemoteAddress());
        if (activeTransactions.containsKey(hostPort)) {
          log.debug("{} session terminated with outstanding transaction, cleaning up", hostPort);
          activeTransactions.remove(hostPort);
View Full Code Here

   * @see asia.stampy.server.listener.subscription.
   * AbstractAcknowledgementListenerAndInterceptor#ensureCleanup()
   */
  @Override
  protected void ensureCleanup() {
    getGateway().addHandler(new SimpleChannelUpstreamHandler() {
      public void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
        HostPort hostPort = new HostPort((InetSocketAddress) ctx.getChannel().getRemoteAddress());
        if (messages.containsKey(hostPort)) {
          log.debug("{} session terminated, cleaning up message interceptor", hostPort);
          messages.remove(hostPort);
View Full Code Here

    public void start(int port) throws IOException {
        factory = new NioDatagramChannelFactory();
        ConnectionlessBootstrap bootstrap = new ConnectionlessBootstrap(factory);
        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            public ChannelPipeline getPipeline() throws Exception {
                return Channels.pipeline(new SimpleChannelUpstreamHandler() {
                    @Override
                    public void childChannelOpen(ChannelHandlerContext ctx, ChildChannelStateEvent e) throws Exception {
                        System.out.println("childChannelOpen");
                        setAttribute(ctx, STATE_ATTRIBUTE, State.WAIT_FOR_FIRST_BYTE_LENGTH);
                    }
View Full Code Here

    {
        ThriftFrameDecoder decoder = new DefaultThriftFrameDecoder(MAX_FRAME_SIZE,
                                                                   new TBinaryProtocol.Factory());
        ChannelPipeline pipeline = Channels.pipeline(
                decoder,
                new SimpleChannelUpstreamHandler()
                {
                    @Override
                    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
                            throws Exception
                    {
View Full Code Here

TOP

Related Classes of org.jboss.netty.channel.SimpleChannelUpstreamHandler

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.