Package org.apache.activemq.kaha

Examples of org.apache.activemq.kaha.StoreEntry


    /**
     * @param key
     * @return the entry
     */
    public StoreEntry get(Object key) {
        StoreEntry result = map.get(key);
        if (result != null) {
            try {
                result = indexManager.refreshIndex((IndexItem)result);
            } catch (IOException e) {
                LOG.error("Failed to refresh entry", e);
View Full Code Here


     */
    public synchronized Object removeLast() {
        if (size == 0) {
            return null;
        }
        StoreEntry result = last;
        remove(last);
        return result;
    }
View Full Code Here

    }
    return result;
  }

    public synchronized StoreEntry getEntry(StoreEntry current) {
        StoreEntry result = null;
        if (current != null && current.getOffset() >= 0) {
            try {
                result = indexManager.getIndex(current.getOffset());
            } catch (IOException e) {
                throw new RuntimeException("Failed to index", e);
View Full Code Here

     * Update the indexes of a StoreEntry
     *
     * @param current
     */
    public synchronized StoreEntry refreshEntry(StoreEntry current) {
        StoreEntry result = null;
        if (current != null && current.getOffset() >= 0) {
            try {
                result = indexManager.refreshIndex((IndexItem)current);
            } catch (IOException e) {
                throw new RuntimeException("Failed to index", e);
View Full Code Here

    public int nextIndex() {
        int result = -1;
        if (nextItem != null) {
            synchronized (container) {
                nextItem = (IndexItem)list.refreshEntry(nextItem);
                StoreEntry next = list.getNextEntry(nextItem);
                if (next != null) {
                    result = container.getInternalList().indexOf(next);
                }
            }
        }
View Full Code Here

    public int previousIndex() {
        int result = -1;
        if (nextItem != null) {
            synchronized (container) {
                nextItem = (IndexItem)list.refreshEntry(nextItem);
                StoreEntry prev = list.getPrevEntry(nextItem);
                if (prev != null) {
                    result = container.getInternalList().indexOf(prev);
                }
            }
        }
View Full Code Here

     *
     * @param object
     * @return the entry in the Store
     */
    public synchronized StoreEntry placeLast(Object object) {
        StoreEntry item = internalAddLast(object);
        return item;
    }
View Full Code Here

     *
     * @param object
     * @return the location in the Store
     */
    public synchronized StoreEntry placeFirst(Object object) {
        StoreEntry item = internalAddFirst(object);
        return item;
    }
View Full Code Here

     * @param entry
     * @return the Object at that entry
     */
    public synchronized Object get(final StoreEntry entry) {
        load();
        StoreEntry entryToUse = refresh(entry);
        return getValue(entryToUse);
    }
View Full Code Here

    public void recoverNextMessages(int maxReturned, MessageRecoveryListener listener)
        throws Exception {
        lock.lock();
        try {
            StoreEntry entry = batchEntry;
            if (entry == null) {
                entry = messageContainer.getFirst();
            } else {
                entry = messageContainer.refresh(entry);
                if (entry != null) {
View Full Code Here

TOP

Related Classes of org.apache.activemq.kaha.StoreEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.