Author: norman Date: Thu Sep 15 06:19:01 2011 New Revision: 1170967 URL: http://svn.apache.org/viewvc?rev=1170967&view=rev Log: Use a static instance of ResponseEncoder as the class is shareable
Modified: james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/netty/LMTPServer.java james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3ResponseEncoder.java james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3Server.java Modified: james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/netty/LMTPServer.java URL: http://svn.apache.org/viewvc/james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/netty/LMTPServer.java?rev=1170967&r1=1170966&r2=1170967&view=diff ============================================================================== --- james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/netty/LMTPServer.java (original) +++ james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/netty/LMTPServer.java Thu Sep 15 06:19:01 2011 @@ -34,6 +34,8 @@ import org.jboss.netty.handler.codec.one public class LMTPServer extends AbstractProtocolAsyncServer implements LMTPServerMBean { + private final static SMTPResponseEncoder ENCODER = new SMTPResponseEncoder(); + /** * The maximum message size allowed by this SMTP server. The default value, * 0, means no limit. @@ -198,7 +200,7 @@ public class LMTPServer extends Abstract @Override protected OneToOneEncoder createEncoder() { - return new SMTPResponseEncoder(); + return ENCODER; } @Override Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3ResponseEncoder.java URL: http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3ResponseEncoder.java?rev=1170967&r1=1170966&r2=1170967&view=diff ============================================================================== --- james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3ResponseEncoder.java (original) +++ james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3ResponseEncoder.java Thu Sep 15 06:19:01 2011 @@ -24,11 +24,14 @@ import java.util.List; import org.apache.james.pop3server.POP3Response; import org.apache.james.protocols.impl.AbstractResponseEncoder; +import org.jboss.netty.channel.ChannelHandler.Sharable; + /** * {@link AbstractResponseEncoder} implementation which handles * {@link POP3Response} messages */ +@Sharable public class POP3ResponseEncoder extends AbstractResponseEncoder<POP3Response> { public POP3ResponseEncoder() { Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3Server.java URL: http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3Server.java?rev=1170967&r1=1170966&r2=1170967&view=diff ============================================================================== --- james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3Server.java (original) +++ james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3Server.java Thu Sep 15 06:19:01 2011 @@ -31,6 +31,7 @@ import org.jboss.netty.handler.codec.one */ public class POP3Server extends AbstractProtocolAsyncServer implements POP3ServerMBean { + private final static POP3ResponseEncoder POP3_RESPONSE_ENCODER = new POP3ResponseEncoder(); /** * The configuration data to be passed to the handler */ @@ -90,7 +91,7 @@ public class POP3Server extends Abstract @Override protected OneToOneEncoder createEncoder() { - return new POP3ResponseEncoder(); + return POP3_RESPONSE_ENCODER; } --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org