Package org.apache.activemq.kaha

Examples of org.apache.activemq.kaha.StoreLocation


    public synchronized Object getKey(StoreEntry item) {
        load();
        Object result = null;
        if (item != null) {
            try {
                StoreLocation data = item.getKeyDataItem();
                result = dataManager.readItem(keyMarshaller, data);
            } catch (IOException e) {
                LOG.error("Failed to get key for " + item, e);
                throw new RuntimeStoreException(e);
            }
View Full Code Here


    protected synchronized IndexItem write(Object key, Object value) {
        IndexItem index = null;
        try {
            index = indexManager.createNewIndex();
            StoreLocation data = dataManager.storeDataItem(keyMarshaller, key);
            index.setKeyData(data);

            if (value != null) {
                data = dataManager.storeDataItem(valueMarshaller, value);
                index.setValueData(data);
View Full Code Here

    protected IndexItem writeLast(Object value){
        IndexItem index=null;
        try{
            if(value!=null){
                StoreLocation data=dataManager.storeDataItem(marshaller,value);
                index=indexManager.createNewIndex();
                index.setValueData(data);
                IndexItem prev=indexList.getLast();
                prev=prev!=null?prev:root;
                IndexItem next=indexList.getNextEntry(prev);
View Full Code Here

    protected IndexItem writeFirst(Object value){
        IndexItem index=null;
        try{
            if(value!=null){
                StoreLocation data=dataManager.storeDataItem(marshaller,value);
                index=indexManager.createNewIndex();
                index.setValueData(data);
                IndexItem prev=root;
                IndexItem next=indexList.getNextEntry(prev);
                prev.setNextItem(index.getOffset());
View Full Code Here

    protected IndexItem insert(int insertPos,Object value){
        IndexItem index=null;
        try{
            if(value!=null){
                StoreLocation data=dataManager.storeDataItem(marshaller,value);
                index=indexManager.createNewIndex();
                index.setValueData(data);
                IndexItem prev=null;
                IndexItem next=null;
                if(insertPos<=0){
View Full Code Here

        Object result=null;
        if(item!=null){
            try{
                // ensure it's up to date
                // item=indexList.getEntry(item);
                StoreLocation data=item.getValueDataItem();
                result=dataManager.readItem(marshaller,data);
            }catch(IOException e){
                log.error("Failed to get value for "+item,e);
                throw new RuntimeStoreException(e);
            }
View Full Code Here

                try{
                    init();
                    long nextItem=root.getNextItem();
                    while(nextItem!=Item.POSITION_NOT_SET){
                        IndexItem item=indexManager.getIndex(nextItem);
                        StoreLocation data=item.getKeyDataItem();
                        Object key=dataManager.readItem(keyMarshaller,data);
                        indexMap.put(key,item);
                        indexList.add(item);
                        nextItem=item.getNextItem();
                    }
View Full Code Here

        Object result=null;
        if(item!=null){
            try{
                // ensure this value is up to date
                //item=indexList.getEntry(item);
                StoreLocation data=item.getValueDataItem();
                result=dataManager.readItem(valueMarshaller,data);
            }catch(IOException e){
                log.error("Failed to get value for "+item,e);
                throw new RuntimeStoreException(e);
            }
View Full Code Here

    public synchronized Object getKey(StoreEntry item){
        load();
        Object result=null;
        if(item!=null){
            try{
                StoreLocation data=item.getKeyDataItem();
                result=dataManager.readItem(keyMarshaller,data);
            }catch(IOException e){
                log.error("Failed to get key for "+item,e);
                throw new RuntimeStoreException(e);
            }
View Full Code Here

    protected IndexItem write(Object key,Object value){
        IndexItem index=null;
        try{
            if(key!=null){
                index=indexManager.createNewIndex();
                StoreLocation data=dataManager.storeDataItem(keyMarshaller,key);
                index.setKeyData(data);
            }
            if(value!=null){
                StoreLocation data=dataManager.storeDataItem(valueMarshaller,value);
                index.setValueData(data);
            }
            IndexItem prev=indexList.getLast();
            prev=prev!=null?prev:indexList.getRoot();
            IndexItem next=indexList.getNextEntry(prev);
View Full Code Here

TOP

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

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.