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

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


        PersistenceDefinition persistenceDefinition = PersistenceDefinitionParser.
                parse(new File(PERSISTENCE_DEFINITION));

        List persistenceManagers = persistenceDefinition.getPersistenceManagers();
        for (Iterator it = persistenceManagers.iterator(); it.hasNext();) {
            PersistenceManagerDefinition manager = (PersistenceManagerDefinition)it.next();
            if (manager.isActive()) {
                m_persistenceManager = (PersistenceManager)startService(
                        m_loader, manager.getClassName(), persistenceDefinition);
                break;
            }
        }
    }
View Full Code Here


        if (definition == null) throw new IllegalArgumentException("definition can not be null");

        m_loader = loader;
        m_definition = (PersistenceDefinition)definition;

        PersistenceManagerDefinition persistenceManagerDef = null;
        for (Iterator it = m_definition.getPersistenceManagers().iterator(); it.hasNext();) {
            PersistenceManagerDefinition def = (PersistenceManagerDefinition)it.next();
            if (def.getClassName().equals(getClass().getName())) {
                persistenceManagerDef = def;
                break;
            }
        }
        if (persistenceManagerDef == null) throw new RuntimeException("no definition specified for persistence manager: " + getClass().getName());
View Full Code Here

    private static void parsePersistenceManagerElements(
            final Element root,
            final PersistenceDefinition definition) {
        for (Iterator it1 = root.elementIterator("persistence-manager"); it1.hasNext();) {

            PersistenceManagerDefinition pmDef = new PersistenceManagerDefinition();

            final Element pm = (Element)it1.next();
            for (Iterator it2 = pm.attributeIterator(); it2.hasNext();) {
                Attribute attribute = (Attribute)it2.next();
                String name = attribute.getName().trim();
                String value = attribute.getValue().trim();
                if (name.equals("class")) {
                    pmDef.setClassName(value);
                }
                else if (name.equals("active")) {
                    pmDef.setActive(value);
                }
            }
            for (Iterator it2 = pm.elementIterator(); it2.hasNext();) {
                Element nestedAdviceElement = (Element)it2.next();

                if (nestedAdviceElement.getName().trim().equals("index-ref")) {
                    IndexRefDefinition indexDef = new IndexRefDefinition();
                    indexDef.setName(nestedAdviceElement.attributeValue("name"));
                    pmDef.addIndexRef(indexDef);
                }
                else if (nestedAdviceElement.getName().trim().equals("param")) {
                    ParameterDefinition paramDef = new ParameterDefinition();
                    paramDef.setName(nestedAdviceElement.attributeValue("name"));
                    paramDef.setValue(nestedAdviceElement.getText());
                    pmDef.addParameter(paramDef);
                }
            }

            definition.addPersistenceManager(pmDef);
        }
View Full Code Here

        PersistenceDefinition persistenceDefinition = PersistenceDefinitionParser.
                parse(new File(PERSISTENCE_DEFINITION));

        List persistenceManagers = persistenceDefinition.getPersistenceManagers();
        for (Iterator it = persistenceManagers.iterator(); it.hasNext();) {
            PersistenceManagerDefinition manager = (PersistenceManagerDefinition)it.next();
            if (manager.isActive()) {
                m_persistenceManager = (PersistenceManager)startService(
                        m_loader, manager.getClassName(), persistenceDefinition);
                break;
            }
        }
    }
View Full Code Here

        if (definition == null) throw new IllegalArgumentException("definition can not be null");

        m_loader = loader;
        m_definition = (PersistenceDefinition)definition;

        PersistenceManagerDefinition persistenceManagerDef = null;
        for (Iterator it = m_definition.getPersistenceManagers().iterator(); it.hasNext();) {
            PersistenceManagerDefinition def = (PersistenceManagerDefinition)it.next();
            if (def.getClassName().equals(getClass().getName())) {
                persistenceManagerDef = def;
                break;
            }
        }
        if (persistenceManagerDef == null) throw new RuntimeException("no definition specified for persistence manager: " + getClass().getName());
View Full Code Here

    private static void parsePersistenceManagerElements(
            final Element root,
            final PersistenceDefinition definition) {
        for (Iterator it1 = root.elementIterator("persistence-manager"); it1.hasNext();) {

            PersistenceManagerDefinition pmDef = new PersistenceManagerDefinition();

            final Element pm = (Element)it1.next();
            for (Iterator it2 = pm.attributeIterator(); it2.hasNext();) {
                Attribute attribute = (Attribute)it2.next();
                String name = attribute.getName().trim();
                String value = attribute.getValue().trim();
                if (name.equals("class")) {
                    pmDef.setClassName(value);
                }
                else if (name.equals("active")) {
                    pmDef.setActive(value);
                }
            }
            for (Iterator it2 = pm.elementIterator(); it2.hasNext();) {
                Element nestedAdviceElement = (Element)it2.next();

                if (nestedAdviceElement.getName().trim().equals("index-ref")) {
                    IndexRefDefinition indexDef = new IndexRefDefinition();
                    indexDef.setName(nestedAdviceElement.attributeValue("name"));
                    pmDef.addIndexRef(indexDef);
                }
                else if (nestedAdviceElement.getName().trim().equals("param")) {
                    ParameterDefinition paramDef = new ParameterDefinition();
                    paramDef.setName(nestedAdviceElement.attributeValue("name"));
                    paramDef.setValue(nestedAdviceElement.getText());
                    pmDef.addParameter(paramDef);
                }
            }

            definition.addPersistenceManager(pmDef);
        }
View Full Code Here

    private static void parsePersistenceManagerElements(
            final Element root,
            final PersistenceDefinition definition) {
        for (Iterator it1 = root.elementIterator("persistence-manager"); it1.hasNext();) {

            PersistenceManagerDefinition pmDef = new PersistenceManagerDefinition();

            final Element pm = (Element)it1.next();
            for (Iterator it2 = pm.attributeIterator(); it2.hasNext();) {
                Attribute attribute = (Attribute)it2.next();
                String name = attribute.getName().trim();
                String value = attribute.getValue().trim();
                if (name.equals("class")) {
                    pmDef.setClassName(value);
                }
                else if (name.equals("active")) {
                    pmDef.setActive(value);
                }
            }
            for (Iterator it2 = pm.elementIterator(); it2.hasNext();) {
                Element nestedAdviceElement = (Element)it2.next();

                if (nestedAdviceElement.getName().trim().equals("index-ref")) {
                    IndexRefDefinition indexDef = new IndexRefDefinition();
                    indexDef.setName(nestedAdviceElement.attributeValue("name"));
                    pmDef.addIndexRef(indexDef);
                }
                else if (nestedAdviceElement.getName().trim().equals("param")) {
                    ParameterDefinition paramDef = new ParameterDefinition();
                    paramDef.setName(nestedAdviceElement.attributeValue("name"));
                    paramDef.setValue(nestedAdviceElement.getText());
                    pmDef.addParameter(paramDef);
                }
            }

            definition.addPersistenceManager(pmDef);
        }
View Full Code Here

        PersistenceDefinition persistenceDefinition = PersistenceDefinitionParser.
                parse(new File(PERSISTENCE_DEFINITION));

        List persistenceManagers = persistenceDefinition.getPersistenceManagers();
        for (Iterator it = persistenceManagers.iterator(); it.hasNext();) {
            PersistenceManagerDefinition manager = (PersistenceManagerDefinition)it.next();
            if (manager.isActive()) {
                m_persistenceManager = (PersistenceManager)startService(
                        m_loader, manager.getClassName(), persistenceDefinition);
                break;
            }
        }
    }
View Full Code Here

        if (definition == null) throw new IllegalArgumentException("definition can not be null");

        m_loader = loader;
        m_definition = (PersistenceDefinition)definition;

        PersistenceManagerDefinition persistenceManagerDef = null;
        for (Iterator it = m_definition.getPersistenceManagers().iterator(); it.hasNext();) {
            PersistenceManagerDefinition def = (PersistenceManagerDefinition)it.next();
            if (def.getClassName().equals(getClass().getName())) {
                persistenceManagerDef = def;
                break;
            }
        }
        if (persistenceManagerDef == null) throw new RuntimeException("no definition specified for persistence manager: " + getClass().getName());
View Full Code Here

TOP

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

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.