activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [08/53] [abbrv] [partial] activemq-artemis git commit: automatic checkstyle change
Date Mon, 10 Aug 2015 15:13:07 GMT
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bac96047/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFile.java
----------------------------------------------------------------------
diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFile.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFile.java
index acc0732..c294dbc 100644
--- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFile.java
+++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFile.java
@@ -36,8 +36,7 @@ import org.apache.activemq.artemis.core.io.buffer.TimedBufferObserver;
 import org.apache.activemq.artemis.journal.ActiveMQJournalBundle;
 import org.apache.activemq.artemis.journal.ActiveMQJournalLogger;
 
-public abstract class AbstractSequentialFile implements SequentialFile
-{
+public abstract class AbstractSequentialFile implements SequentialFile {
 
    private File file;
 
@@ -69,8 +68,7 @@ public abstract class AbstractSequentialFile implements SequentialFile
    public AbstractSequentialFile(final File directory,
                                  final String file,
                                  final SequentialFileFactory factory,
-                                 final Executor writerExecutor)
-   {
+                                 final Executor writerExecutor) {
       super();
       this.file = new File(directory, file);
       this.directory = directory;
@@ -80,62 +78,49 @@ public abstract class AbstractSequentialFile implements SequentialFile
 
    // Public --------------------------------------------------------
 
-   public final boolean exists()
-   {
+   public final boolean exists() {
       return file.exists();
    }
 
-   public final String getFileName()
-   {
+   public final String getFileName() {
       return file.getName();
    }
 
-   public final void delete() throws IOException, InterruptedException, ActiveMQException
-   {
-      if (isOpen())
-      {
+   public final void delete() throws IOException, InterruptedException, ActiveMQException {
+      if (isOpen()) {
          close();
       }
 
-      if (file.exists() && !file.delete())
-      {
+      if (file.exists() && !file.delete()) {
          ActiveMQJournalLogger.LOGGER.errorDeletingFile(this);
       }
    }
 
-   public void copyTo(SequentialFile newFileName) throws Exception
-   {
-      try
-      {
+   public void copyTo(SequentialFile newFileName) throws Exception {
+      try {
          ActiveMQJournalLogger.LOGGER.debug("Copying " + this + " as " + newFileName);
-         if (!newFileName.isOpen())
-         {
+         if (!newFileName.isOpen()) {
             newFileName.open();
          }
 
-         if (!isOpen())
-         {
+         if (!isOpen()) {
             this.open();
          }
 
-
          ByteBuffer buffer = ByteBuffer.allocate(10 * 1024);
 
-         for (;;)
-         {
+         for (; ; ) {
             buffer.rewind();
             int size = this.read(buffer);
             newFileName.writeDirect(buffer, false);
-            if (size < 10 * 1024)
-            {
+            if (size < 10 * 1024) {
                break;
             }
          }
          newFileName.close();
          this.close();
       }
-      catch (IOException e)
-      {
+      catch (IOException e) {
          factory.onIOError(new ActiveMQIOErrorException(e.getMessage(), e), e.getMessage(), this);
          throw e;
       }
@@ -145,35 +130,27 @@ public abstract class AbstractSequentialFile implements SequentialFile
     * @throws IOException only declare exception due to signature. Sub-class needs it.
     */
    @Override
-   public void position(final long pos) throws IOException
-   {
+   public void position(final long pos) throws IOException {
       position.set(pos);
    }
 
-   public long position()
-   {
+   public long position() {
       return position.get();
    }
 
-   public final void renameTo(final String newFileName) throws IOException, InterruptedException,
-      ActiveMQException
-   {
-      try
-      {
+   public final void renameTo(final String newFileName) throws IOException, InterruptedException, ActiveMQException {
+      try {
          close();
       }
-      catch (IOException e)
-      {
+      catch (IOException e) {
          factory.onIOError(new ActiveMQIOErrorException(e.getMessage(), e), e.getMessage(), this);
          throw e;
       }
 
       File newFile = new File(directory + "/" + newFileName);
 
-      if (!file.equals(newFile))
-      {
-         if (!file.renameTo(newFile))
-         {
+      if (!file.equals(newFile)) {
+         if (!file.renameTo(newFile)) {
             throw ActiveMQJournalBundle.BUNDLE.ioRenameFileError(file.getName(), newFileName);
          }
          file = newFile;
@@ -181,67 +158,53 @@ public abstract class AbstractSequentialFile implements SequentialFile
    }
 
    /**
-    * @throws IOException      we declare throwing IOException because sub-classes need to do it
+    * @throws IOException       we declare throwing IOException because sub-classes need to do it
     * @throws ActiveMQException
     */
-   public synchronized void close() throws IOException, InterruptedException, ActiveMQException
-   {
+   public synchronized void close() throws IOException, InterruptedException, ActiveMQException {
       final CountDownLatch donelatch = new CountDownLatch(1);
 
-      if (writerExecutor != null)
-      {
-         writerExecutor.execute(new Runnable()
-         {
-            public void run()
-            {
+      if (writerExecutor != null) {
+         writerExecutor.execute(new Runnable() {
+            public void run() {
                donelatch.countDown();
             }
          });
 
-         while (!donelatch.await(60, TimeUnit.SECONDS))
-         {
+         while (!donelatch.await(60, TimeUnit.SECONDS)) {
             ActiveMQJournalLogger.LOGGER.couldNotCompleteTask(new Exception("trace"), file.getName());
          }
       }
    }
 
-   public final boolean fits(final int size)
-   {
-      if (timedBuffer == null)
-      {
+   public final boolean fits(final int size) {
+      if (timedBuffer == null) {
          return position.get() + size <= fileSize;
       }
-      else
-      {
+      else {
          return timedBuffer.checkSize(size);
       }
    }
 
-   public void setTimedBuffer(final TimedBuffer buffer)
-   {
-      if (timedBuffer != null)
-      {
+   public void setTimedBuffer(final TimedBuffer buffer) {
+      if (timedBuffer != null) {
          timedBuffer.setObserver(null);
       }
 
       timedBuffer = buffer;
 
-      if (buffer != null)
-      {
+      if (buffer != null) {
          buffer.setObserver(timedBufferObserver);
       }
 
    }
 
-   public void write(final ActiveMQBuffer bytes, final boolean sync, final IOCallback callback) throws IOException
-   {
-      if (timedBuffer != null)
-      {
+   public void write(final ActiveMQBuffer bytes, final boolean sync, final IOCallback callback) throws IOException {
+      if (timedBuffer != null) {
          bytes.setIndex(0, bytes.capacity());
          timedBuffer.addBytes(bytes, sync, callback);
       }
-      else
-      {
+      else {
          ByteBuffer buffer = factory.newBuffer(bytes.capacity());
          buffer.put(bytes.toByteBuffer().array());
          buffer.rewind();
@@ -249,31 +212,25 @@ public abstract class AbstractSequentialFile implements SequentialFile
       }
    }
 
-   public void write(final ActiveMQBuffer bytes, final boolean sync) throws IOException, InterruptedException,
-      ActiveMQException
-   {
-      if (sync)
-      {
+   public void write(final ActiveMQBuffer bytes,
+                     final boolean sync) throws IOException, InterruptedException, ActiveMQException {
+      if (sync) {
          SimpleWaitIOCallback completion = new SimpleWaitIOCallback();
 
          write(bytes, true, completion);
 
          completion.waitCompletion();
       }
-      else
-      {
+      else {
          write(bytes, false, DummyCallback.getInstance());
       }
    }
 
-   public void write(final EncodingSupport bytes, final boolean sync, final IOCallback callback)
-   {
-      if (timedBuffer != null)
-      {
+   public void write(final EncodingSupport bytes, final boolean sync, final IOCallback callback) {
+      if (timedBuffer != null) {
          timedBuffer.addBytes(bytes, sync, callback);
       }
-      else
-      {
+      else {
          ByteBuffer buffer = factory.newBuffer(bytes.getEncodeSize());
 
          // If not using the TimedBuffer, a final copy is necessary
@@ -287,69 +244,55 @@ public abstract class AbstractSequentialFile implements SequentialFile
       }
    }
 
-   public void write(final EncodingSupport bytes, final boolean sync) throws InterruptedException, ActiveMQException
-   {
-      if (sync)
-      {
+   public void write(final EncodingSupport bytes, final boolean sync) throws InterruptedException, ActiveMQException {
+      if (sync) {
          SimpleWaitIOCallback completion = new SimpleWaitIOCallback();
 
          write(bytes, true, completion);
 
          completion.waitCompletion();
       }
-      else
-      {
+      else {
          write(bytes, false, DummyCallback.getInstance());
       }
    }
 
-   protected File getFile()
-   {
+   protected File getFile() {
       return file;
    }
 
-   private static final class DelegateCallback implements IOCallback
-   {
+   private static final class DelegateCallback implements IOCallback {
+
       final List<IOCallback> delegates;
 
-      private DelegateCallback(final List<IOCallback> delegates)
-      {
+      private DelegateCallback(final List<IOCallback> delegates) {
          this.delegates = delegates;
       }
 
-      public void done()
-      {
-         for (IOCallback callback : delegates)
-         {
-            try
-            {
+      public void done() {
+         for (IOCallback callback : delegates) {
+            try {
                callback.done();
             }
-            catch (Throwable e)
-            {
+            catch (Throwable e) {
                ActiveMQJournalLogger.LOGGER.errorCompletingCallback(e);
             }
          }
       }
 
-      public void onError(final int errorCode, final String errorMessage)
-      {
-         for (IOCallback callback : delegates)
-         {
-            try
-            {
+      public void onError(final int errorCode, final String errorMessage) {
+         for (IOCallback callback : delegates) {
+            try {
                callback.onError(errorCode, errorMessage);
             }
-            catch (Throwable e)
-            {
+            catch (Throwable e) {
                ActiveMQJournalLogger.LOGGER.errorCallingErrorCallback(e);
             }
          }
       }
    }
 
-   protected ByteBuffer newBuffer(int size, int limit)
-   {
+   protected ByteBuffer newBuffer(int size, int limit) {
       size = factory.calculateBlockSize(size);
       limit = factory.calculateBlockSize(limit);
 
@@ -358,50 +301,41 @@ public abstract class AbstractSequentialFile implements SequentialFile
       return buffer;
    }
 
-   protected class LocalBufferObserver implements TimedBufferObserver
-   {
-      public void flushBuffer(final ByteBuffer buffer, final boolean requestedSync, final List<IOCallback> callbacks)
-      {
+   protected class LocalBufferObserver implements TimedBufferObserver {
+
+      public void flushBuffer(final ByteBuffer buffer, final boolean requestedSync, final List<IOCallback> callbacks) {
          buffer.flip();
 
-         if (buffer.limit() == 0)
-         {
+         if (buffer.limit() == 0) {
             factory.releaseBuffer(buffer);
          }
-         else
-         {
+         else {
             writeDirect(buffer, requestedSync, new DelegateCallback(callbacks));
          }
       }
 
-      public ByteBuffer newBuffer(final int size, final int limit)
-      {
+      public ByteBuffer newBuffer(final int size, final int limit) {
          return AbstractSequentialFile.this.newBuffer(size, limit);
       }
 
-      public int getRemainingBytes()
-      {
-         if (fileSize - position.get() > Integer.MAX_VALUE)
-         {
+      public int getRemainingBytes() {
+         if (fileSize - position.get() > Integer.MAX_VALUE) {
             return Integer.MAX_VALUE;
          }
-         else
-         {
-            return (int)(fileSize - position.get());
+         else {
+            return (int) (fileSize - position.get());
          }
       }
 
       @Override
-      public String toString()
-      {
+      public String toString() {
          return "TimedBufferObserver on file (" + getFile().getName() + ")";
       }
 
    }
 
    @Override
-   public File getJavaFile()
-   {
+   public File getJavaFile() {
       return getFile().getAbsoluteFile();
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bac96047/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFileFactory.java
----------------------------------------------------------------------
diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFileFactory.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFileFactory.java
index 61cd0fd..e27f0c5 100644
--- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFileFactory.java
+++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFileFactory.java
@@ -37,8 +37,7 @@ import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
 /**
  * An abstract SequentialFileFactory containing basic functionality for both AIO and NIO SequentialFactories
  */
-public abstract class AbstractSequentialFileFactory implements SequentialFileFactory
-{
+public abstract class AbstractSequentialFileFactory implements SequentialFileFactory {
 
    // Timeout used to wait executors to shutdown
    protected static final int EXECUTOR_TIMEOUT = 60;
@@ -59,25 +58,22 @@ public abstract class AbstractSequentialFileFactory implements SequentialFileFac
     * Asynchronous writes need to be done at another executor.
     * This needs to be done at NIO, or else we would have the callers thread blocking for the return.
     * At AIO this is necessary as context switches on writes would fire flushes at the kernel.
-    *  */
+    */
    protected ExecutorService writeExecutor;
 
    protected AbstractSequentialFileFactory(final File journalDir,
-                                        final boolean buffered,
-                                        final int bufferSize,
-                                        final int bufferTimeout,
-                                        final int maxIO,
-                                        final boolean logRates,
-                                        final IOCriticalErrorListener criticalErrorListener)
-   {
+                                           final boolean buffered,
+                                           final int bufferSize,
+                                           final int bufferTimeout,
+                                           final int maxIO,
+                                           final boolean logRates,
+                                           final IOCriticalErrorListener criticalErrorListener) {
       this.journalDir = journalDir;
 
-      if (buffered && bufferTimeout > 0)
-      {
+      if (buffered && bufferTimeout > 0) {
          timedBuffer = new TimedBuffer(bufferSize, bufferTimeout, logRates);
       }
-      else
-      {
+      else {
          timedBuffer = null;
       }
       this.bufferSize = bufferSize;
@@ -86,135 +82,104 @@ public abstract class AbstractSequentialFileFactory implements SequentialFileFac
       this.maxIO = maxIO;
    }
 
-   public void stop()
-   {
-      if (timedBuffer != null)
-      {
+   public void stop() {
+      if (timedBuffer != null) {
          timedBuffer.stop();
       }
 
-      if (isSupportsCallbacks() && writeExecutor != null)
-      {
+      if (isSupportsCallbacks() && writeExecutor != null) {
          writeExecutor.shutdown();
 
-         try
-         {
-            if (!writeExecutor.awaitTermination(AbstractSequentialFileFactory.EXECUTOR_TIMEOUT, TimeUnit.SECONDS))
-            {
+         try {
+            if (!writeExecutor.awaitTermination(AbstractSequentialFileFactory.EXECUTOR_TIMEOUT, TimeUnit.SECONDS)) {
                ActiveMQJournalLogger.LOGGER.timeoutOnWriterShutdown(new Exception("trace"));
             }
          }
-         catch (InterruptedException e)
-         {
+         catch (InterruptedException e) {
             throw new ActiveMQInterruptedException(e);
          }
       }
    }
 
    @Override
-   public File getDirectory()
-   {
+   public File getDirectory() {
       return journalDir;
    }
 
-   public void start()
-   {
-      if (timedBuffer != null)
-      {
+   public void start() {
+      if (timedBuffer != null) {
          timedBuffer.start();
       }
 
-      if (isSupportsCallbacks())
-      {
-         writeExecutor = Executors.newSingleThreadExecutor(new ActiveMQThreadFactory("ActiveMQ-Asynchronous-Persistent-Writes" + System.identityHashCode(this),
-                                                                                    true,
-                                                                                    AbstractSequentialFileFactory.getThisClassLoader()));
+      if (isSupportsCallbacks()) {
+         writeExecutor = Executors.newSingleThreadExecutor(new ActiveMQThreadFactory("ActiveMQ-Asynchronous-Persistent-Writes" + System.identityHashCode(this), true, AbstractSequentialFileFactory.getThisClassLoader()));
       }
    }
 
-   public int getMaxIO()
-   {
+   public int getMaxIO() {
       return maxIO;
    }
 
    @Override
-   public void onIOError(Exception exception, String message, SequentialFile file)
-   {
-      if (critialErrorListener != null)
-      {
+   public void onIOError(Exception exception, String message, SequentialFile file) {
+      if (critialErrorListener != null) {
          critialErrorListener.onIOException(exception, message, file);
       }
    }
 
    @Override
-   public void activateBuffer(final SequentialFile file)
-   {
-      if (timedBuffer != null)
-      {
+   public void activateBuffer(final SequentialFile file) {
+      if (timedBuffer != null) {
          file.setTimedBuffer(timedBuffer);
       }
    }
 
-   public void flush()
-   {
-      if (timedBuffer != null)
-      {
+   public void flush() {
+      if (timedBuffer != null) {
          timedBuffer.flush();
       }
    }
 
-   public void deactivateBuffer()
-   {
-      if (timedBuffer != null)
-      {
+   public void deactivateBuffer() {
+      if (timedBuffer != null) {
          // When moving to a new file, we need to make sure any pending buffer will be transferred to the buffer
          timedBuffer.flush();
          timedBuffer.setObserver(null);
       }
    }
 
-   public void releaseBuffer(final ByteBuffer buffer)
-   {
+   public void releaseBuffer(final ByteBuffer buffer) {
    }
 
    /**
     * Create the directory if it doesn't exist yet
     */
-   public void createDirs() throws Exception
-   {
+   public void createDirs() throws Exception {
       boolean ok = journalDir.mkdirs();
-      if (!ok)
-      {
+      if (!ok) {
          throw new IOException("Failed to create directory " + journalDir);
       }
    }
 
-   public List<String> listFiles(final String extension) throws Exception
-   {
-      FilenameFilter fnf = new FilenameFilter()
-      {
-         public boolean accept(final File file, final String name)
-         {
+   public List<String> listFiles(final String extension) throws Exception {
+      FilenameFilter fnf = new FilenameFilter() {
+         public boolean accept(final File file, final String name) {
             return name.endsWith("." + extension);
          }
       };
 
       String[] fileNames = journalDir.list(fnf);
 
-      if (fileNames == null)
-      {
+      if (fileNames == null) {
          return Collections.EMPTY_LIST;
       }
 
       return Arrays.asList(fileNames);
    }
 
-   private static ClassLoader getThisClassLoader()
-   {
-      return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
-      {
-         public ClassLoader run()
-         {
+   private static ClassLoader getThisClassLoader() {
+      return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+         public ClassLoader run() {
             return AbstractSequentialFileFactory.class.getClassLoader();
          }
       });

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bac96047/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/DummyCallback.java
----------------------------------------------------------------------
diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/DummyCallback.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/DummyCallback.java
index ce21f2a..cf59fc4 100644
--- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/DummyCallback.java
+++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/DummyCallback.java
@@ -19,31 +19,26 @@ package org.apache.activemq.artemis.core.io;
 import org.apache.activemq.artemis.core.journal.impl.SyncIOCompletion;
 import org.apache.activemq.artemis.journal.ActiveMQJournalLogger;
 
-public class DummyCallback extends SyncIOCompletion
-{
+public class DummyCallback extends SyncIOCompletion {
+
    private static final DummyCallback instance = new DummyCallback();
 
-   public static DummyCallback getInstance()
-   {
+   public static DummyCallback getInstance() {
       return DummyCallback.instance;
    }
 
-   public void done()
-   {
+   public void done() {
    }
 
-   public void onError(final int errorCode, final String errorMessage)
-   {
+   public void onError(final int errorCode, final String errorMessage) {
       ActiveMQJournalLogger.LOGGER.errorWritingData(new Exception(errorMessage), errorMessage, errorCode);
    }
 
    @Override
-   public void waitCompletion() throws Exception
-   {
+   public void waitCompletion() throws Exception {
    }
 
    @Override
-   public void storeLineUp()
-   {
+   public void storeLineUp() {
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bac96047/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOCallback.java
----------------------------------------------------------------------
diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOCallback.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOCallback.java
index 41470e4..8447491 100644
--- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOCallback.java
+++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOCallback.java
@@ -19,15 +19,17 @@ package org.apache.activemq.artemis.core.io;
 /**
  * The interface used for AIO Callbacks.
  */
-public interface IOCallback
-{
+public interface IOCallback {
+
    /**
     * Method for sync notifications. When this callback method is called, there is a guarantee the data is written on the disk.
-    * <br><b>Note:</b><i>Leave this method as soon as possible, or you would be blocking the whole notification thread</i> */
+    * <br><b>Note:</b><i>Leave this method as soon as possible, or you would be blocking the whole notification thread</i>
+    */
    void done();
 
    /**
     * Method for error notifications.
-    * Observation: The whole file will be probably failing if this happens. Like, if you delete the file, you will start to get errors for these operations*/
+    * Observation: The whole file will be probably failing if this happens. Like, if you delete the file, you will start to get errors for these operations
+    */
    void onError(int errorCode, String errorMessage);
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bac96047/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOCriticalErrorListener.java
----------------------------------------------------------------------
diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOCriticalErrorListener.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOCriticalErrorListener.java
index f2da3e8..1a38462 100644
--- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOCriticalErrorListener.java
+++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOCriticalErrorListener.java
@@ -19,7 +19,7 @@ package org.apache.activemq.artemis.core.io;
 /**
  * TODO Merge this with IOExceptionListener
  */
-public interface IOCriticalErrorListener
-{
+public interface IOCriticalErrorListener {
+
    void onIOException(Exception code, String message, SequentialFile file);
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bac96047/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOExceptionListener.java
----------------------------------------------------------------------
diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOExceptionListener.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOExceptionListener.java
index 5c855e5..76e2c02 100644
--- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOExceptionListener.java
+++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOExceptionListener.java
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.artemis.core.io;
 
-public interface IOExceptionListener
-{
+public interface IOExceptionListener {
+
    void onIOException(Exception exception, String message);
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bac96047/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFile.java
----------------------------------------------------------------------
diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFile.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFile.java
index cb9d070..ab61b8d 100644
--- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFile.java
+++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFile.java
@@ -25,8 +25,7 @@ import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.core.journal.EncodingSupport;
 import org.apache.activemq.artemis.core.io.buffer.TimedBuffer;
 
-public interface SequentialFile
-{
+public interface SequentialFile {
 
    boolean isOpen();
 
@@ -36,6 +35,7 @@ public interface SequentialFile
 
    /**
     * The maximum number of simultaneous writes accepted
+    *
     * @param maxIO
     * @throws Exception
     */
@@ -63,31 +63,33 @@ public interface SequentialFile
 
    /**
     * Write directly to the file without using any buffer
+    *
     * @param bytes the ByteBuffer must be compatible with the SequentialFile implementation (AIO or
-    *           NIO). To be safe, use a buffer from the corresponding
-    *           {@link SequentialFileFactory#newBuffer(int)}.
+    *              NIO). To be safe, use a buffer from the corresponding
+    *              {@link SequentialFileFactory#newBuffer(int)}.
     */
    void writeDirect(ByteBuffer bytes, boolean sync, IOCallback callback);
 
    /**
     * Write directly to the file without using intermediate any buffer
+    *
     * @param bytes the ByteBuffer must be compatible with the SequentialFile implementation (AIO or
-    *           NIO). To be safe, use a buffer from the corresponding
-    *           {@link SequentialFileFactory#newBuffer(int)}.
+    *              NIO). To be safe, use a buffer from the corresponding
+    *              {@link SequentialFileFactory#newBuffer(int)}.
     */
    void writeDirect(ByteBuffer bytes, boolean sync) throws Exception;
 
    /**
     * @param bytes the ByteBuffer must be compatible with the SequentialFile implementation (AIO or
-    *           NIO). To be safe, use a buffer from the corresponding
-    *           {@link SequentialFileFactory#newBuffer(int)}.
+    *              NIO). To be safe, use a buffer from the corresponding
+    *              {@link SequentialFileFactory#newBuffer(int)}.
     */
    int read(ByteBuffer bytes, IOCallback callback) throws Exception;
 
    /**
     * @param bytes the ByteBuffer must be compatible with the SequentialFile implementation (AIO or
-    *           NIO). To be safe, use a buffer from the corresponding
-    *           {@link SequentialFileFactory#newBuffer(int)}.
+    *              NIO). To be safe, use a buffer from the corresponding
+    *              {@link SequentialFileFactory#newBuffer(int)}.
     */
    int read(ByteBuffer bytes) throws Exception;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bac96047/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFileFactory.java
----------------------------------------------------------------------
diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFileFactory.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFileFactory.java
index b9a72ca..81203cf 100644
--- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFileFactory.java
+++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFileFactory.java
@@ -21,11 +21,10 @@ import java.nio.ByteBuffer;
 import java.util.List;
 
 /**
- *
  * A SequentialFileFactory
  */
-public interface SequentialFileFactory
-{
+public interface SequentialFileFactory {
+
    SequentialFile createSequentialFile(String fileName);
 
    int getMaxIO();
@@ -34,6 +33,7 @@ public interface SequentialFileFactory
     * Lists files that end with the given extension.
     * <p>
     * This method inserts a ".' before the extension.
+    *
     * @param extension
     * @return
     * @throws Exception
@@ -42,20 +42,27 @@ public interface SequentialFileFactory
 
    boolean isSupportsCallbacks();
 
-   /** The SequentialFile will call this method when a disk IO Error happens during the live phase. */
+   /**
+    * The SequentialFile will call this method when a disk IO Error happens during the live phase.
+    */
    void onIOError(Exception exception, String message, SequentialFile file);
 
-   /** used for cases where you need direct buffer outside of the journal context.
-    *  This is because the native layer has a method that can be reused in certain cases like paging */
+   /**
+    * used for cases where you need direct buffer outside of the journal context.
+    * This is because the native layer has a method that can be reused in certain cases like paging
+    */
    ByteBuffer allocateDirectBuffer(int size);
 
-   /** used for cases where you need direct buffer outside of the journal context.
-    *  This is because the native layer has a method that can be reused in certain cases like paging */
+   /**
+    * used for cases where you need direct buffer outside of the journal context.
+    * This is because the native layer has a method that can be reused in certain cases like paging
+    */
    void releaseDirectBuffer(ByteBuffer buffer);
 
    /**
     * Note: You need to release the buffer if is used for reading operations. You don't need to do
     * it if using writing operations (AIO Buffer Lister will take of writing operations)
+    *
     * @param size
     * @return the allocated ByteBuffer
     */

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bac96047/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFile.java
----------------------------------------------------------------------
diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFile.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFile.java
index 7503681..e011b08 100644
--- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFile.java
+++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFile.java
@@ -34,8 +34,8 @@ import org.apache.activemq.artemis.core.journal.impl.SimpleWaitIOCallback;
 import org.apache.activemq.artemis.jlibaio.LibaioFile;
 import org.apache.activemq.artemis.utils.ReusableLatch;
 
-public class AIOSequentialFile extends AbstractSequentialFile
-{
+public class AIOSequentialFile extends AbstractSequentialFile {
+
    private boolean opened = false;
 
    private LibaioFile aioFile;
@@ -62,32 +62,27 @@ public class AIOSequentialFile extends AbstractSequentialFile
     */
    private long nextReadSequence = 0;
 
-
    public AIOSequentialFile(final AIOSequentialFileFactory factory,
                             final int bufferSize,
                             final long bufferTimeoutMilliseconds,
                             final File directory,
                             final String fileName,
-                            final Executor writerExecutor)
-   {
+                            final Executor writerExecutor) {
       super(directory, fileName, factory, writerExecutor);
       this.aioFactory = factory;
    }
 
-   public boolean isOpen()
-   {
+   public boolean isOpen() {
       return opened;
    }
 
-   public int getAlignment()
-   {
+   public int getAlignment() {
       checkOpened();
 
       return aioFile.getBlockSize();
    }
 
-   public int calculateBlockStart(final int position)
-   {
+   public int calculateBlockStart(final int position) {
       int alignment = getAlignment();
 
       int pos = (position / alignment + (position % alignment != 0 ? 1 : 0)) * alignment;
@@ -95,28 +90,19 @@ public class AIOSequentialFile extends AbstractSequentialFile
       return pos;
    }
 
-   public SequentialFile cloneFile()
-   {
-      return new AIOSequentialFile(aioFactory,
-                                   -1,
-                                   -1,
-                                   getFile().getParentFile(),
-                                   getFile().getName(),
-                                   writerExecutor);
+   public SequentialFile cloneFile() {
+      return new AIOSequentialFile(aioFactory, -1, -1, getFile().getParentFile(), getFile().getName(), writerExecutor);
    }
 
    @Override
-   public synchronized void close() throws IOException, InterruptedException, ActiveMQException
-   {
-      if (!opened)
-      {
+   public synchronized void close() throws IOException, InterruptedException, ActiveMQException {
+      if (!opened) {
          return;
       }
 
       super.close();
 
-      if (!pendingCallbacks.await(10, TimeUnit.SECONDS))
-      {
+      if (!pendingCallbacks.await(10, TimeUnit.SECONDS)) {
          factory.onIOError(new IOException("Timeout on close"), "Timeout on close", this);
       }
 
@@ -128,30 +114,24 @@ public class AIOSequentialFile extends AbstractSequentialFile
       aioFile = null;
    }
 
-
-   public synchronized void fill(final int size) throws Exception
-   {
+   public synchronized void fill(final int size) throws Exception {
       checkOpened();
       aioFile.fill(size);
 
       fileSize = aioFile.getSize();
    }
 
-   public void open() throws Exception
-   {
+   public void open() throws Exception {
       open(aioFactory.getMaxIO(), true);
    }
 
-   public synchronized void open(final int maxIO, final boolean useExecutor) throws ActiveMQException
-   {
+   public synchronized void open(final int maxIO, final boolean useExecutor) throws ActiveMQException {
       opened = true;
 
-      try
-      {
+      try {
          aioFile = aioFactory.libaioContext.openFile(getFile(), true);
       }
-      catch (IOException e)
-      {
+      catch (IOException e) {
          factory.onIOError(e, e.getMessage(), this);
          throw new ActiveMQNativeIOError(e.getMessage(), e);
       }
@@ -161,8 +141,7 @@ public class AIOSequentialFile extends AbstractSequentialFile
       fileSize = aioFile.getSize();
    }
 
-   public int read(final ByteBuffer bytes, final IOCallback callback) throws ActiveMQException
-   {
+   public int read(final ByteBuffer bytes, final IOCallback callback) throws ActiveMQException {
       checkOpened();
       int bytesToRead = bytes.limit();
 
@@ -170,15 +149,13 @@ public class AIOSequentialFile extends AbstractSequentialFile
 
       bytes.rewind();
 
-      try
-      {
+      try {
          // We don't send the buffer to the callback on read,
          // because we want the buffer available.
          // Sending it through the callback would make it released
          aioFile.read(positionToRead, bytesToRead, bytes, getCallback(callback, null));
       }
-      catch (IOException e)
-      {
+      catch (IOException e) {
          factory.onIOError(e, e.getMessage(), this);
          throw new ActiveMQNativeIOError(e.getMessage(), e);
       }
@@ -186,8 +163,7 @@ public class AIOSequentialFile extends AbstractSequentialFile
       return bytesToRead;
    }
 
-   public int read(final ByteBuffer bytes) throws Exception
-   {
+   public int read(final ByteBuffer bytes) throws Exception {
       SimpleWaitIOCallback waitCompletion = new SimpleWaitIOCallback();
 
       int bytesRead = read(bytes, waitCompletion);
@@ -197,28 +173,23 @@ public class AIOSequentialFile extends AbstractSequentialFile
       return bytesRead;
    }
 
-   public void writeDirect(final ByteBuffer bytes, final boolean sync) throws Exception
-   {
-      if (sync)
-      {
+   public void writeDirect(final ByteBuffer bytes, final boolean sync) throws Exception {
+      if (sync) {
          SimpleWaitIOCallback completion = new SimpleWaitIOCallback();
 
          writeDirect(bytes, true, completion);
 
          completion.waitCompletion();
       }
-      else
-      {
+      else {
          writeDirect(bytes, false, DummyCallback.getInstance());
       }
    }
 
    /**
-    *
     * Note: Parameter sync is not used on AIO
-    *  */
-   public void writeDirect(final ByteBuffer bytes, final boolean sync, final IOCallback callback)
-   {
+    */
+   public void writeDirect(final ByteBuffer bytes, final boolean sync, final IOCallback callback) {
       checkOpened();
 
       final int bytesToWrite = factory.calculateBlockSize(bytes.limit());
@@ -227,54 +198,41 @@ public class AIOSequentialFile extends AbstractSequentialFile
 
       AIOSequentialFileFactory.AIOSequentialCallback runnableCallback = getCallback(callback, bytes);
       runnableCallback.initWrite(positionToWrite, bytesToWrite);
-      if (writerExecutor != null)
-      {
+      if (writerExecutor != null) {
          writerExecutor.execute(runnableCallback);
       }
-      else
-      {
+      else {
          runnableCallback.run();
       }
    }
 
-
-
-   AIOSequentialFileFactory.AIOSequentialCallback getCallback(IOCallback originalCallback, ByteBuffer buffer)
-   {
+   AIOSequentialFileFactory.AIOSequentialCallback getCallback(IOCallback originalCallback, ByteBuffer buffer) {
       AIOSequentialFileFactory.AIOSequentialCallback callback = aioFactory.getCallback();
       callback.init(this.nextWritingSequence.getAndIncrement(), originalCallback, aioFile, this, buffer);
       pendingCallbacks.countUp();
       return callback;
    }
 
-
-   void done(AIOSequentialFileFactory.AIOSequentialCallback callback)
-   {
-      if (callback.writeSequence == -1)
-      {
+   void done(AIOSequentialFileFactory.AIOSequentialCallback callback) {
+      if (callback.writeSequence == -1) {
          callback.sequentialDone();
          pendingCallbacks.countDown();
       }
 
-
-      if (callback.writeSequence == nextReadSequence)
-      {
+      if (callback.writeSequence == nextReadSequence) {
          nextReadSequence++;
          callback.sequentialDone();
          pendingCallbacks.countDown();
          flushCallbacks();
       }
-      else
-      {
+      else {
          pendingCallbackList.add(callback);
       }
 
    }
 
-   private void flushCallbacks()
-   {
-      while (!pendingCallbackList.isEmpty() && pendingCallbackList.peek().writeSequence == nextReadSequence)
-      {
+   private void flushCallbacks() {
+      while (!pendingCallbackList.isEmpty() && pendingCallbackList.peek().writeSequence == nextReadSequence) {
          AIOSequentialFileFactory.AIOSequentialCallback callback = pendingCallbackList.poll();
          callback.sequentialDone();
          nextReadSequence++;
@@ -282,26 +240,21 @@ public class AIOSequentialFile extends AbstractSequentialFile
       }
    }
 
-   public void sync()
-   {
+   public void sync() {
       throw new UnsupportedOperationException("This method is not supported on AIO");
    }
 
-   public long size() throws Exception
-   {
-      if (aioFile == null)
-      {
+   public long size() throws Exception {
+      if (aioFile == null) {
          return getFile().length();
       }
-      else
-      {
+      else {
          return aioFile.getSize();
       }
    }
 
    @Override
-   public String toString()
-   {
+   public String toString() {
       return "AIOSequentialFile:" + getFile().getAbsolutePath();
    }
 
@@ -309,8 +262,7 @@ public class AIOSequentialFile extends AbstractSequentialFile
    // -----------------------------------------------------------------------------------------------------
 
    @Override
-   protected ByteBuffer newBuffer(int size, int limit)
-   {
+   protected ByteBuffer newBuffer(int size, int limit) {
       size = factory.calculateBlockSize(size);
       limit = factory.calculateBlockSize(limit);
 
@@ -322,10 +274,8 @@ public class AIOSequentialFile extends AbstractSequentialFile
    // Private methods
    // -----------------------------------------------------------------------------------------------------
 
-   private void checkOpened()
-   {
-      if (aioFile == null || !opened)
-      {
+   private void checkOpened() {
+      if (aioFile == null || !opened) {
          throw new NullPointerException("File not opened, file=null");
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bac96047/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java
----------------------------------------------------------------------
diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java
index 39dad2f..0b80ec6 100644
--- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java
+++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java
@@ -40,8 +40,8 @@ import org.apache.activemq.artemis.jlibaio.util.CallbackCache;
 import org.apache.activemq.artemis.journal.ActiveMQJournalLogger;
 import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
 
-public final class AIOSequentialFileFactory extends AbstractSequentialFileFactory
-{
+public final class AIOSequentialFileFactory extends AbstractSequentialFileFactory {
+
    private static final boolean trace = ActiveMQJournalLogger.LOGGER.isTraceEnabled();
 
    private final ReuseBuffersController buffersControl = new ReuseBuffersController();
@@ -59,37 +59,23 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
    // This method exists just to make debug easier.
    // I could replace log.trace by log.info temporarily while I was debugging
    // Journal
-   private static void trace(final String message)
-   {
+   private static void trace(final String message) {
       ActiveMQJournalLogger.LOGGER.trace(message);
    }
 
-   public AIOSequentialFileFactory(final File journalDir, int maxIO)
-   {
-      this(journalDir,
-           JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO,
-           JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO,
-           maxIO,
-           false,
-           null);
+   public AIOSequentialFileFactory(final File journalDir, int maxIO) {
+      this(journalDir, JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, maxIO, false, null);
    }
 
-   public AIOSequentialFileFactory(final File journalDir, final IOCriticalErrorListener listener, int maxIO)
-   {
-      this(journalDir,
-           JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO,
-           JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO,
-           maxIO,
-           false,
-           listener);
+   public AIOSequentialFileFactory(final File journalDir, final IOCriticalErrorListener listener, int maxIO) {
+      this(journalDir, JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, maxIO, false, listener);
    }
 
    public AIOSequentialFileFactory(final File journalDir,
                                    final int bufferSize,
                                    final int bufferTimeout,
                                    final int maxIO,
-                                   final boolean logRates)
-   {
+                                   final boolean logRates) {
       this(journalDir, bufferSize, bufferTimeout, maxIO, logRates, null);
    }
 
@@ -98,60 +84,44 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
                                    final int bufferTimeout,
                                    final int maxIO,
                                    final boolean logRates,
-                                   final IOCriticalErrorListener listener)
-   {
+                                   final IOCriticalErrorListener listener) {
       super(journalDir, true, bufferSize, bufferTimeout, maxIO, logRates, listener);
       callbackPool = new CallbackCache<>(maxIO);
    }
 
-   public AIOSequentialCallback getCallback()
-   {
+   public AIOSequentialCallback getCallback() {
       AIOSequentialCallback callback = callbackPool.get();
-      if (callback == null)
-      {
+      if (callback == null) {
          callback = new AIOSequentialCallback();
       }
 
       return callback;
    }
 
-   public void enableBufferReuse()
-   {
+   public void enableBufferReuse() {
       this.reuseBuffers = true;
    }
 
-   public void disableBufferReuse()
-   {
+   public void disableBufferReuse() {
       this.reuseBuffers = false;
    }
 
-
-   public SequentialFile createSequentialFile(final String fileName)
-   {
-      return new AIOSequentialFile(this,
-                                   bufferSize,
-                                   bufferTimeout,
-                                   journalDir,
-                                   fileName,
-                                   writeExecutor);
+   public SequentialFile createSequentialFile(final String fileName) {
+      return new AIOSequentialFile(this, bufferSize, bufferTimeout, journalDir, fileName, writeExecutor);
    }
 
-   public boolean isSupportsCallbacks()
-   {
+   public boolean isSupportsCallbacks() {
       return true;
    }
 
-   public static boolean isSupported()
-   {
+   public static boolean isSupported() {
       return LibaioContext.isLoaded();
    }
 
-   public ByteBuffer allocateDirectBuffer(final int size)
-   {
+   public ByteBuffer allocateDirectBuffer(final int size) {
 
       int blocks = size / 512;
-      if (size % 512 != 0)
-      {
+      if (size % 512 != 0) {
          blocks++;
       }
 
@@ -163,42 +133,35 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
       return buffer;
    }
 
-   public void releaseDirectBuffer(final ByteBuffer buffer)
-   {
+   public void releaseDirectBuffer(final ByteBuffer buffer) {
       LibaioContext.freeBuffer(buffer);
    }
 
-   public ByteBuffer newBuffer(int size)
-   {
-      if (size % 512 != 0)
-      {
+   public ByteBuffer newBuffer(int size) {
+      if (size % 512 != 0) {
          size = (size / 512 + 1) * 512;
       }
 
       return buffersControl.newBuffer(size);
    }
 
-   public void clearBuffer(final ByteBuffer directByteBuffer)
-   {
+   public void clearBuffer(final ByteBuffer directByteBuffer) {
       directByteBuffer.position(0);
       libaioContext.memsetBuffer(directByteBuffer);
    }
 
-   public int getAlignment()
-   {
+   public int getAlignment() {
       return 512;
    }
 
    // For tests only
-   public ByteBuffer wrapBuffer(final byte[] bytes)
-   {
+   public ByteBuffer wrapBuffer(final byte[] bytes) {
       ByteBuffer newbuffer = newBuffer(bytes.length);
       newbuffer.put(bytes);
       return newbuffer;
    }
 
-   public int calculateBlockSize(final int position)
-   {
+   public int calculateBlockSize(final int position) {
       int alignment = getAlignment();
 
       int pos = (position / alignment + (position % alignment != 0 ? 1 : 0)) * alignment;
@@ -210,25 +173,20 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
     * @see org.apache.activemq.artemis.core.io.SequentialFileFactory#releaseBuffer(java.nio.ByteBuffer)
     */
    @Override
-   public synchronized void releaseBuffer(final ByteBuffer buffer)
-   {
+   public synchronized void releaseBuffer(final ByteBuffer buffer) {
       LibaioContext.freeBuffer(buffer);
    }
 
    @Override
-   public void start()
-   {
-      if (running.compareAndSet(false, true))
-      {
+   public void start() {
+      if (running.compareAndSet(false, true)) {
          super.start();
 
          this.libaioContext = new LibaioContext(maxIO, true);
 
          this.running.set(true);
 
-         pollerExecutor = Executors.newCachedThreadPool(new ActiveMQThreadFactory("ActiveMQ-AIO-poller-pool" + System.identityHashCode(this),
-                                                                                  true,
-                                                                                  AIOSequentialFileFactory.getThisClassLoader()));
+         pollerExecutor = Executors.newCachedThreadPool(new ActiveMQThreadFactory("ActiveMQ-AIO-poller-pool" + System.identityHashCode(this), true, AIOSequentialFileFactory.getThisClassLoader()));
 
          pollerExecutor.execute(new PollerRunnable());
       }
@@ -236,28 +194,22 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
    }
 
    @Override
-   public void stop()
-   {
-      if (this.running.compareAndSet(true, false))
-      {
+   public void stop() {
+      if (this.running.compareAndSet(true, false)) {
          buffersControl.stop();
 
          libaioContext.close();
          libaioContext = null;
 
-         if (pollerExecutor != null)
-         {
+         if (pollerExecutor != null) {
             pollerExecutor.shutdown();
 
-            try
-            {
-               if (!pollerExecutor.awaitTermination(AbstractSequentialFileFactory.EXECUTOR_TIMEOUT, TimeUnit.SECONDS))
-               {
+            try {
+               if (!pollerExecutor.awaitTermination(AbstractSequentialFileFactory.EXECUTOR_TIMEOUT, TimeUnit.SECONDS)) {
                   ActiveMQJournalLogger.LOGGER.timeoutOnPollerShutdown(new Exception("trace"));
                }
             }
-            catch (InterruptedException e)
-            {
+            catch (InterruptedException e) {
                throw new ActiveMQInterruptedException(e);
             }
          }
@@ -267,8 +219,7 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
    }
 
    @Override
-   protected void finalize()
-   {
+   protected void finalize() {
       stop();
    }
 
@@ -276,8 +227,8 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
     * The same callback is used for Runnable executor.
     * This way we can save some memory over the pool.
     */
-   public class AIOSequentialCallback implements SubmitInfo, Runnable, Comparable<AIOSequentialCallback>
-   {
+   public class AIOSequentialCallback implements SubmitInfo, Runnable, Comparable<AIOSequentialCallback> {
+
       IOCallback callback;
       boolean error = false;
       AIOSequentialFile sequentialFile;
@@ -291,8 +242,7 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
       int bytes;
 
       @Override
-      public String toString()
-      {
+      public String toString() {
          return "AIOSequentialCallback{" +
             "error=" + error +
             ", errorMessage='" + errorMessage + '\'' +
@@ -302,43 +252,38 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
             '}';
       }
 
-      public AIOSequentialCallback initWrite(long positionToWrite, int bytesToWrite)
-      {
+      public AIOSequentialCallback initWrite(long positionToWrite, int bytesToWrite) {
          this.position = positionToWrite;
          this.bytes = bytesToWrite;
          return this;
       }
 
-      public void run()
-      {
-         try
-         {
+      public void run() {
+         try {
             libaioFile.write(position, bytes, buffer, this);
          }
-         catch (IOException e)
-         {
+         catch (IOException e) {
             callback.onError(-1, e.getMessage());
          }
       }
 
-      public int compareTo(AIOSequentialCallback other)
-      {
-         if (this == other || this.writeSequence == other.writeSequence)
-         {
+      public int compareTo(AIOSequentialCallback other) {
+         if (this == other || this.writeSequence == other.writeSequence) {
             return 0;
          }
-         else if (other.writeSequence < this.writeSequence)
-         {
+         else if (other.writeSequence < this.writeSequence) {
             return 1;
          }
-         else
-         {
+         else {
             return -1;
          }
       }
 
-      public AIOSequentialCallback init(long writeSequence, IOCallback IOCallback, LibaioFile libaioFile, AIOSequentialFile sequentialFile, ByteBuffer usedBuffer)
-      {
+      public AIOSequentialCallback init(long writeSequence,
+                                        IOCallback IOCallback,
+                                        LibaioFile libaioFile,
+                                        AIOSequentialFile sequentialFile,
+                                        ByteBuffer usedBuffer) {
          this.callback = IOCallback;
          this.sequentialFile = sequentialFile;
          this.error = false;
@@ -350,8 +295,7 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
       }
 
       @Override
-      public void onError(int errno, String message)
-      {
+      public void onError(int errno, String message) {
          this.error = true;
          this.errorCode = errno;
          this.errorMessage = message;
@@ -360,31 +304,25 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
       /**
        * this is called by libaio.
        */
-      public void done()
-      {
+      public void done() {
          this.sequentialFile.done(this);
       }
 
       /**
        * This is callbed by the AIOSequentialFile, after determined the callbacks were returned in sequence
        */
-      public void sequentialDone()
-      {
+      public void sequentialDone() {
 
-         if (error)
-         {
+         if (error) {
             callback.onError(errorCode, errorMessage);
             errorMessage = null;
          }
-         else
-         {
-            if (callback != null)
-            {
+         else {
+            if (callback != null) {
                callback.done();
             }
 
-            if (buffer != null && reuseBuffers)
-            {
+            if (buffer != null && reuseBuffers) {
                buffersControl.bufferDone(buffer);
             }
 
@@ -393,10 +331,9 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
       }
    }
 
-   private class PollerRunnable implements Runnable
-   {
-      public void run()
-      {
+   private class PollerRunnable implements Runnable {
+
+      public void run() {
          libaioContext.poll();
       }
    }
@@ -404,23 +341,20 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
    /**
     * Class that will control buffer-reuse
     */
-   private class ReuseBuffersController
-   {
+   private class ReuseBuffersController {
+
       private volatile long bufferReuseLastTime = System.currentTimeMillis();
 
       private final ConcurrentLinkedQueue<ByteBuffer> reuseBuffersQueue = new ConcurrentLinkedQueue<ByteBuffer>();
 
       private boolean stopped = false;
 
-      public ByteBuffer newBuffer(final int size)
-      {
+      public ByteBuffer newBuffer(final int size) {
          // if a new buffer wasn't requested in 10 seconds, we clear the queue
          // This is being done this way as we don't need another Timeout Thread
          // just to cleanup this
-         if (bufferSize > 0 && System.currentTimeMillis() - bufferReuseLastTime > 10000)
-         {
-            if (AIOSequentialFileFactory.trace)
-            {
+         if (bufferSize > 0 && System.currentTimeMillis() - bufferReuseLastTime > 10000) {
+            if (AIOSequentialFileFactory.trace) {
                AIOSequentialFileFactory.trace("Clearing reuse buffers queue with " + reuseBuffersQueue.size() +
                                                  " elements");
             }
@@ -432,12 +366,10 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
 
          // if a buffer is bigger than the configured-bufferSize, we just create a new
          // buffer.
-         if (size > bufferSize)
-         {
+         if (size > bufferSize) {
             return LibaioContext.newAlignedBuffer(size, 512);
          }
-         else
-         {
+         else {
             // We need to allocate buffers following the rules of the storage
             // being used (AIO/NIO)
             int alignedSize = calculateBlockSize(size);
@@ -445,15 +377,13 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
             // Try getting a buffer from the queue...
             ByteBuffer buffer = reuseBuffersQueue.poll();
 
-            if (buffer == null)
-            {
+            if (buffer == null) {
                // if empty create a new one.
                buffer = LibaioContext.newAlignedBuffer(size, 512);
 
                buffer.limit(alignedSize);
             }
-            else
-            {
+            else {
                clearBuffer(buffer);
 
                // set the limit of the buffer to the bufferSize being required
@@ -466,43 +396,34 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
          }
       }
 
-      public synchronized void stop()
-      {
+      public synchronized void stop() {
          stopped = true;
          clearPoll();
       }
 
-      public synchronized void clearPoll()
-      {
+      public synchronized void clearPoll() {
          ByteBuffer reusedBuffer;
 
-         while ((reusedBuffer = reuseBuffersQueue.poll()) != null)
-         {
+         while ((reusedBuffer = reuseBuffersQueue.poll()) != null) {
             releaseBuffer(reusedBuffer);
          }
       }
 
-      public void bufferDone(final ByteBuffer buffer)
-      {
-         synchronized (this)
-         {
+      public void bufferDone(final ByteBuffer buffer) {
+         synchronized (this) {
 
-            if (stopped)
-            {
+            if (stopped) {
                releaseBuffer(buffer);
             }
-            else
-            {
+            else {
                bufferReuseLastTime = System.currentTimeMillis();
 
                // If a buffer has any other than the configured bufferSize, the buffer
                // will be just sent to GC
-               if (buffer.capacity() == bufferSize)
-               {
+               if (buffer.capacity() == bufferSize) {
                   reuseBuffersQueue.offer(buffer);
                }
-               else
-               {
+               else {
                   releaseBuffer(buffer);
                }
             }
@@ -510,12 +431,9 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
       }
    }
 
-   private static ClassLoader getThisClassLoader()
-   {
-      return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
-      {
-         public ClassLoader run()
-         {
+   private static ClassLoader getThisClassLoader() {
+      return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+         public ClassLoader run() {
             return AIOSequentialFileFactory.class.getClassLoader();
          }
       });
@@ -523,8 +441,7 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
    }
 
    @Override
-   public String toString()
-   {
+   public String toString() {
       return AIOSequentialFileFactory.class.getSimpleName() + "(buffersControl.stopped=" + buffersControl.stopped +
          "):" + super.toString();
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bac96047/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/ActiveMQFileLock.java
----------------------------------------------------------------------
diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/ActiveMQFileLock.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/ActiveMQFileLock.java
index a184244..e8c9e0c 100644
--- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/ActiveMQFileLock.java
+++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/ActiveMQFileLock.java
@@ -22,26 +22,22 @@ import java.nio.channels.FileLock;
 
 import org.apache.activemq.artemis.jlibaio.LibaioFile;
 
-public class ActiveMQFileLock extends FileLock
-{
+public class ActiveMQFileLock extends FileLock {
 
    private final LibaioFile file;
 
-   public ActiveMQFileLock(final LibaioFile handle)
-   {
-      super((FileChannel)null, 0, 0, false);
+   public ActiveMQFileLock(final LibaioFile handle) {
+      super((FileChannel) null, 0, 0, false);
       this.file = handle;
    }
 
    @Override
-   public boolean isValid()
-   {
+   public boolean isValid() {
       return true;
    }
 
    @Override
-   public void release() throws IOException
-   {
+   public void release() throws IOException {
       file.close();
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bac96047/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBuffer.java
----------------------------------------------------------------------
diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBuffer.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBuffer.java
index a61569a..d72717a 100644
--- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBuffer.java
+++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBuffer.java
@@ -33,8 +33,7 @@ import org.apache.activemq.artemis.core.journal.EncodingSupport;
 import org.apache.activemq.artemis.core.journal.impl.dataformat.ByteArrayEncoding;
 import org.apache.activemq.artemis.journal.ActiveMQJournalLogger;
 
-public class TimedBuffer
-{
+public class TimedBuffer {
    // Constants -----------------------------------------------------
 
    // The number of tries on sleep before switching to spin
@@ -96,14 +95,12 @@ public class TimedBuffer
 
    // Public --------------------------------------------------------
 
-   public TimedBuffer(final int size, final int timeout, final boolean logRates)
-   {
+   public TimedBuffer(final int size, final int timeout, final boolean logRates) {
       bufferSize = size;
 
       this.logRates = logRates;
 
-      if (logRates)
-      {
+      if (logRates) {
          logRatesTimer = new Timer(true);
       }
       // Setting the interval for nano-sleeps
@@ -120,30 +117,24 @@ public class TimedBuffer
    }
 
    // for Debug purposes
-   public synchronized boolean isUseSleep()
-   {
+   public synchronized boolean isUseSleep() {
       return useSleep;
    }
 
-   public synchronized void setUseSleep(boolean useSleep)
-   {
+   public synchronized void setUseSleep(boolean useSleep) {
       this.useSleep = useSleep;
    }
 
-   public synchronized void start()
-   {
-      if (started)
-      {
+   public synchronized void start() {
+      if (started) {
          return;
       }
 
       // Need to start with the spin limiter acquired
-      try
-      {
+      try {
          spinLimiter.acquire();
       }
-      catch (InterruptedException e)
-      {
+      catch (InterruptedException e) {
          throw new ActiveMQInterruptedException(e);
       }
 
@@ -153,8 +144,7 @@ public class TimedBuffer
 
       timerThread.start();
 
-      if (logRates)
-      {
+      if (logRates) {
          logRatesTimerTask = new LogRatesTimerTask();
 
          logRatesTimer.scheduleAtFixedRate(logRatesTimerTask, 2000, 2000);
@@ -163,10 +153,8 @@ public class TimedBuffer
       started = true;
    }
 
-   public void stop()
-   {
-      if (!started)
-      {
+   public void stop() {
+      if (!started) {
          return;
       }
 
@@ -178,19 +166,15 @@ public class TimedBuffer
 
       spinLimiter.release();
 
-      if (logRates)
-      {
+      if (logRates) {
          logRatesTimerTask.cancel();
       }
 
-      while (timerThread.isAlive())
-      {
-         try
-         {
+      while (timerThread.isAlive()) {
+         try {
             timerThread.join();
          }
-         catch (InterruptedException e)
-         {
+         catch (InterruptedException e) {
             throw new ActiveMQInterruptedException(e);
          }
       }
@@ -198,10 +182,8 @@ public class TimedBuffer
       started = false;
    }
 
-   public synchronized void setObserver(final TimedBufferObserver observer)
-   {
-      if (bufferObserver != null)
-      {
+   public synchronized void setObserver(final TimedBufferObserver observer) {
+      if (bufferObserver != null) {
          flush();
       }
 
@@ -213,21 +195,17 @@ public class TimedBuffer
     *
     * @param sizeChecked
     */
-   public synchronized boolean checkSize(final int sizeChecked)
-   {
-      if (!started)
-      {
+   public synchronized boolean checkSize(final int sizeChecked) {
+      if (!started) {
          throw new IllegalStateException("TimedBuffer is not started");
       }
 
-      if (sizeChecked > bufferSize)
-      {
+      if (sizeChecked > bufferSize) {
          throw new IllegalStateException("Can't write records bigger than the bufferSize(" + bufferSize +
                                             ") on the journal");
       }
 
-      if (bufferLimit == 0 || buffer.writerIndex() + sizeChecked > bufferLimit)
-      {
+      if (bufferLimit == 0 || buffer.writerIndex() + sizeChecked > bufferLimit) {
          // Either there is not enough space left in the buffer for the sized record
          // Or a flush has just been performed and we need to re-calcualate bufferLimit
 
@@ -237,12 +215,10 @@ public class TimedBuffer
 
          final int remainingInFile = bufferObserver.getRemainingBytes();
 
-         if (sizeChecked > remainingInFile)
-         {
+         if (sizeChecked > remainingInFile) {
             return false;
          }
-         else
-         {
+         else {
             // There is enough space in the file for this size
 
             // Need to re-calculate buffer limit
@@ -252,23 +228,19 @@ public class TimedBuffer
             return true;
          }
       }
-      else
-      {
+      else {
          delayFlush = true;
 
          return true;
       }
    }
 
-   public synchronized void addBytes(final ActiveMQBuffer bytes, final boolean sync, final IOCallback callback)
-   {
+   public synchronized void addBytes(final ActiveMQBuffer bytes, final boolean sync, final IOCallback callback) {
       addBytes(new ByteArrayEncoding(bytes.toByteBuffer().array()), sync, callback);
    }
 
-   public synchronized void addBytes(final EncodingSupport bytes, final boolean sync, final IOCallback callback)
-   {
-      if (!started)
-      {
+   public synchronized void addBytes(final EncodingSupport bytes, final boolean sync, final IOCallback callback) {
+      if (!started) {
          throw new IllegalStateException("TimedBuffer is not started");
       }
 
@@ -278,8 +250,7 @@ public class TimedBuffer
 
       callbacks.add(callback);
 
-      if (sync)
-      {
+      if (sync) {
          pendingSync = true;
 
          startSpin();
@@ -287,8 +258,7 @@ public class TimedBuffer
 
    }
 
-   public void flush()
-   {
+   public void flush() {
       flush(false);
    }
 
@@ -296,21 +266,16 @@ public class TimedBuffer
     * force means the Journal is moving to a new file. Any pending write need to be done immediately
     * or data could be lost
     */
-   public void flush(final boolean force)
-   {
-      synchronized (this)
-      {
-         if (!started)
-         {
+   public void flush(final boolean force) {
+      synchronized (this) {
+         if (!started) {
             throw new IllegalStateException("TimedBuffer is not started");
          }
 
-         if ((force || !delayFlush) && buffer.writerIndex() > 0)
-         {
+         if ((force || !delayFlush) && buffer.writerIndex() > 0) {
             int pos = buffer.writerIndex();
 
-            if (logRates)
-            {
+            if (logRates) {
                bytesFlushed.addAndGet(pos);
             }
 
@@ -348,8 +313,8 @@ public class TimedBuffer
 
    // Inner classes -------------------------------------------------
 
-   private class LogRatesTimerTask extends TimerTask
-   {
+   private class LogRatesTimerTask extends TimerTask {
+
       private boolean closed;
 
       private long lastExecution;
@@ -359,17 +324,14 @@ public class TimedBuffer
       private long lastFlushesDone;
 
       @Override
-      public synchronized void run()
-      {
-         if (!closed)
-         {
+      public synchronized void run() {
+         if (!closed) {
             long now = System.currentTimeMillis();
 
             long bytesF = bytesFlushed.get();
             long flushesD = flushesDone.get();
 
-            if (lastExecution != 0)
-            {
+            if (lastExecution != 0) {
                double rate = 1000 * (double) (bytesF - lastBytesFlushed) / (now - lastExecution);
                ActiveMQJournalLogger.LOGGER.writeRate(rate, (long) (rate / (1024 * 1024)));
                double flushRate = 1000 * (double) (flushesD - lastFlushesDone) / (now - lastExecution);
@@ -385,16 +347,15 @@ public class TimedBuffer
       }
 
       @Override
-      public synchronized boolean cancel()
-      {
+      public synchronized boolean cancel() {
          closed = true;
 
          return super.cancel();
       }
    }
 
-   private class CheckTimer implements Runnable
-   {
+   private class CheckTimer implements Runnable {
+
       private volatile boolean closed = false;
 
       int checks = 0;
@@ -404,28 +365,22 @@ public class TimedBuffer
       final int sleepMillis = timeout / 1000000; // truncates
       final int sleepNanos = timeout % 1000000;
 
-
-      public void run()
-      {
+      public void run() {
          long lastFlushTime = 0;
 
-         while (!closed)
-         {
+         while (!closed) {
             // We flush on the timer if there are pending syncs there and we've waited at least one
             // timeout since the time of the last flush.
             // Effectively flushing "resets" the timer
             // On the timeout verification, notice that we ignore the timeout check if we are using sleep
 
-            if (pendingSync)
-            {
-               if (isUseSleep())
-               {
+            if (pendingSync) {
+               if (isUseSleep()) {
                   // if using sleep, we will always flush
                   flush();
                   lastFlushTime = System.nanoTime();
                }
-               else if (bufferObserver != null && System.nanoTime() > lastFlushTime + timeout)
-               {
+               else if (bufferObserver != null && System.nanoTime() > lastFlushTime + timeout) {
                   // if not using flush we will spin and do the time checks manually
                   flush();
                   lastFlushTime = System.nanoTime();
@@ -435,16 +390,14 @@ public class TimedBuffer
 
             sleepIfPossible();
 
-            try
-            {
+            try {
                spinLimiter.acquire();
 
                Thread.yield();
 
                spinLimiter.release();
             }
-            catch (InterruptedException e)
-            {
+            catch (InterruptedException e) {
                throw new ActiveMQInterruptedException(e);
             }
          }
@@ -455,43 +408,33 @@ public class TimedBuffer
        * we will on that case verify up to MAX_CHECKS if nano sleep is behaving well.
        * if more than 50% of the checks have failed we will cancel the sleep and just use regular spin
        */
-      private void sleepIfPossible()
-      {
-         if (isUseSleep())
-         {
-            if (checks < MAX_CHECKS_ON_SLEEP)
-            {
+      private void sleepIfPossible() {
+         if (isUseSleep()) {
+            if (checks < MAX_CHECKS_ON_SLEEP) {
                timeBefore = System.nanoTime();
             }
 
-            try
-            {
+            try {
                sleep(sleepMillis, sleepNanos);
             }
-            catch (InterruptedException e)
-            {
+            catch (InterruptedException e) {
                throw new ActiveMQInterruptedException(e);
             }
-            catch (Exception e)
-            {
+            catch (Exception e) {
                setUseSleep(false);
                ActiveMQJournalLogger.LOGGER.warn(e.getMessage() + ", disabling sleep on TimedBuffer, using spin now", e);
             }
 
-            if (checks < MAX_CHECKS_ON_SLEEP)
-            {
+            if (checks < MAX_CHECKS_ON_SLEEP) {
                long realTimeSleep = System.nanoTime() - timeBefore;
 
                // I'm letting the real time to be up to 50% than the requested sleep.
-               if (realTimeSleep > timeout * 1.5)
-               {
+               if (realTimeSleep > timeout * 1.5) {
                   failedChecks++;
                }
 
-               if (++checks >= MAX_CHECKS_ON_SLEEP)
-               {
-                  if (failedChecks > MAX_CHECKS_ON_SLEEP * 0.5)
-                  {
+               if (++checks >= MAX_CHECKS_ON_SLEEP) {
+                  if (failedChecks > MAX_CHECKS_ON_SLEEP * 0.5) {
                      ActiveMQJournalLogger.LOGGER.debug("Thread.sleep with nano seconds is not working as expected, Your kernel possibly doesn't support real time. the Journal TimedBuffer will spin for timeouts");
                      setUseSleep(false);
                   }
@@ -500,8 +443,7 @@ public class TimedBuffer
          }
       }
 
-      public void close()
-      {
+      public void close() {
          closed = true;
       }
    }
@@ -513,26 +455,21 @@ public class TimedBuffer
     * @param sleepNanos
     * @throws InterruptedException
     */
-   protected void sleep(int sleepMillis, int sleepNanos) throws InterruptedException
-   {
+   protected void sleep(int sleepMillis, int sleepNanos) throws InterruptedException {
       Thread.sleep(sleepMillis, sleepNanos);
    }
 
    /**
     * Sub classes (tests basically) can use this to override disabling spinning
     */
-   protected void stopSpin()
-   {
-      if (spinning)
-      {
-         try
-         {
+   protected void stopSpin() {
+      if (spinning) {
+         try {
             // We acquire the spinLimiter semaphore - this prevents the timer flush thread unnecessarily spinning
             // when the buffer is inactive
             spinLimiter.acquire();
          }
-         catch (InterruptedException e)
-         {
+         catch (InterruptedException e) {
             throw new ActiveMQInterruptedException(e);
          }
 
@@ -540,19 +477,15 @@ public class TimedBuffer
       }
    }
 
-
    /**
     * Sub classes (tests basically) can use this to override disabling spinning
     */
-   protected void startSpin()
-   {
-      if (!spinning)
-      {
+   protected void startSpin() {
+      if (!spinning) {
          spinLimiter.release();
 
          spinning = true;
       }
    }
 
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bac96047/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBufferObserver.java
----------------------------------------------------------------------
diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBufferObserver.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBufferObserver.java
index 7a9659f..7812531 100644
--- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBufferObserver.java
+++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBufferObserver.java
@@ -21,9 +21,7 @@ import java.util.List;
 
 import org.apache.activemq.artemis.core.io.IOCallback;
 
-
-public interface TimedBufferObserver
-{
+public interface TimedBufferObserver {
 
    // Constants -----------------------------------------------------
 
@@ -37,7 +35,9 @@ public interface TimedBufferObserver
 
    void flushBuffer(ByteBuffer buffer, boolean syncRequested, List<IOCallback> callbacks);
 
-   /** Return the number of remaining bytes that still fit on the observer (file) */
+   /**
+    * Return the number of remaining bytes that still fit on the observer (file)
+    */
    int getRemainingBytes();
 
    ByteBuffer newBuffer(int size, int limit);


Mime
View raw message