Author: borges
Date: 2011-07-01 08:24:27 -0400 (Fri, 01 Jul 2011)
New Revision: 10906
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/PacketDecoder.java
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java
Log:
Reduce visibility.
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/PacketDecoder.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/PacketDecoder.java 2011-07-01
12:23:52 UTC (rev 10905)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/PacketDecoder.java 2011-07-01
12:24:27 UTC (rev 10906)
@@ -85,7 +85,6 @@
import static org.hornetq.core.protocol.core.impl.PacketImpl.SUBSCRIBE_TOPOLOGY;
import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.logging.Logger;
import org.hornetq.core.protocol.core.Packet;
import org.hornetq.core.protocol.core.impl.wireformat.ClusterTopologyChangeMessage;
import org.hornetq.core.protocol.core.impl.wireformat.CreateQueueMessage;
@@ -157,15 +156,17 @@
* A PacketDecoder
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- *
*/
-public class PacketDecoder
+public final class PacketDecoder
{
- private static final Logger log = Logger.getLogger(PacketDecoder.class);
-
- public Packet decode(final HornetQBuffer in)
+
+ private PacketDecoder()
{
+ // Utility
+ }
+
+ public static Packet decode(final HornetQBuffer in)
+ {
final byte packetType = in.readByte();
Packet packet;
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java 2011-07-01
12:23:52 UTC (rev 10905)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java 2011-07-01
12:24:27 UTC (rev 10906)
@@ -80,8 +80,6 @@
private final Object failLock = new Object();
- private final PacketDecoder decoder = new PacketDecoder();
-
private volatile boolean dataReceived;
private final Executor executor;
@@ -418,7 +416,7 @@
{
try
{
- final Packet packet = decoder.decode(buffer);
+ final Packet packet = PacketDecoder.decode(buffer);
if (packet.isAsyncExec() && executor != null)
{