Package org.apache.activemq.kaha.impl.container

Examples of org.apache.activemq.kaha.impl.container.ListContainerImpl


        list.addAll(data);
        assertEquals(MAX_CACHE_SIZE,list.getCacheList().size());
    }

    public void testInserts() throws Exception{
        ListContainerImpl list=getStoreList("test");
        List data=getDataList(100);
        list.addAll(data);
        assertEquals(MAX_CACHE_SIZE,list.getCacheList().size());
        List cached=getCachedList(MAX_CACHE_SIZE);
        for(int i=0;i<cached.size();i++){
            list.set(i,cached.get(i));
        }
        assertEquals(MAX_CACHE_SIZE,list.getCacheList().size());
        for(int i=0;i<cached.size();i++){
            assertEquals(cached.get(i),list.getCacheList().get(i));
        }
    }
View Full Code Here


        IndexManager im=store.getIndexManager(dm,containerName);
        ContainerId containerId=new ContainerId();
        containerId.setKey(id);
        containerId.setDataContainerName(containerName);
        IndexItem root=store.getListsContainer().addRoot(im,containerId);
        ListContainerImpl result=new ListContainerImpl(containerId,root,im,dm,IndexTypes.DISK_INDEX);
        result.expressDataInterest();
        result.setMaximumCacheSize(MAX_CACHE_SIZE);
        return result;
    }
View Full Code Here

            throws IOException{
        initialize();
        ContainerId containerId=new ContainerId();
        containerId.setKey(id);
        containerId.setDataContainerName(containerName);
        ListContainerImpl result=(ListContainerImpl)lists.get(containerId);
        if(result==null){
            DataManager dm=getDataManager(containerName);
            IndexManager im=getIndexManager(dm,containerName);
           
            IndexItem root=listsContainer.getRoot(im,containerId);
            if(root==null){
                root=listsContainer.addRoot(im,containerId);
            }
            result=new ListContainerImpl(containerId,root,im,dm,indexType);
            lists.put(containerId,result);
        }
        return result;
    }
View Full Code Here

    public void deleteListContainer(Object id,String containerName) throws IOException{
        initialize();
        ContainerId containerId=new ContainerId();
        containerId.setKey(id);
        containerId.setDataContainerName(containerName);
        ListContainerImpl container=(ListContainerImpl)lists.remove(containerId);
        if(container!=null){
            listsContainer.removeRoot(container.getIndexManager(),containerId);
            container.clear();
        }
    }
View Full Code Here

    public synchronized ListContainer getListContainer(Object id, String containerName,
                                                       boolean persistentIndex) throws IOException {
        initialize();
        ContainerId containerId = new ContainerId(id, containerName);
        ListContainerImpl result = lists.get(containerId);
        if (result == null) {
            DataManager dm = getDataManager(containerName);
            IndexManager im = getIndexManager(dm, containerName);

            IndexItem root = listsContainer.getRoot(im, containerId);
            if (root == null) {
                root = listsContainer.addRoot(im, containerId);
            }
            result = new ListContainerImpl(containerId, root, im, dm, persistentIndex);
            lists.put(containerId, result);
        }
        return result;
    }
View Full Code Here

        deleteListContainer(containerId);
    }

    public synchronized void deleteListContainer(ContainerId containerId) throws IOException {
        initialize();
        ListContainerImpl container = lists.remove(containerId);
        if (container != null) {
            listsContainer.removeRoot(container.getIndexManager(), containerId);
            container.clear();
            container.close();
        }
    }
View Full Code Here

    public synchronized ListContainer getListContainer(Object id, String containerName,
                                                       boolean persistentIndex) throws IOException {
        initialize();
        ContainerId containerId = new ContainerId(id, containerName);
        ListContainerImpl result = lists.get(containerId);
        if (result == null) {
            DataManager dm = getDataManager(containerName);
            IndexManager im = getIndexManager(dm, containerName);

            IndexItem root = listsContainer.getRoot(im, containerId);
            if (root == null) {
                root = listsContainer.addRoot(im, containerId);
            }
            result = new ListContainerImpl(containerId, root, im, dm, persistentIndex);
            lists.put(containerId, result);
        }
        return result;
    }
View Full Code Here

        deleteListContainer(containerId);
    }

    public synchronized void deleteListContainer(ContainerId containerId) throws IOException {
        initialize();
        ListContainerImpl container = lists.remove(containerId);
        if (container != null) {
            listsContainer.removeRoot(container.getIndexManager(), containerId);
            container.clear();
            container.close();
        }
    }
View Full Code Here

            throws IOException{
        initialize();
        ContainerId containerId=new ContainerId();
        containerId.setKey(id);
        containerId.setDataContainerName(containerName);
        ListContainerImpl result=(ListContainerImpl)lists.get(containerId);
        if(result==null){
            DataManager dm=getDataManager(containerName);
            IndexManager im=getIndexManager(dm,containerName);
           
            IndexItem root=listsContainer.getRoot(im,containerId);
            if(root==null){
                root=listsContainer.addRoot(im,containerId);
            }
            result=new ListContainerImpl(containerId,root,im,dm,indexType);
            lists.put(containerId,result);
        }
        return result;
    }
View Full Code Here

    public void deleteListContainer(Object id,String containerName) throws IOException{
        initialize();
        ContainerId containerId=new ContainerId();
        containerId.setKey(id);
        containerId.setDataContainerName(containerName);
        ListContainerImpl container=(ListContainerImpl)lists.remove(containerId);
        if(container!=null){
            listsContainer.removeRoot(container.getIndexManager(),containerId);
            container.clear();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.kaha.impl.container.ListContainerImpl

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.