You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2007/08/09 18:40:08 UTC
svn commit: r564271 [6/18] - in /activemq/trunk:
activemq-core/src/main/java/org/apache/activemq/
activemq-core/src/main/java/org/apache/activemq/advisory/
activemq-core/src/main/java/org/apache/activemq/blob/
activemq-core/src/main/java/org/apache/act...
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java Thu Aug 9 09:37:49 2007
@@ -1,21 +1,19 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.activemq.kaha.impl;
import java.io.File;
@@ -55,11 +53,12 @@
*/
public class KahaStore implements Store {
- private final static String PROPERTY_PREFIX = "org.apache.activemq.kaha.Store";
- private final static boolean brokenFileLock = "true".equals(System.getProperty(PROPERTY_PREFIX + ".FileLockBroken", "false"));
- private final static boolean disableLocking = "true".equals(System.getProperty(PROPERTY_PREFIX + ".DisableLocking", "false"));
+ private static final String PROPERTY_PREFIX = "org.apache.activemq.kaha.Store";
+ private static final boolean BROKEN_FILE_LOCK = "true".equals(System.getProperty(PROPERTY_PREFIX + ".FileLockBroken", "false"));
+ private static final boolean DISABLE_LOCKING = "true".equals(System.getProperty(PROPERTY_PREFIX + ".DisableLocking", "false"));
- private static final Log log = LogFactory.getLog(KahaStore.class);
+ private static final Log LOG = LogFactory.getLog(KahaStore.class);
+
private final File directory;
private final String mode;
private IndexRootContainer mapsContainer;
@@ -168,7 +167,7 @@
}
}
String str = result ? "successfully deleted" : "failed to delete";
- log.info("Kaha Store " + str + " data directory " + directory);
+ LOG.info("Kaha Store " + str + " data directory " + directory);
}
return result;
}
@@ -420,7 +419,7 @@
throw new IOException("Store has been closed.");
if (!initialized) {
- log.info("Kaha Store using data directory " + directory);
+ LOG.info("Kaha Store using data directory " + directory);
lockFile = new RandomAccessFile(new File(directory, "lock"), "rw");
lock();
@@ -454,16 +453,17 @@
}
private synchronized void lock() throws IOException {
- if (!disableLocking && directory != null && lock == null) {
+ if (!DISABLE_LOCKING && directory != null && lock == null) {
String key = getPropertyKey();
String property = System.getProperty(key);
if (null == property) {
- if (!brokenFileLock) {
+ if (!BROKEN_FILE_LOCK) {
lock = lockFile.getChannel().tryLock();
if (lock == null) {
throw new StoreLockedExcpetion("Kaha Store " + directory.getName() + " is already opened by another application");
- } else
+ } else {
System.setProperty(key, new Date().toString());
+ }
}
} else { // already locked
throw new StoreLockedExcpetion("Kaha Store " + directory.getName() + " is already opened by this application.");
@@ -472,7 +472,7 @@
}
private synchronized void unlock() throws IOException {
- if (!disableLocking && (null != directory) && (null != lock)) {
+ if (!DISABLE_LOCKING && (null != directory) && (null != lock)) {
System.getProperties().remove(getPropertyKey());
if (lock.isValid()) {
lock.release();
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/AsyncDataManager.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/AsyncDataManager.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/AsyncDataManager.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/AsyncDataManager.java Thu Aug 9 09:37:49 2007
@@ -348,7 +348,7 @@
}
}
- synchronized public void consolidateDataFilesNotIn(Set<Integer> inUse) throws IOException {
+ public synchronized void consolidateDataFilesNotIn(Set<Integer> inUse) throws IOException {
// Substract and the difference is the set of files that are no longer
// needed :)
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/ControlFile.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/ControlFile.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/ControlFile.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/ControlFile.java Thu Aug 9 09:37:49 2007
@@ -31,9 +31,9 @@
*
* @version $Revision: 1.1 $
*/
-final public class ControlFile {
+public final class ControlFile {
- private final static boolean DISABLE_FILE_LOCK = "true".equals(System.getProperty("java.nio.channels.FileLock.broken", "false"));
+ private static final boolean DISABLE_FILE_LOCK = "true".equals(System.getProperty("java.nio.channels.FileLock.broken", "false"));
private final File file;
/** The File that holds the control data. */
@@ -96,7 +96,7 @@
}
}
- synchronized public ByteSequence load() throws IOException {
+ public synchronized ByteSequence load() throws IOException {
long l = randomAccessFile.length();
if (l < maxRecordSize) {
return null;
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFileAccessorPool.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFileAccessorPool.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFileAccessorPool.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFileAccessorPool.java Thu Aug 9 09:37:49 2007
@@ -32,7 +32,7 @@
private final HashMap<Integer, Pool> pools = new HashMap<Integer, Pool>();
private boolean closed;
- int MAX_OPEN_READERS_PER_FILE = 5;
+ int maxOpenReadersPerFile = 5;
class Pool {
@@ -61,7 +61,7 @@
public void closeDataFileReader(DataFileAccessor reader) {
openCounter--;
used = true;
- if (pool.size() >= MAX_OPEN_READERS_PER_FILE || disposed) {
+ if (pool.size() >= maxOpenReadersPerFile || disposed) {
reader.dispose();
} else {
pool.add(reader);
@@ -148,7 +148,7 @@
}
}
- synchronized public void close() {
+ public synchronized void close() {
if (closed)
return;
closed = true;
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFileAppender.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFileAppender.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFileAppender.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFileAppender.java Thu Aug 9 09:37:49 2007
@@ -37,9 +37,9 @@
protected static final byte[] RESERVED_SPACE = new byte[AsyncDataManager.ITEM_HEAD_RESERVED_SPACE];
protected static final String SHUTDOWN_COMMAND = "SHUTDOWN";
- int MAX_WRITE_BATCH_SIZE = 1024 * 1024 * 4;
+ int maxWriteBatchSize = 1024 * 1024 * 4;
- static public class WriteKey {
+ public static class WriteKey {
private final int file;
private final long offset;
private final int hash;
@@ -80,7 +80,7 @@
public boolean canAppend(DataFile dataFile, WriteCommand write) {
if (dataFile != this.dataFile)
return false;
- if (size + write.location.getSize() >= MAX_WRITE_BATCH_SIZE)
+ if (size + write.location.getSize() >= maxWriteBatchSize)
return false;
return true;
}
@@ -263,7 +263,7 @@
RandomAccessFile file = null;
try {
- DataByteArrayOutputStream buff = new DataByteArrayOutputStream(MAX_WRITE_BATCH_SIZE);
+ DataByteArrayOutputStream buff = new DataByteArrayOutputStream(maxWriteBatchSize);
while (true) {
Object o = null;
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataManagerFacade.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataManagerFacade.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataManagerFacade.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataManagerFacade.java Thu Aug 9 09:37:49 2007
@@ -56,13 +56,13 @@
}
}
- static private StoreLocation convertToStoreLocation(Location location) {
+ private static StoreLocation convertToStoreLocation(Location location) {
if (location == null)
return null;
return new StoreLocationFacade(location);
}
- static private Location convertFromStoreLocation(StoreLocation location) {
+ private static Location convertFromStoreLocation(StoreLocation location) {
if (location == null)
return null;
@@ -77,7 +77,7 @@
return l;
}
- static final private ByteSequence FORCE_COMMAND = new ByteSequence(new byte[] {'F', 'O', 'R', 'C', 'E'});
+ private static final ByteSequence FORCE_COMMAND = new ByteSequence(new byte[] {'F', 'O', 'R', 'C', 'E'});
AsyncDataManager dataManager;
private final String name;
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/JournalFacade.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/JournalFacade.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/JournalFacade.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/JournalFacade.java Thu Aug 9 09:37:49 2007
@@ -51,13 +51,13 @@
}
}
- static private RecordLocation convertToRecordLocation(Location location) {
+ private static RecordLocation convertToRecordLocation(Location location) {
if (location == null)
return null;
return new RecordLocationFacade(location);
}
- static private Location convertFromRecordLocation(RecordLocation location) {
+ private static Location convertFromRecordLocation(RecordLocation location) {
if (location == null)
return null;
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/NIODataFileAppender.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/NIODataFileAppender.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/NIODataFileAppender.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/NIODataFileAppender.java Thu Aug 9 09:37:49 2007
@@ -52,7 +52,7 @@
ByteBuffer header = ByteBuffer.allocateDirect(AsyncDataManager.ITEM_HEAD_SPACE);
ByteBuffer footer = ByteBuffer.allocateDirect(AsyncDataManager.ITEM_FOOT_SPACE);
- ByteBuffer buffer = ByteBuffer.allocateDirect(MAX_WRITE_BATCH_SIZE);
+ ByteBuffer buffer = ByteBuffer.allocateDirect(maxWriteBatchSize);
// Populate the static parts of the headers and footers..
header.putInt(0); // size
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/BaseContainerImpl.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/BaseContainerImpl.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/BaseContainerImpl.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/BaseContainerImpl.java Thu Aug 9 09:37:49 2007
@@ -1,21 +1,19 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.activemq.kaha.impl.container;
import java.io.IOException;
@@ -110,11 +108,11 @@
protected abstract void remove(IndexItem currentItem);
- protected synchronized final IndexLinkedList getInternalList() {
+ protected final synchronized IndexLinkedList getInternalList() {
return indexList;
}
- public synchronized final void close() {
+ public final synchronized void close() {
unload();
closed = true;
}
@@ -124,7 +122,7 @@
*
* @see org.apache.activemq.kaha.ListContainer#isLoaded()
*/
- public synchronized final boolean isLoaded() {
+ public final synchronized boolean isLoaded() {
checkClosed();
return loaded;
}
@@ -147,7 +145,7 @@
return indexManager;
}
- public synchronized final void expressDataInterest() throws IOException {
+ public final synchronized void expressDataInterest() throws IOException {
long nextItem = root.getNextItem();
while (nextItem != Item.POSITION_NOT_SET) {
IndexItem item = indexManager.getIndex(nextItem);
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerListIterator.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerListIterator.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerListIterator.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerListIterator.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
- * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
- * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.activemq.kaha.impl.container;
import java.util.ListIterator;
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerValueCollectionIterator.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerValueCollectionIterator.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerValueCollectionIterator.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ContainerValueCollectionIterator.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
- * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
- * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.activemq.kaha.impl.container;
import java.util.Iterator;
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ListContainerImpl.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ListContainerImpl.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ListContainerImpl.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/ListContainerImpl.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
- * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
- * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.activemq.kaha.impl.container;
import java.io.IOException;
@@ -42,8 +44,8 @@
*/
public class ListContainerImpl extends BaseContainerImpl implements ListContainer {
- private static final Log log = LogFactory.getLog(ListContainerImpl.class);
- protected Marshaller marshaller = Store.ObjectMarshaller;
+ private static final Log LOG = LogFactory.getLog(ListContainerImpl.class);
+ protected Marshaller marshaller = Store.OBJECT_MARSHALLER;
public ListContainerImpl(ContainerId id, IndexItem root, IndexManager indexManager,
DataManager dataManager, boolean persistentIndex) throws IOException {
@@ -70,7 +72,7 @@
nextItem = item.getNextItem();
}
} catch (IOException e) {
- log.error("Failed to load container " + getId(), e);
+ LOG.error("Failed to load container " + getId(), e);
throw new RuntimeStoreException(e);
}
}
@@ -775,7 +777,7 @@
storeIndex(index);
}
} catch (IOException e) {
- log.error("Failed to write " + value, e);
+ LOG.error("Failed to write " + value, e);
throw new RuntimeStoreException(e);
}
return index;
@@ -801,7 +803,7 @@
storeIndex(index);
}
} catch (IOException e) {
- log.error("Failed to write " + value, e);
+ LOG.error("Failed to write " + value, e);
throw new RuntimeStoreException(e);
}
return index;
@@ -838,7 +840,7 @@
storeIndex(index);
}
} catch (IOException e) {
- log.error("Failed to insert " + value, e);
+ LOG.error("Failed to insert " + value, e);
throw new RuntimeStoreException(e);
}
return index;
@@ -851,7 +853,7 @@
StoreLocation data = item.getValueDataItem();
result = dataManager.readItem(marshaller, data);
} catch (IOException e) {
- log.error("Failed to get value for " + item, e);
+ LOG.error("Failed to get value for " + item, e);
throw new RuntimeStoreException(e);
}
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/MapContainerImpl.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/MapContainerImpl.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/MapContainerImpl.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/MapContainerImpl.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
- * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
- * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.activemq.kaha.impl.container;
import java.io.File;
@@ -45,10 +47,10 @@
*/
public final class MapContainerImpl extends BaseContainerImpl implements MapContainer {
- private static final Log log = LogFactory.getLog(MapContainerImpl.class);
+ private static final Log LOG = LogFactory.getLog(MapContainerImpl.class);
protected Index index;
- protected Marshaller keyMarshaller = Store.ObjectMarshaller;
- protected Marshaller valueMarshaller = Store.ObjectMarshaller;
+ protected Marshaller keyMarshaller = Store.OBJECT_MARSHALLER;
+ protected Marshaller valueMarshaller = Store.OBJECT_MARSHALLER;
protected File directory;
public MapContainerImpl(File directory, ContainerId id, IndexItem root, IndexManager indexManager,
@@ -66,7 +68,7 @@
try {
this.index = new HashIndex(directory, name, indexManager);
} catch (IOException e) {
- log.error("Failed to create HashIndex", e);
+ LOG.error("Failed to create HashIndex", e);
throw new RuntimeException(e);
}
} else {
@@ -101,7 +103,7 @@
nextItem = item.getNextItem();
}
} catch (IOException e) {
- log.error("Failed to load container " + getId(), e);
+ LOG.error("Failed to load container " + getId(), e);
throw new RuntimeStoreException(e);
}
}
@@ -120,7 +122,7 @@
try {
index.unload();
} catch (IOException e) {
- log.warn("Failed to unload the index", e);
+ LOG.warn("Failed to unload the index", e);
}
indexList.clear();
}
@@ -169,7 +171,7 @@
try {
return index.containsKey(key);
} catch (IOException e) {
- log.error("Failed trying to find key: " + key, e);
+ LOG.error("Failed trying to find key: " + key, e);
throw new RuntimeException(e);
}
}
@@ -186,7 +188,7 @@
try {
item = index.get(key);
} catch (IOException e) {
- log.error("Failed trying to get key: " + key, e);
+ LOG.error("Failed trying to get key: " + key, e);
throw new RuntimeException(e);
}
if (item != null) {
@@ -207,7 +209,7 @@
try {
item = index.get(key);
} catch (IOException e) {
- log.error("Failed trying to get key: " + key, e);
+ LOG.error("Failed trying to get key: " + key, e);
throw new RuntimeException(e);
}
return item;
@@ -293,7 +295,7 @@
try {
index.store(key, item);
} catch (IOException e) {
- log.error("Failed trying to insert key: " + key, e);
+ LOG.error("Failed trying to insert key: " + key, e);
throw new RuntimeException(e);
}
indexList.add(item);
@@ -321,7 +323,7 @@
}
return result;
} catch (IOException e) {
- log.error("Failed trying to remove key: " + key, e);
+ LOG.error("Failed trying to remove key: " + key, e);
throw new RuntimeException(e);
}
}
@@ -368,7 +370,7 @@
try {
index.clear();
} catch (IOException e) {
- log.error("Failed trying clear index", e);
+ LOG.error("Failed trying clear index", e);
throw new RuntimeException(e);
}
}
@@ -392,7 +394,7 @@
indexList.add(item);
return item;
} catch (IOException e) {
- log.error("Failed trying to place key: " + key, e);
+ LOG.error("Failed trying to place key: " + key, e);
throw new RuntimeException(e);
}
}
@@ -411,7 +413,7 @@
try {
index.remove(key);
} catch (IOException e) {
- log.error("Failed trying to remove entry: " + entry, e);
+ LOG.error("Failed trying to remove entry: " + entry, e);
throw new RuntimeException(e);
}
IndexItem prev = indexList.getPrevEntry(item);
@@ -464,7 +466,7 @@
StoreLocation data = item.getValueDataItem();
result = dataManager.readItem(valueMarshaller, data);
} catch (IOException e) {
- log.error("Failed to get value for " + item, e);
+ LOG.error("Failed to get value for " + item, e);
throw new RuntimeStoreException(e);
}
}
@@ -485,7 +487,7 @@
StoreLocation data = item.getKeyDataItem();
result = dataManager.readItem(keyMarshaller, data);
} catch (IOException e) {
- log.error("Failed to get key for " + item, e);
+ LOG.error("Failed to get key for " + item, e);
throw new RuntimeStoreException(e);
}
}
@@ -520,7 +522,7 @@
}
storeIndex(index);
} catch (IOException e) {
- log.error("Failed to write " + key + " , " + value, e);
+ LOG.error("Failed to write " + key + " , " + value, e);
throw new RuntimeStoreException(e);
}
return index;
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/DataManagerImpl.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/DataManagerImpl.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/DataManagerImpl.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/DataManagerImpl.java Thu Aug 9 09:37:49 2007
@@ -40,9 +40,10 @@
*/
public final class DataManagerImpl implements DataManager {
- private static final Log log = LogFactory.getLog(DataManagerImpl.class);
public static final long MAX_FILE_LENGTH = 1024 * 1024 * 32;
+ private static final Log LOG = LogFactory.getLog(DataManagerImpl.class);
private static final String NAME_PREFIX = "data-";
+
private final File directory;
private final String name;
private SyncDataFileReader reader;
@@ -119,7 +120,7 @@
Integer key = Integer.valueOf(item.getFile());
DataFile dataFile = (DataFile)fileMap.get(key);
if (dataFile == null) {
- log.error("Looking for key " + key + " but not found in fileMap: " + fileMap);
+ LOG.error("Looking for key " + key + " but not found in fileMap: " + fileMap);
throw new IOException("Could not locate data file " + NAME_PREFIX + name + "-" + item.getFile());
}
return dataFile;
@@ -184,7 +185,7 @@
try {
type = getReader().readDataItemSize(item);
} catch (IOException ignore) {
- log.trace("End of data file reached at (header was invalid): " + item);
+ LOG.trace("End of data file reached at (header was invalid): " + item);
return;
}
if (type == REDO_ITEM_TYPE) {
@@ -193,7 +194,7 @@
try {
object = readItem(redoMarshaller, item);
} catch (IOException e1) {
- log.trace("End of data file reached at (payload was invalid): " + item);
+ LOG.trace("End of data file reached at (payload was invalid): " + item);
return;
}
try {
@@ -325,7 +326,7 @@
writer.force(dataFile);
}
boolean result = dataFile.delete();
- log.debug("discarding data file " + dataFile + (result ? "successful " : "failed"));
+ LOG.debug("discarding data file " + dataFile + (result ? "successful " : "failed"));
}
/*
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/Item.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/Item.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/Item.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/Item.java Thu Aug 9 09:37:49 2007
@@ -22,9 +22,9 @@
* @version $Revision: 1.2 $
*/
public interface Item {
- static final long POSITION_NOT_SET = -1;
- static final short MAGIC = 31317;
- static final int ACTIVE = 22;
- static final int FREE = 33;
- static final int LOCATION_SIZE = 24;
+ long POSITION_NOT_SET = -1;
+ short MAGIC = 31317;
+ int ACTIVE = 22;
+ int FREE = 33;
+ int LOCATION_SIZE = 24;
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/SyncDataFileWriter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/SyncDataFileWriter.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/SyncDataFileWriter.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/SyncDataFileWriter.java Thu Aug 9 09:37:49 2007
@@ -28,7 +28,7 @@
*
* @version $Revision: 1.1.1.1 $
*/
-final public class SyncDataFileWriter {
+public final class SyncDataFileWriter {
private DataByteArrayOutputStream buffer;
private DataManagerImpl dataManager;
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/DiskIndexLinkedList.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/DiskIndexLinkedList.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/DiskIndexLinkedList.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/DiskIndexLinkedList.java Thu Aug 9 09:37:49 2007
@@ -212,8 +212,9 @@
throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size);
IndexItem e = root;
- for (int i = 0; i <= index; i++)
+ for (int i = 0; i <= index; i++) {
e = getNextEntry(e);
+ }
if (e != null && last != null && last.equals(e)) {
last = e;
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/Index.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/Index.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/Index.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/Index.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
- * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
- * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.activemq.kaha.impl.index;
import java.io.IOException;
@@ -31,14 +33,14 @@
* @throws IOException
*
*/
- public void clear() throws IOException;
+ void clear() throws IOException;
/**
* @param key
* @return true if it contains the key
* @throws IOException
*/
- public boolean containsKey(Object key) throws IOException;
+ boolean containsKey(Object key) throws IOException;
/**
* remove the index key
@@ -47,7 +49,7 @@
* @return StoreEntry removed
* @throws IOException
*/
- public StoreEntry remove(Object key) throws IOException;
+ StoreEntry remove(Object key) throws IOException;
/**
* store the key, item
@@ -56,36 +58,36 @@
* @param entry
* @throws IOException
*/
- public void store(Object key, StoreEntry entry) throws IOException;
+ void store(Object key, StoreEntry entry) throws IOException;
/**
* @param key
* @return the entry
* @throws IOException
*/
- public StoreEntry get(Object key) throws IOException;
+ StoreEntry get(Object key) throws IOException;
/**
* @return true if the index is transient
*/
- public boolean isTransient();
+ boolean isTransient();
/**
* load indexes
*/
- public void load();
+ void load();
/**
* unload indexes
*
* @throws IOException
*/
- public void unload() throws IOException;
+ void unload() throws IOException;
/**
* Set the marshaller for key objects
*
* @param marshaller
*/
- public void setKeyMarshaller(Marshaller marshaller);
+ void setKeyMarshaller(Marshaller marshaller);
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/IndexLinkedList.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/IndexLinkedList.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/IndexLinkedList.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/IndexLinkedList.java Thu Aug 9 09:37:49 2007
@@ -28,42 +28,42 @@
/**
* @return the root used by the List
*/
- public IndexItem getRoot();
+ IndexItem getRoot();
/**
* Returns the first element in this list.
*
* @return the first element in this list.
*/
- public IndexItem getFirst();
+ IndexItem getFirst();
/**
* Returns the last element in this list.
*
* @return the last element in this list.
*/
- public IndexItem getLast();
+ IndexItem getLast();
/**
* Removes and returns the first element from this list.
*
* @return the first element from this list.
*/
- public StoreEntry removeFirst();
+ StoreEntry removeFirst();
/**
* Removes and returns the last element from this list.
*
* @return the last element from this list.
*/
- public Object removeLast();
+ Object removeLast();
/**
* Inserts the given element at the beginning of this list.
*
* @param item
*/
- public void addFirst(IndexItem item);
+ void addFirst(IndexItem item);
/**
* Appends the given element to the end of this list. (Identical in function
@@ -71,21 +71,21 @@
*
* @param item
*/
- public void addLast(IndexItem item);
+ void addLast(IndexItem item);
/**
* Returns the number of elements in this list.
*
* @return the number of elements in this list.
*/
- public int size();
+ int size();
/**
* is the list empty?
*
* @return true if there are no elements in the list
*/
- public boolean isEmpty();
+ boolean isEmpty();
/**
* Appends the specified element to the end of this list.
@@ -95,12 +95,12 @@
* @return <tt>true</tt> (as per the general contract of
* <tt>Collection.add</tt>).
*/
- public boolean add(IndexItem item);
+ boolean add(IndexItem item);
/**
* Removes all of the elements from this list.
*/
- public void clear();
+ void clear();
// Positional Access Operations
/**
@@ -112,7 +112,7 @@
* @throws IndexOutOfBoundsException if the specified index is is out of
* range (<tt>index < 0 || index >= size()</tt>).
*/
- public IndexItem get(int index);
+ IndexItem get(int index);
/**
* Inserts the specified element at the specified position in this list.
@@ -124,7 +124,7 @@
*
* @throws IndexOutOfBoundsException if the specified index is out of range (<tt>index < 0 || index > size()</tt>).
*/
- public void add(int index, IndexItem element);
+ void add(int index, IndexItem element);
/**
* Removes the element at the specified position in this list. Shifts any
@@ -136,7 +136,7 @@
*
* @throws IndexOutOfBoundsException if the specified index is out of range (<tt>index < 0 || index >= size()</tt>).
*/
- public Object remove(int index);
+ Object remove(int index);
// Search Operations
/**
@@ -150,7 +150,7 @@
* @return the index in this list of the first occurrence of the specified
* element, or -1 if the list does not contain this element.
*/
- public int indexOf(StoreEntry o);
+ int indexOf(StoreEntry o);
/**
* Retrieve the next entry after this entry
@@ -158,7 +158,7 @@
* @param entry
* @return next entry
*/
- public IndexItem getNextEntry(IndexItem entry);
+ IndexItem getNextEntry(IndexItem entry);
/**
* Retrive the prev entry after this entry
@@ -166,14 +166,14 @@
* @param entry
* @return prev entry
*/
- public IndexItem getPrevEntry(IndexItem entry);
+ IndexItem getPrevEntry(IndexItem entry);
/**
* remove an entry
*
* @param e
*/
- public void remove(IndexItem e);
+ void remove(IndexItem e);
/**
* Ensure we have the up to date entry
@@ -181,7 +181,7 @@
* @param entry
* @return the entry
*/
- public StoreEntry getEntry(StoreEntry entry);
+ StoreEntry getEntry(StoreEntry entry);
/**
* Update the indexes of a StoreEntry
@@ -189,5 +189,5 @@
* @param current
* @return update StoreEntry
*/
- public StoreEntry refreshEntry(StoreEntry current);
+ StoreEntry refreshEntry(StoreEntry current);
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/IndexManager.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/IndexManager.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/IndexManager.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/IndexManager.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
- * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
- * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.activemq.kaha.impl.index;
import java.io.File;
@@ -30,7 +32,7 @@
public final class IndexManager {
public static final String NAME_PREFIX = "index-";
- private static final Log log = LogFactory.getLog(IndexManager.class);
+ private static final Log LOG = LogFactory.getLog(IndexManager.class);
private final String name;
private File directory;
private File file;
@@ -86,7 +88,7 @@
try {
writer.updateIndexes(index);
} catch (Throwable e) {
- log.error(name + " error updating indexes ", e);
+ LOG.error(name + " error updating indexes ", e);
}
dirty = true;
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/VMIndex.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/VMIndex.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/VMIndex.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/VMIndex.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
- * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
- * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.activemq.kaha.impl.index;
import java.io.IOException;
@@ -29,7 +31,7 @@
* @version $Revision: 1.2 $
*/
public class VMIndex implements Index {
- private static final Log log = LogFactory.getLog(VMIndex.class);
+ private static final Log LOG = LogFactory.getLog(VMIndex.class);
private IndexManager indexManager;
private Map<Object, StoreEntry> map = new HashMap<Object, StoreEntry>();
@@ -65,7 +67,7 @@
try {
result = indexManager.refreshIndex((IndexItem)result);
} catch (IOException e) {
- log.error("Failed to refresh entry", e);
+ LOG.error("Failed to refresh entry", e);
throw new RuntimeException("Failed to refresh entry");
}
}
@@ -92,7 +94,7 @@
try {
result = indexManager.refreshIndex((IndexItem)result);
} catch (IOException e) {
- log.error("Failed to refresh entry", e);
+ LOG.error("Failed to refresh entry", e);
throw new RuntimeException("Failed to refresh entry");
}
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/VMIndexLinkedList.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/VMIndexLinkedList.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/VMIndexLinkedList.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/VMIndexLinkedList.java Thu Aug 9 09:37:49 2007
@@ -183,11 +183,13 @@
throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size);
IndexItem e = root;
if (index < size / 2) {
- for (int i = 0; i <= index; i++)
+ for (int i = 0; i <= index; i++) {
e = e.next;
+ }
} else {
- for (int i = size; i > index; i--)
+ for (int i = size; i > index; i--) {
e = e.prev;
+ }
}
return e;
}
@@ -259,8 +261,9 @@
*/
public Object clone() {
IndexLinkedList clone = new VMIndexLinkedList(this.root);
- for (IndexItem e = root.next; e != root; e = e.next)
+ for (IndexItem e = root.next; e != root; e = e.next) {
clone.add(e);
+ }
return clone;
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashBin.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashBin.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashBin.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashBin.java Thu Aug 9 09:37:49 2007
@@ -1,15 +1,18 @@
/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
- * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
- * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.apache.activemq.kaha.impl.index.hash;
@@ -26,7 +29,7 @@
* @version $Revision: 1.1.1.1 $
*/
class HashBin {
- private static final transient Log log = LogFactory.getLog(HashBin.class);
+ private static final transient Log LOG = LogFactory.getLog(HashBin.class);
private HashIndex hashIndex;
private int id;
private int maximumEntries;
@@ -141,7 +144,7 @@
}
if (!replace) {
if (low > size()) {
- log.info("SIZE() " + size() + " low = " + low);
+ LOG.info("SIZE() " + size() + " low = " + low);
}
addHashEntry(low, newEntry);
size++;
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashEntry.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashEntry.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashEntry.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashEntry.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
- * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
- * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.activemq.kaha.impl.index.hash;
import java.io.DataInput;
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashIndex.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashIndex.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashIndex.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashIndex.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
- * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
- * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.activemq.kaha.impl.index.hash;
import java.io.File;
@@ -38,7 +40,7 @@
private static final String NAME_PREFIX = "hash-index-";
private static final int DEFAULT_PAGE_SIZE;
private static final int DEFAULT_KEY_SIZE;
- private static final Log log = LogFactory.getLog(HashIndex.class);
+ private static final Log LOG = LogFactory.getLog(HashIndex.class);
private final String name;
private File directory;
private File file;
@@ -203,7 +205,7 @@
}
length = offset;
} catch (IOException e) {
- log.error("Failed to load index ", e);
+ LOG.error("Failed to load index ", e);
throw new RuntimeException(e);
}
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPage.java Thu Aug 9 09:37:49 2007
@@ -1,15 +1,18 @@
/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
- * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
- * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.apache.activemq.kaha.impl.index.hash;
@@ -29,7 +32,7 @@
* @version $Revision: 1.1.1.1 $
*/
class HashPage {
- private static final transient Log log = LogFactory.getLog(HashPage.class);
+ private static final transient Log LOG = LogFactory.getLog(HashPage.class);
static final int PAGE_HEADER_SIZE = 17;
private int maximumEntries;
private long id;
@@ -232,6 +235,6 @@
str.append(entry);
str.append(",");
}
- log.info(str);
+ LOG.info(str);
}
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPageInfo.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPageInfo.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPageInfo.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashPageInfo.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
- * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
- * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.activemq.kaha.impl.index.hash;
import java.io.IOException;
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreeEntry.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreeEntry.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreeEntry.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreeEntry.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
- * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
- * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.activemq.kaha.impl.index.tree;
import java.io.DataInput;
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreeIndex.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreeIndex.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreeIndex.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreeIndex.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
- * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
- * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.activemq.kaha.impl.index.tree;
import java.io.File;
@@ -38,7 +40,7 @@
private static final String NAME_PREFIX = "tree-index-";
private static final int DEFAULT_PAGE_SIZE;
private static final int DEFAULT_KEY_SIZE;
- private static final Log log = LogFactory.getLog(TreeIndex.class);
+ private static final Log LOG = LogFactory.getLog(TreeIndex.class);
private final String name;
private File directory;
private File file;
@@ -193,7 +195,7 @@
root = createRoot();
}
} catch (IOException e) {
- log.error("Failed to load index ", e);
+ LOG.error("Failed to load index ", e);
throw new RuntimeException(e);
}
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreePage.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreePage.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreePage.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreePage.java Thu Aug 9 09:37:49 2007
@@ -1,15 +1,18 @@
/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
- * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
- * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.apache.activemq.kaha.impl.index.tree;
@@ -31,7 +34,7 @@
* @version $Revision: 1.1.1.1 $
*/
class TreePage {
- private static final transient Log log = LogFactory.getLog(TreePage.class);
+ private static final transient Log LOG = LogFactory.getLog(TreePage.class);
static final int PAGE_HEADER_SIZE = 18;
static enum Flavour {
@@ -737,11 +740,11 @@
}
protected void dump() throws IOException {
- log.info(this);
+ LOG.info(this);
Set<Long> set = new HashSet<Long>();
for (TreeEntry entry : treeEntries) {
if (entry != null) {
- log.info(entry);
+ LOG.info(entry);
set.add(entry.getPrevPageId());
set.add(entry.getNextPageId());
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreePageEntry.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreePageEntry.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreePageEntry.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/tree/TreePageEntry.java Thu Aug 9 09:37:49 2007
@@ -1,17 +1,19 @@
/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
- * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
- * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.activemq.kaha.impl.index.tree;
/**
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/JMSEndpointStatsImpl.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/JMSEndpointStatsImpl.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/JMSEndpointStatsImpl.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/JMSEndpointStatsImpl.java Thu Aug 9 09:37:49 2007
@@ -33,7 +33,7 @@
* @version $Revision: 1.3 $
*/
public class JMSEndpointStatsImpl extends StatsImpl {
- private static final Log log = LogFactory.getLog(JMSEndpointStatsImpl.class);
+ private static final Log LOG = LogFactory.getLog(JMSEndpointStatsImpl.class);
protected CountStatisticImpl messageCount;
protected CountStatisticImpl pendingMessageCount;
@@ -158,7 +158,7 @@
CountStatisticImpl c = (CountStatisticImpl)child;
c.setParent((CountStatisticImpl)parent);
} else {
- log.warn("Cannot associate endpoint counters with session level counters as they are not both CountStatisticImpl clases. Endpoint: " + child + " session: " + parent);
+ LOG.warn("Cannot associate endpoint counters with session level counters as they are not both CountStatisticImpl clases. Endpoint: " + child + " session: " + parent);
}
}
@@ -167,7 +167,7 @@
TimeStatisticImpl c = (TimeStatisticImpl)child;
c.setParent((TimeStatisticImpl)parent);
} else {
- log.warn("Cannot associate endpoint counters with session level counters as they are not both TimeStatisticImpl clases. Endpoint: " + child + " session: " + parent);
+ LOG.warn("Cannot associate endpoint counters with session level counters as they are not both TimeStatisticImpl clases. Endpoint: " + child + " session: " + parent);
}
}
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/PollCountStatisticImpl.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/PollCountStatisticImpl.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/PollCountStatisticImpl.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/PollCountStatisticImpl.java Thu Aug 9 09:37:49 2007
@@ -58,18 +58,18 @@
}
}
- synchronized private void removeChild(PollCountStatisticImpl child) {
+ private synchronized void removeChild(PollCountStatisticImpl child) {
if (children != null)
children.remove(child);
}
- synchronized private void addChild(PollCountStatisticImpl child) {
+ private synchronized void addChild(PollCountStatisticImpl child) {
if (children == null)
children = new ArrayList();
children.add(child);
}
- synchronized public long getCount() {
+ public synchronized long getCount() {
if (children == null)
return 0;
long count = 0;
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/Resettable.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/Resettable.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/Resettable.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/Resettable.java Thu Aug 9 09:37:49 2007
@@ -26,5 +26,5 @@
/**
* Reset the statistic
*/
- public void reset();
+ void reset();
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/StatsCapable.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/StatsCapable.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/StatsCapable.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/management/StatsCapable.java Thu Aug 9 09:37:49 2007
@@ -27,5 +27,5 @@
/**
* @return the Stats for this object
*/
- public StatsImpl getStats();
+ StatsImpl getStats();
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/Cache.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/Cache.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/Cache.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/Cache.java Thu Aug 9 09:37:49 2007
@@ -30,7 +30,7 @@
* @return null if the object was not previously put or if the object has
* expired out of the cache.
*/
- public Object get(Object key);
+ Object get(Object key);
/**
* Puts an object into the cache.
@@ -38,7 +38,7 @@
* @param messageID
* @param message
*/
- public Object put(Object key, Object value);
+ Object put(Object key, Object value);
/**
* Removes an object from the cache.
@@ -46,19 +46,19 @@
* @param messageID
* @return the object associated with the key if it was still in the cache.
*/
- public Object remove(Object key);
+ Object remove(Object key);
/**
* Lets a cache know it will not be used any further and that it can release
* acquired resources
*/
- public void close();
+ void close();
/**
* How big is the cache right now?
*
* @return
*/
- public int size();
+ int size();
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/CacheEvictionUsageListener.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/CacheEvictionUsageListener.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/CacheEvictionUsageListener.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/CacheEvictionUsageListener.java Thu Aug 9 09:37:49 2007
@@ -28,7 +28,7 @@
public class CacheEvictionUsageListener implements UsageListener {
- private final static Log log = LogFactory.getLog(CacheEvictionUsageListener.class);
+ private static final Log LOG = LogFactory.getLog(CacheEvictionUsageListener.class);
private final CopyOnWriteArrayList evictors = new CopyOnWriteArrayList();
private final int usageHighMark;
@@ -52,7 +52,7 @@
boolean evictMessages() {
// Try to take the memory usage down below the low mark.
try {
- log.debug("Evicting cache memory usage: " + usageManager.getPercentUsage());
+ LOG.debug("Evicting cache memory usage: " + usageManager.getPercentUsage());
LinkedList list = new LinkedList(evictors);
while (list.size() > 0 && usageManager.getPercentUsage() > usageLowMark) {
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/CacheFilter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/CacheFilter.java?view=diff&rev=564271&r1=564270&r2=564271
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/CacheFilter.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/CacheFilter.java Thu Aug 9 09:37:49 2007
@@ -1,4 +1,3 @@
-
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with