Advertisement
Tyluur

Untitled

Jun 29th, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. package com.tyluur.network;
  2.  
  3. import org.jboss.netty.channel.ChannelPipeline;
  4. import org.jboss.netty.channel.ChannelPipelineFactory;
  5. import org.jboss.netty.channel.Channels;
  6.  
  7. import com.tyluur.network.decoders.ClientDecoder;
  8.  
  9. public final class SevadorPipeline implements ChannelPipelineFactory {
  10.  
  11. /**
  12. * The instance of the handler which will be handling packets.
  13. */
  14.  
  15. private static final String HANDLER = "handler",
  16.  
  17. /**
  18. * The instance of the decoder which will be decoding packets sent to the server.
  19. */
  20.  
  21. DECODER = "decoder",
  22.  
  23. /**
  24. * The instance of the encoder - task is to encode packets
  25. */
  26.  
  27. ENCODER = "encoder";
  28.  
  29. @Override
  30. public ChannelPipeline getPipeline() throws Exception {
  31. ChannelPipeline pipeline = Channels.pipeline();
  32. pipeline.addLast(DECODER, new ClientDecoder());
  33. pipeline.addLast(HANDLER, new SevadorHandler());
  34. return pipeline;
  35. }
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement