Package org.exolab.castor.persist.spi

Examples of org.exolab.castor.persist.spi.PersistenceFactory


            if (_clsMapping == null) {
            throw new DTXException("dtx.NoClassDescription: " + _objType);
            }

            PersistenceFactory factory = _eng.getFactory();

            if (factory == null) {
            throw new DTXException("dtx.NoFactory");
            }

            QueryExpression expr = factory.getQueryExpression();

            if (expr == null) {
            throw new DTXException("dtx.NoQueryExpression");
            }
View Full Code Here


            AbstractProperties properties = CPAProperties.getInstance();
            Object[] objects = properties.getObjectArray(
                    CPAProperties.PERSISTENCE_FACTORIES, properties.getApplicationClassLoader());
            for (int i = 0; i < objects.length; i++) {
                PersistenceFactory factory = (PersistenceFactory) objects[i];
                _factories.put(factory.getFactoryName(), factory);
            }
        }
    }
View Full Code Here

     * @throws MappingException If LockEngine could not be initialized.
     */
    private void initializeEngine(final String engine) throws MappingException {
        // Complain if no database engine was specified, otherwise get
        // a persistence factory for that database engine.
        PersistenceFactory factory;
        if (engine == null) {
            factory = PersistenceFactoryRegistry.getPersistenceFactory(GENERIC_ENGINE);
        } else {
            factory = PersistenceFactoryRegistry.getPersistenceFactory(engine);
        }
View Full Code Here

    /**
     * Tests whether the factory name returned equals "pointbase"
     * @throws Exception
     */
    public void testGetName() throws Exception {
        PersistenceFactory factory = new PointbaseFactory();
        assertNotNull(factory);
        assertEquals("pointbase", factory.getFactoryName());
    }
View Full Code Here

     * {@see PointbaseFactory} is of type
     * {@see org.castor.jdo.drivers.PointbaseQueryExpression}.
     * @throws Exception
     */
    public void testGetQueryExpression() throws Exception {
        PersistenceFactory factory = new PointbaseFactory();
        assertNotNull(factory);
       
        QueryExpression expression = factory.getQueryExpression();
        assertNotNull(expression);
       
        assertEquals(PointbaseQueryExpression.class.getName(),
                expression.getClass().getName());
    }
View Full Code Here

    private static synchronized void load()
    {
        if ( _factories == null ) {
            String             prop;
            StringTokenizer    tokenizer;
            PersistenceFactory factory;
            Class              cls;
           
            _factories = new Hashtable();
            prop = LocalConfiguration.getInstance().getProperty( FactoriesProperty, "" );
            tokenizer = new StringTokenizer( prop, ", " );
            while ( tokenizer.hasMoreTokens() ) {
                prop = tokenizer.nextToken();
                try {
                    cls = PersistenceFactoryRegistry.class.getClassLoader().loadClass( prop );
                    factory = (PersistenceFactory) cls.newInstance();
                    _factories.put( factory.getFactoryName(), factory );
                } catch ( Exception except ) {
                    Logger.getSystemLogger().println( Messages.format( "persist.missingPersistenceFactory", prop ) );
                }
            }
        }
View Full Code Here

        Mapping            mapping;
        Enumeration        mappings;
        Database           database;
        // Database[]         databases;
        DatabaseRegistry   dbs;
        PersistenceFactory factory;

        try {
            // Load the JDO configuration file from the specified input source.
            // databases = JDOConfLoader.getDatabases (baseURI, resolver);
           
View Full Code Here

        Unmarshaller       unm;
        Mapping            mapping;
        Enumeration        mappings;
        Database           database;
        DatabaseRegistry   dbs;
        PersistenceFactory factory;

        unm = new Unmarshaller( Database.class );
        try {
            // Load the JDO database configuration file from the specified
            // input source. If the database was already configured, ignore
View Full Code Here

    private static synchronized void load()
    {
        if ( _factories == null ) {
            String             prop;
            StringTokenizer    tokenizer;
            PersistenceFactory factory;
            Class              cls;
           
            _factories = new Hashtable();
            prop = LocalConfiguration.getInstance().getProperty( FactoriesProperty, "" );
            tokenizer = new StringTokenizer( prop, ", " );
            while ( tokenizer.hasMoreTokens() ) {
                prop = tokenizer.nextToken();
                try {
                    cls = PersistenceFactoryRegistry.class.getClassLoader().loadClass( prop );
                    factory = (PersistenceFactory) cls.newInstance();
                    _factories.put( factory.getFactoryName(), factory );
                } catch ( Exception except ) {
                    Logger.getSystemLogger().println( Messages.format( "persist.missingPersistenceFactory", prop ) );
                }
            }
        }
View Full Code Here

      if (_clsMapping == null) {
    throw new DTXException("dtx.NoClassDescription: " + _objType);
      }

      PersistenceFactory factory = _eng.getFactory();

      if (factory == null) {
    throw new DTXException("dtx.NoFactory");
      }

      QueryExpression expr = factory.getQueryExpression();

      if (expr == null) {
    throw new DTXException("dtx.NoQueryExpression");
      }
View Full Code Here

TOP

Related Classes of org.exolab.castor.persist.spi.PersistenceFactory

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.