Package org.menacheri.jetclient.event

Examples of org.menacheri.jetclient.event.Event


    }
   
    MessageBuffer<ChannelBuffer> messageBuffer = new NettyMessageBuffer();
    messageBuffer.writeInt(type);
    messageBuffer.writeInt(operation);
    Event event = Events.networkEvent(messageBuffer,DeliveryGuarantyOptions.FAST);
    session.onEvent(event);
  }
View Full Code Here


  @Override
  public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
      throws Exception
  {
    Event event = (Event) e.getMessage();
    session.onEvent(event);
  }
View Full Code Here

  public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
      throws Exception
  {
    System.err.println("Class:DefaultToClientHandler"
        + " Exception occurred in tcp channel: " + e.getCause());
    Event event = Events.event(e, Events.EXCEPTION);
    session.onEvent(event);
  }
View Full Code Here

  public void channelDisconnected(ChannelHandlerContext ctx,
      ChannelStateEvent e) throws Exception
  {
    if (!session.isShuttingDown())
    {
      Event event = Events.event(e, Events.DISCONNECT);
      session.onEvent(event);
    }
    else
    {
      System.err.println("Session is already shutting down. "
View Full Code Here

  public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)
      throws Exception
  {
    if (!session.isShuttingDown())
    {
      Event event = Events.event(e, Events.DISCONNECT);
      session.onEvent(event);
    }
  }
View Full Code Here

  {
    if (null == msg)
    {
      return msg;
    }
    Event event = (Event) msg;
    ChannelBuffer opCode = ChannelBuffers.buffer(1);
    opCode.writeByte(event.getType());
    ChannelBuffer buffer = null;
    if (null != event.getSource())
    {
      @SuppressWarnings("unchecked")
      MessageBuffer<ChannelBuffer> msgBuffer = (MessageBuffer<ChannelBuffer>) event
          .getSource();
      ChannelBuffer data = msgBuffer.getNativeBuffer();
      buffer = ChannelBuffers.wrappedBuffer(opCode, data);
    }
    else
View Full Code Here

      throw new IllegalStateException("DatagramChannel: "
          + datagramChannel
          + " Passed to connect method is not bound");
    }

    Event event = Events.event(null, Events.CONNECT);
    ChannelFuture future = datagramChannel.write(event, serverAddress);
    future.addListener(new ChannelFutureListener()
    {
      @Override
      public void operationComplete(ChannelFuture future)
View Full Code Here

  @Override
  public void removeAttribute(String key)
  {
    sessionAttributes.remove(key);
    Event event = Events.changeAttributeEvent(key, null);
    eventDispatcher.fireEvent(event);
  }
View Full Code Here

  @Override
  public void setAttribute(String key, Object value)
  {
    sessionAttributes.put(key, value);
    Event event = Events.changeAttributeEvent(key, value);
    eventDispatcher.fireEvent(event);
  }
View Full Code Here

    // Connect session using tcp to remote jetserver
    TCPPipelineFactory tcpFactory = new TCPPipelineFactory(session);
    MessageBuffer<ChannelBuffer> buffer = loginHelper
        .getLoginBuffer(localAddress);
    Event loginEvent = Events.event(buffer, Events.LOG_IN);
    // This will in turn invoke the startEventHandler when server sends
    // Events.START event.
    Channel channel = tcpClient.connect(tcpFactory, loginEvent);
    IReliable tcpMessageSender = new NettyTCPMessageSender(channel);
    session.setTcpMessageSender(tcpMessageSender);
View Full Code Here

TOP

Related Classes of org.menacheri.jetclient.event.Event

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.