Author: borges
Date: 2011-10-05 12:41:58 -0400 (Wed, 05 Oct 2011)
New Revision: 11470
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientLargeMessageImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerCreditsImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/CompressedLargeMessageControllerImpl.java
Log:
visibility fixes
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerImpl.java 2011-10-04
19:08:27 UTC (rev 11469)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerImpl.java 2011-10-05
16:41:58 UTC (rev 11470)
@@ -50,9 +50,9 @@
private static final boolean trace = ClientConsumerImpl.log.isTraceEnabled();
- public static final long CLOSE_TIMEOUT_MILLISECONDS = 10000;
+ private static final long CLOSE_TIMEOUT_MILLISECONDS = 10000;
- public static final int NUM_PRIORITIES = 10;
+ private static final int NUM_PRIORITIES = 10;
public static final SimpleString FORCED_DELIVERY_MESSAGE = new
SimpleString("_hornetq.forced.delivery.seq");
@@ -642,11 +642,11 @@
}
}
- /**
- *
+ /**
+ *
* LargeMessageBuffer will call flowcontrol here, while other handleMessage will also
be calling flowControl.
* So, this operation needs to be atomic.
- *
+ *
* @param discountSlowConsumer When dealing with slowConsumers, we need to discount
one credit that was pre-sent when the first receive was called. For largeMessage that is
only done at the latest packet
*/
public void flowControl(final int messageBytes, final boolean discountSlowConsumer)
throws HornetQException
@@ -707,7 +707,7 @@
// Private
//
---------------------------------------------------------------------------------------
- /**
+ /**
* Sending a initial credit for slow consumers
* */
private void startSlowConsumer()
@@ -741,7 +741,7 @@
{
ClientConsumerImpl.log.trace("Adding Runner on Executor for
delivery");
}
-
+
sessionExecutor.execute(runner);
}
@@ -824,7 +824,7 @@
//Ignore, this could be a relic from a previous receiveImmediate();
return;
}
-
+
boolean expired = message.isExpired();
flowControlBeforeConsumption(message);
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientLargeMessageImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientLargeMessageImpl.java 2011-10-04
19:08:27 UTC (rev 11469)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientLargeMessageImpl.java 2011-10-05
16:41:58 UTC (rev 11470)
@@ -23,9 +23,10 @@
import org.hornetq.utils.DataConstants;
/**
- * ClientLargeMessageImpl is only created when receiving large messages. At the time of
sending a regular Message is sent as we won't know the message is considered large
+ * ClientLargeMessageImpl is only created when receiving large messages.
+ * <p>
+ * At the time of sending a regular Message is sent as we won't know the message is
considered large
* until the buffer is filled up or the user set a streaming.
- *
* @author clebertsuconic
*/
public class ClientLargeMessageImpl extends ClientMessageImpl implements
ClientLargeMessageInternal
@@ -209,11 +210,11 @@
// Inner classes -------------------------------------------------
- protected class HornetQOutputStream extends OutputStream
+ private class HornetQOutputStream extends OutputStream
{
- HornetQBuffer bufferOut;
+ private final HornetQBuffer bufferOut;
- HornetQOutputStream(HornetQBuffer out)
+ private HornetQOutputStream(HornetQBuffer out)
{
this.bufferOut = out;
}
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerCreditsImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerCreditsImpl.java 2011-10-04
19:08:27 UTC (rev 11469)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerCreditsImpl.java 2011-10-05
16:41:58 UTC (rev 11470)
@@ -25,7 +25,7 @@
*
*
*/
-public class ClientProducerCreditsImpl implements ClientProducerCredits
+class ClientProducerCreditsImpl implements ClientProducerCredits
{
private static final Logger log = Logger.getLogger(ClientProducerCreditsImpl.class);
@@ -38,10 +38,10 @@
private final ClientSessionInternal session;
private int arriving;
-
+
private int refCount;
-
- public ClientProducerCreditsImpl(final ClientSessionInternal session,
+
+ ClientProducerCreditsImpl(final ClientSessionInternal session,
final SimpleString address,
final int windowSize)
{
@@ -73,7 +73,7 @@
{
arriving -= credits;
}
-
+
semaphore.release(credits);
}
@@ -84,7 +84,7 @@
semaphore.drainPermits();
int beforeFailure = arriving;
-
+
arriving = 0;
// If we are waiting for more credits than what's configured, then we need to
use what we tried before
@@ -98,22 +98,22 @@
semaphore.release(Integer.MAX_VALUE / 2);
}
-
+
public synchronized void incrementRefCount()
{
refCount++;
}
-
+
public synchronized int decrementRefCount()
{
return --refCount;
}
-
+
public synchronized void releaseOutstanding()
{
semaphore.drainPermits();
}
-
+
private void checkCredits(final int credits)
{
int needed = Math.max(credits, windowSize);
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerImpl.java 2011-10-04
19:08:27 UTC (rev 11469)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerImpl.java 2011-10-05
16:41:58 UTC (rev 11470)
@@ -36,13 +36,13 @@
/**
* The client-side Producer connectionFactory class.
- *
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:clebert.suconic@jboss.org">Clebert
Suconic</a>
* @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
* @version <tt>$Revision$</tt> $Id$
*/
-public class ClientProducerImpl implements ClientProducerInternal
+class ClientProducerImpl implements ClientProducerInternal
{
// Constants
------------------------------------------------------------------------------------
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-10-04
19:08:27 UTC (rev 11469)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-10-05
16:41:58 UTC (rev 11470)
@@ -145,7 +145,7 @@
private volatile boolean closed;
- public final Exception e = new Exception();
+ private final Exception e = new Exception();
private final Object waitLock = new Object();
@@ -155,7 +155,7 @@
// Constructors
// ---------------------------------------------------------------------------------
- public ClientSessionFactoryImpl(final ServerLocatorInternal serverLocator,
+ ClientSessionFactoryImpl(final ServerLocatorInternal serverLocator,
final TransportConfiguration connectorConfig,
final long callTimeout,
final long clientFailureCheckPeriod,
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionImpl.java 2011-10-04
19:08:27 UTC (rev 11469)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionImpl.java 2011-10-05
16:41:58 UTC (rev 11470)
@@ -95,13 +95,8 @@
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
*
* @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
- *
- * @version <tt>$Revision: 3603 $</tt> $Id: ClientSessionImpl.java 3603
2008-01-21 18:49:20Z timfox $
- *
- * $Id: ClientSessionImpl.java 3603 2008-01-21 18:49:20Z timfox $
- *
*/
-public class ClientSessionImpl implements ClientSessionInternal, FailureListener,
CommandConfirmationHandler
+class ClientSessionImpl implements ClientSessionInternal, FailureListener,
CommandConfirmationHandler
{
// Constants
----------------------------------------------------------------------------
@@ -195,7 +190,7 @@
// Constructors
----------------------------------------------------------------------------
- public ClientSessionImpl(final ClientSessionFactoryInternal sessionFactory,
+ ClientSessionImpl(final ClientSessionFactoryInternal sessionFactory,
final String name,
final String username,
final String password,
@@ -665,7 +660,7 @@
stop(true);
}
- public void stop(final boolean waitForOnMessage) throws HornetQException
+ private void stop(final boolean waitForOnMessage) throws HornetQException
{
checkClosed();
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/CompressedLargeMessageControllerImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/CompressedLargeMessageControllerImpl.java 2011-10-04
19:08:27 UTC (rev 11469)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/CompressedLargeMessageControllerImpl.java 2011-10-05
16:41:58 UTC (rev 11470)
@@ -40,7 +40,7 @@
*
*
*/
-public class CompressedLargeMessageControllerImpl implements LargeMessageController
+class CompressedLargeMessageControllerImpl implements LargeMessageController
{
// Constants -----------------------------------------------------
@@ -51,13 +51,13 @@
// Attributes ----------------------------------------------------
- final LargeMessageController bufferDelegate;
-
+ private final LargeMessageController bufferDelegate;
+
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
- public CompressedLargeMessageControllerImpl(final LargeMessageController
bufferDelegate)
+ CompressedLargeMessageControllerImpl(final LargeMessageController bufferDelegate)
{
this.bufferDelegate = bufferDelegate;
}
@@ -66,7 +66,7 @@
// Public --------------------------------------------------------
/**
- *
+ *
*/
public void discardUnusedPackets()
{
@@ -104,7 +104,7 @@
}
/**
- *
+ *
* @param timeWait Milliseconds to Wait. 0 means forever
* @throws Exception
*/
@@ -130,9 +130,9 @@
{
return -1;
}
-
+
DataInputStream dataInput = null;
-
+
private DataInputStream getStream()
{
if (dataInput == null)
@@ -140,18 +140,18 @@
try
{
InputStream input = new HornetQBufferInputStream(bufferDelegate);
-
+
dataInput = new DataInputStream(new InflaterReader(input));
}
catch (Exception e)
{
throw new RuntimeException (e.getMessage(), e);
}
-
+
}
return dataInput;
}
-
+
private void positioningNotSupported()
{
throw new IllegalStateException("Position not supported over compressed large
messages");
@@ -300,9 +300,9 @@
positioningNotSupported();
return 0;
}
-
-
+
+
public int getUnsignedMedium(final long index)
{
positioningNotSupported();
@@ -579,7 +579,7 @@
{
try
{
- return (short)getStream().readShort();
+ return getStream().readShort();
}
catch (Exception e)
{
@@ -591,7 +591,7 @@
{
try
{
- return (int)getStream().readUnsignedShort();
+ return getStream().readUnsignedShort();
}
catch (Exception e)
{
@@ -609,7 +609,7 @@
return value;
}
-
+
public int readUnsignedMedium()
{
return (readByte() & 0xff) << 16 | (readByte() & 0xff) << 8 |
(readByte() & 0xff) << 0;
@@ -708,7 +708,7 @@
public void skipBytes(final int length)
{
-
+
try
{
for (int i = 0 ; i < length; i++)
@@ -827,7 +827,7 @@
{
return (char)readShort();
}
-
+
public char getChar(final int index)
{
return (char)getShort(index);