Package com.sun.jdo.spi.persistence.support.sqlstore.impl

Examples of com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl


     * @see getContainer(Object)
     * @param container a Container instance for the request.
     */
    public PersistenceManagerFactory getPersistenceManagerFactory(Object container) {
        Object rc = null;
        PersistenceManagerFactoryImpl pmf = null;

        ResourceReferenceDescriptor cmpResource = ((Container)container).getEjbDescriptor().
            getEjbBundleDescriptor().getCMPResourceReference();

        String name = cmpResource.getJndiName();

        try {
            InitialContext ic = new InitialContext();
            rc = ic.lookup(name);

            if (rc instanceof PersistenceManagerFactoryImpl) {
                pmf = (PersistenceManagerFactoryImpl)rc;

            } else if (rc instanceof javax.sql.DataSource) {
                pmf = new PersistenceManagerFactoryImpl();
                pmf.setConnectionFactoryName(ResourceInstaller.getPMJndiName(name));

                Iterator it = cmpResource.getProperties();
                if (it != null) {
                    while (it.hasNext()) {
                        NameValuePairDescriptor prop = (NameValuePairDescriptor)it.next();
                        String n = prop.getName();

                        // Any value that is not "true" is treated as "false":
                        boolean value = Boolean.valueOf(prop.getValue()).booleanValue();
                        pmf.setBooleanProperty(n, value);

                    }
                }

            } else {
View Full Code Here


     * @see getContainer(Object)
     * @param container a Container instance for the request.
     */
    public PersistenceManagerFactory getPersistenceManagerFactory(Object container) {
        Object rc = null;
        PersistenceManagerFactoryImpl pmf = null;

        ResourceReferenceDescriptor cmpResource = ((Container)container).getEjbDescriptor().
            getEjbBundleDescriptor().getCMPResourceReference();

        String name = cmpResource.getJndiName();

        try {
            InitialContext ic = new InitialContext();
            rc = ic.lookup(name);

            if (rc instanceof PersistenceManagerFactoryImpl) {
                pmf = (PersistenceManagerFactoryImpl)rc;

            } else if (rc instanceof javax.sql.DataSource) {
                pmf = new PersistenceManagerFactoryImpl();
                pmf.setConnectionFactoryName(ConnectorsUtil.getPMJndiName(name));

                Iterator it = cmpResource.getProperties();
                if (it != null) {
                    while (it.hasNext()) {
                        NameValuePairDescriptor prop = (NameValuePairDescriptor)it.next();
                        String n = prop.getName();

                        // Any value that is not "true" is treated as "false":
                        boolean value = Boolean.valueOf(prop.getValue()).booleanValue();
                        pmf.setBooleanProperty(n, value);

                    }
                }

            } else {
View Full Code Here

     * @see getContainer(Object)
     * @param container a Container instance for the request.
     */
    public PersistenceManagerFactory getPersistenceManagerFactory(Object container) {
        Object rc = null;
        PersistenceManagerFactoryImpl pmf = null;

        ResourceReferenceDescriptor cmpResource = ((Container)container).getEjbDescriptor().
            getEjbBundleDescriptor().getCMPResourceReference();

        String name = cmpResource.getJndiName();

        try {
            InitialContext ic = new InitialContext();
            rc = ic.lookup(name);

            if (rc instanceof PersistenceManagerFactoryImpl) {
                pmf = (PersistenceManagerFactoryImpl)rc;

            } else if (rc instanceof javax.sql.DataSource) {
                pmf = new PersistenceManagerFactoryImpl();
                pmf.setConnectionFactoryName(ConnectorsUtil.getPMJndiName(name));

                Iterator it = cmpResource.getProperties();
                if (it != null) {
                    while (it.hasNext()) {
                        NameValuePairDescriptor prop = (NameValuePairDescriptor)it.next();
                        String n = prop.getName();

                        // Any value that is not "true" is treated as "false":
                        boolean value = Boolean.valueOf(prop.getValue()).booleanValue();
                        pmf.setBooleanProperty(n, value);

                    }
                }

            } else {
View Full Code Here

     * @see getContainer(Object)
     * @param container a Container instance for the request.
     */
    public PersistenceManagerFactory getPersistenceManagerFactory(Object container) {
        Object rc = null;
        PersistenceManagerFactoryImpl pmf = null;

        ResourceReferenceDescriptor cmpResource = ((Container)container).getEjbDescriptor().
            getEjbBundleDescriptor().getCMPResourceReference();

        String name = cmpResource.getJndiName();

        try {
            InitialContext ic = new InitialContext();
            rc = ic.lookup(name);

            if (rc instanceof PersistenceManagerFactoryImpl) {
                pmf = (PersistenceManagerFactoryImpl)rc;

            } else if (rc instanceof javax.sql.DataSource) {
                pmf = new PersistenceManagerFactoryImpl();
                pmf.setConnectionFactoryName(ConnectorsUtil.getPMJndiName(name));

                Iterator it = cmpResource.getProperties();
                if (it != null) {
                    while (it.hasNext()) {
                        NameValuePairDescriptor prop = (NameValuePairDescriptor)it.next();
                        String n = prop.getName();

                        // Any value that is not "true" is treated as "false":
                        boolean value = Boolean.valueOf(prop.getValue()).booleanValue();
                        pmf.setBooleanProperty(n, value);

                    }
                }

            } else {
View Full Code Here

TOP

Related Classes of com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl

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.