Package org.codehaus.aspectwerkz.extension.persistence.definition

Examples of org.codehaus.aspectwerkz.extension.persistence.definition.IndexDefinition


        final List indexRefDefinitions = persistenceManagerDef.getIndexRefs();
        for (Iterator it = indexRefDefinitions.iterator(); it.hasNext();) {
            String indexName = ((IndexRefDefinition)it.next()).getName();
            List indexDefinitions = m_definition.getIndexes();
            for (Iterator it2 = indexDefinitions.iterator(); it2.hasNext();) {
                IndexDefinition indexDefinition = (IndexDefinition)it2.next();
                if (indexDefinition.getName().equals(indexName)) {
                    btreeIndexes.add(indexDefinition);
                }
            }
        }
        return btreeIndexes;
View Full Code Here


        if (btreeIndexes == null) throw new IllegalArgumentException("index configurations can not be null");

        final List indexes = new ArrayList();
        for (Iterator it = btreeIndexes.iterator(); it.hasNext();) {

            final IndexDefinition indexDef = (IndexDefinition)it.next();
            final String jispIndexType = getJispIndexType(indexDef.getType());

            ObjectFactory factory = new DefaultObjectFactory(jispIndexType);

            final StringBuffer indexFile = new StringBuffer();
            indexFile.append(m_indexDir);
            indexFile.append(File.separator);
            indexFile.append(indexDef.getName());

            File killit = new File(indexFile.toString());
            if (killit.exists()) killit.delete();

            final BTreeIndex index = new BTreeIndex(
                    indexFile.toString(),
                    INDEX_ORDER,
                    (KeyObject)factory.newInstance(),
                    false, m_loader);

            indexes.add(index);

            m_jispIndexes.put(indexDef.getName(), index);

            final Class indexType = m_loader.loadClass(
                    getJispIndexType(indexDef.getType()));

            m_jispIndexTypes.put(indexDef.getName(), indexType);
        }
        return indexes;
    }
View Full Code Here

        final List indexes = new ArrayList();

        for (Iterator it = btreeIndexes.iterator(); it.hasNext();) {

            final IndexDefinition indexDef = (IndexDefinition)it.next();

            final StringBuffer indexFile = new StringBuffer();
            indexFile.append(m_databaseDir);
            indexFile.append(File.separator);
            indexFile.append(indexDef.getName());

            final BTreeIndex index = new BTreeIndex(indexFile.toString(), m_loader);
            indexes.add(index);

            m_jispIndexes.put(indexDef.getName(), index);

            final Class indexType = m_loader.loadClass(
                    getJispIndexType(indexDef.getType()));

            m_jispIndexTypes.put(indexDef.getName(), indexType);
        }
        return indexes;
    }
View Full Code Here

     */
    private static void parseIndexElements(
            final Element root,
            final PersistenceDefinition definition) {
        for (Iterator it1 = root.elementIterator("index"); it1.hasNext();) {
            IndexDefinition indexDef = new IndexDefinition();

            Element introduction = (Element)it1.next();
            for (Iterator it2 = introduction.attributeIterator(); it2.hasNext();) {
                Attribute attribute = (Attribute)it2.next();

                String name = attribute.getName().trim();
                String value = attribute.getValue().trim();
                if (name.equals("name")) {
                    indexDef.setName(value);
                    continue;
                }
                else if (name.equals("type")) {
                    indexDef.setType(value);
                    continue;
                }
            }
            definition.addIndex(indexDef);
        }
View Full Code Here

        final List indexRefDefinitions = persistenceManagerDef.getIndexRefs();
        for (Iterator it = indexRefDefinitions.iterator(); it.hasNext();) {
            String indexName = ((IndexRefDefinition)it.next()).getName();
            List indexDefinitions = m_definition.getIndexes();
            for (Iterator it2 = indexDefinitions.iterator(); it2.hasNext();) {
                IndexDefinition indexDefinition = (IndexDefinition)it2.next();
                if (indexDefinition.getName().equals(indexName)) {
                    btreeIndexes.add(indexDefinition);
                }
            }
        }
        return btreeIndexes;
View Full Code Here

        if (btreeIndexes == null) throw new IllegalArgumentException("index configurations can not be null");

        final List indexes = new ArrayList();
        for (Iterator it = btreeIndexes.iterator(); it.hasNext();) {

            final IndexDefinition indexDef = (IndexDefinition)it.next();
            final String jispIndexType = getJispIndexType(indexDef.getType());

            ObjectFactory factory = new DefaultObjectFactory(jispIndexType);

            final StringBuffer indexFile = new StringBuffer();
            indexFile.append(m_indexDir);
            indexFile.append(File.separator);
            indexFile.append(indexDef.getName());

            File killit = new File(indexFile.toString());
            if (killit.exists()) killit.delete();

            final BTreeIndex index = new BTreeIndex(
                    indexFile.toString(),
                    INDEX_ORDER,
                    (KeyObject)factory.newInstance(),
                    false, m_loader);

            indexes.add(index);

            m_jispIndexes.put(indexDef.getName(), index);

            final Class indexType = m_loader.loadClass(
                    getJispIndexType(indexDef.getType()));

            m_jispIndexTypes.put(indexDef.getName(), indexType);
        }
        return indexes;
    }
View Full Code Here

        final List indexes = new ArrayList();

        for (Iterator it = btreeIndexes.iterator(); it.hasNext();) {

            final IndexDefinition indexDef = (IndexDefinition)it.next();

            final StringBuffer indexFile = new StringBuffer();
            indexFile.append(m_databaseDir);
            indexFile.append(File.separator);
            indexFile.append(indexDef.getName());

            final BTreeIndex index = new BTreeIndex(indexFile.toString(), m_loader);
            indexes.add(index);

            m_jispIndexes.put(indexDef.getName(), index);

            final Class indexType = m_loader.loadClass(
                    getJispIndexType(indexDef.getType()));

            m_jispIndexTypes.put(indexDef.getName(), indexType);
        }
        return indexes;
    }
View Full Code Here

     */
    private static void parseIndexElements(
            final Element root,
            final PersistenceDefinition definition) {
        for (Iterator it1 = root.elementIterator("index"); it1.hasNext();) {
            IndexDefinition indexDef = new IndexDefinition();

            Element introduction = (Element)it1.next();
            for (Iterator it2 = introduction.attributeIterator(); it2.hasNext();) {
                Attribute attribute = (Attribute)it2.next();

                String name = attribute.getName().trim();
                String value = attribute.getValue().trim();
                if (name.equals("name")) {
                    indexDef.setName(value);
                    continue;
                }
                else if (name.equals("type")) {
                    indexDef.setType(value);
                    continue;
                }
            }
            definition.addIndex(indexDef);
        }
View Full Code Here

     */
    private static void parseIndexElements(
            final Element root,
            final PersistenceDefinition definition) {
        for (Iterator it1 = root.elementIterator("index"); it1.hasNext();) {
            IndexDefinition indexDef = new IndexDefinition();

            Element introduction = (Element)it1.next();
            for (Iterator it2 = introduction.attributeIterator(); it2.hasNext();) {
                Attribute attribute = (Attribute)it2.next();

                String name = attribute.getName().trim();
                String value = attribute.getValue().trim();
                if (name.equals("name")) {
                    indexDef.setName(value);
                    continue;
                }
                else if (name.equals("type")) {
                    indexDef.setType(value);
                    continue;
                }
            }
            definition.addIndex(indexDef);
        }
View Full Code Here

        final List indexRefDefinitions = persistenceManagerDef.getIndexRefs();
        for (Iterator it = indexRefDefinitions.iterator(); it.hasNext();) {
            String indexName = ((IndexRefDefinition)it.next()).getName();
            List indexDefinitions = m_definition.getIndexes();
            for (Iterator it2 = indexDefinitions.iterator(); it2.hasNext();) {
                IndexDefinition indexDefinition = (IndexDefinition)it2.next();
                if (indexDefinition.getName().equals(indexName)) {
                    btreeIndexes.add(indexDefinition);
                }
            }
        }
        return btreeIndexes;
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.extension.persistence.definition.IndexDefinition

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.