Package org.apache.activemq.kaha

Examples of org.apache.activemq.kaha.StoreEntry


     * @param key
     * @return store entry
     * @see org.apache.activemq.kaha.impl.index.Index#removeKey(java.lang.Object)
     */
    public StoreEntry remove(Object key) {
        StoreEntry result = map.remove(key);
        if (result != null) {
            try {
                result = indexManager.refreshIndex((IndexItem)result);
            } catch (IOException e) {
                LOG.error("Failed to refresh entry", e);
View Full Code Here


    /**
     * @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

     * @see org.apache.activemq.kaha.MapContainer#get(java.lang.Object)
     */
    public synchronized Object get(Object key) {
        load();
        Object result = null;
        StoreEntry item = null;
        try {
            item = index.get(key);
        } catch (IOException e) {
            LOG.error("Failed trying to get key: " + key, e);
            throw new RuntimeException(e);
View Full Code Here

     * @param key
     * @return the StoreEntry
     */
    public synchronized StoreEntry getEntry(Object key) {
        load();
        StoreEntry item = null;
        try {
            item = index.get(key);
        } catch (IOException e) {
            LOG.error("Failed trying to get key: " + key, e);
            throw new RuntimeException(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 void addMessageReference(final ConnectionContext context, final MessageId messageId,
                                    final ReferenceData data) {
        final ReferenceRecord record = new ReferenceRecord(messageId.toString(), data);
        final int subscriberCount = subscriberMessages.size();
        if (subscriberCount > 0) {
            final StoreEntry messageEntry = messageContainer.place(messageId, record);
            addInterest(record);
            final TopicSubAck tsa = new TopicSubAck();
            tsa.setCount(subscriberCount);
            tsa.setMessageEntry(messageEntry);
            final StoreEntry ackEntry = ackContainer.placeLast(tsa);
            for (final Iterator<TopicSubContainer> i = subscriberMessages.values().iterator(); i.hasNext();) {
                final TopicSubContainer container = i.next();
                final ConsumerMessageRef ref = new ConsumerMessageRef();
                ref.setAckEntry(ackEntry);
                ref.setMessageEntry(messageEntry);
View Full Code Here

        }
    }

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

    public void removeMessage(ConnectionContext context, MessageAck ack) throws IOException {
        removeMessage(ack.getLastMessageId());
    }

    public synchronized void removeMessage(MessageId msgId) throws IOException {   
        StoreEntry entry = messageContainer.getEntry(msgId);
        if (entry != null) {
            ReferenceRecord rr = messageContainer.remove(msgId);
            if (rr != null) {
                removeInterest(rr);
                if (messageContainer.isEmpty()
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.