Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. @Activate
  2. @Modified
  3.  
  4. protected void activate(BundleContext bundleContext) throws Exception {
  5.  
  6. if(VIMAPConfigurationUtil.enabled()) {
  7.  
  8. if (_log.isInfoEnabled()) {
  9. _log.info("DBG SMTP initServer");
  10. }
  11.  
  12. _nioSocketAcceptor = new NioSocketAcceptor();
  13.  
  14. _nioSocketAcceptor.setReuseAddress(true);
  15.  
  16.  
  17. DefaultIoFilterChainBuilder chain =
  18. _nioSocketAcceptor.getFilterChain();
  19.  
  20. addSSLSupport(chain);
  21.  
  22.  
  23. chain.addLast("logger", new VIMAPLogger());
  24.  
  25.  
  26. chain.addLast("codec", new ProtocolCodecFilter(new
  27. VIMAPCodeFactory(Charset.forName(StringPool.UTF8))));
  28.  
  29.  
  30. _nioSocketAcceptor.setHandler(new DefaultSMTPIoHandler());
  31.  
  32.  
  33. SocketAddress socketAddress = new InetSocketAddress(
  34. VIMAPConfigurationUtil.smtpBindPort());
  35.  
  36. _nioSocketAcceptor.bind(socketAddress);
  37.  
  38.  
  39. }else {
  40. return;
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement