Package org.apache.ojb.broker.metadata

Examples of org.apache.ojb.broker.metadata.ConnectionRepository


        {
            log.debug("Initializing OJB");
        }

        // This line effectively loads OJB.properties & repository.xml
        ConnectionRepository     connRep = MetadataManager.getInstance().connectionRepository();
        JdbcConnectionDescriptor jcd     = connRep.addDescriptor("default", dataSource, username, password);
        SequenceDescriptor       seqDesc = new SequenceDescriptor(jcd);

        seqDesc.setSequenceManagerClass(SequenceManagerHighLowImpl.class);
        jcd.setSequenceDescriptor(seqDesc);
    }
View Full Code Here


    }

    public void afterPropertiesSet () throws Exception
    {
        // Try to find JCD
        ConnectionRepository cr = MetadataManager.getInstance().connectionRepository();
        JdbcConnectionDescriptor jcd = cr.getDescriptor(new PBKey(jcdAlias));
        if (jcd == null)
        {
            jcd = new JdbcConnectionDescriptor();
            jcd.setJcdAlias(jcdAlias);
            cr.addDescriptor(jcd);
        }
        if (platform != null && platform.length() == 0)
        {
            platform = null;
        }
View Full Code Here

     * This should be ObjectCacheEmptyImpl, because this is declared at jdbc-connection-descriptor
     * level.
     */
    public void testPerDatabaseCache()
    {
        ConnectionRepository cr = MetadataManager.getInstance()
                .readConnectionRepository(MetadataTest.TEST_REPOSITORY);
        MetadataManager.getInstance().mergeConnectionRepository(cr);

        PersistenceBroker pb = PersistenceBrokerFactory.createPersistenceBroker(new PBKey("runtime_2"));
        try
        {
            ObjectCache oc = pb.serviceObjectCache();
            CacheObject testObj = new CacheObject(null, "testPerDatabaseCache");
            Identity oid = new Identity(testObj, pb);
            oc.cache(oid, testObj);
            Object result = oc.lookup(oid);
            assertNull("We should not found this object in cache", result);
        }
        finally
        {
            if (pb != null && !pb.isClosed()) pb.close();
            MetadataManager.getInstance().connectionRepository().removeDescriptor(cr.getAllDescriptor().get(0));
        }
    }
View Full Code Here

            jcd = new JdbcConnectionDescriptor();
            jcd.setJcdAlias(JCD_ALIAS);
            ConnectionPoolDescriptor cpd = new ConnectionPoolDescriptor();
            cpd.setConnectionFactory(ConnectionFactoryManagedImpl.class);
            jcd.setConnectionPoolDescriptor(cpd);
            ConnectionRepository cr = MetadataManager.getInstance().connectionRepository();
            cr.addDescriptor(jcd);
        }
        // Instatiating application
        ctx = new GenericApplicationContext();
        XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(ctx);
        xmlReader.loadBeanDefinitions(new ClassPathResource("META-INF/jboss-secsvc/jboss-security-service.xml"));
View Full Code Here

    }

    private JdbcConnectionDescriptor findJcd()
    {
        // Try to find JCD
        ConnectionRepository cr = MetadataManager.getInstance().connectionRepository();
        return cr.getDescriptor(new PBKey(JCD_ALIAS));
    }
View Full Code Here

    }

    public void afterPropertiesSet () throws Exception
    {
        // Try to find JCD
        ConnectionRepository cr = MetadataManager.getInstance().connectionRepository();
        JdbcConnectionDescriptor jcd = cr.getDescriptor(new PBKey(jcdAlias));
        if (jcd == null)
        {
            jcd = new JdbcConnectionDescriptor();
            jcd.setJcdAlias(jcdAlias);
            cr.addDescriptor(jcd);
        }
        if (platform != null && platform.length() == 0)
        {
            platform = null;
        }
View Full Code Here

    }
   
    public void init()
    throws Exception
    {
        ConnectionRepository cr = MetadataManager.getInstance().connectionRepository();
        JdbcConnectionDescriptor jcd = cr.getDescriptor(new PBKey(jcdAlias));
        if (jcd == null)
        {
            jcd = new JdbcConnectionDescriptor();
            jcd.setJcdAlias(jcdAlias);
            cr.addDescriptor(jcd);
        }
       
        JdbcMetadataUtils jdbcMetadataUtils = new JdbcMetadataUtils ();
        jdbcMetadataUtils.fillJCDFromDataSource(jcd, ds, null, null);
        String platform = jcd.getDbms();
View Full Code Here

            jcd = new JdbcConnectionDescriptor();
            jcd.setJcdAlias(JCD_ALIAS);
            ConnectionPoolDescriptor cpd = new ConnectionPoolDescriptor();
            cpd.setConnectionFactory(ConnectionFactoryManagedImpl.class);
            jcd.setConnectionPoolDescriptor(cpd);
            ConnectionRepository cr = MetadataManager.getInstance().connectionRepository();
            cr.addDescriptor(jcd);
        }
        // Instatiating application
        ctx = new GenericApplicationContext();
        XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(ctx);
        xmlReader.loadBeanDefinitions(new ClassPathResource("META-INF/jboss-secsvc/jboss-security-service.xml"));
View Full Code Here

    }

    private JdbcConnectionDescriptor findJcd()
    {
        // Try to find JCD
        ConnectionRepository cr = MetadataManager.getInstance().connectionRepository();
        return cr.getDescriptor(new PBKey(JCD_ALIAS));
    }
View Full Code Here

    }

    public void afterPropertiesSet () throws Exception
    {
        // Try to find JCD
        ConnectionRepository cr = MetadataManager.getInstance().connectionRepository();
        JdbcConnectionDescriptor jcd = cr.getDescriptor(new PBKey(jcdAlias));
        if (jcd == null)
        {
            jcd = new JdbcConnectionDescriptor();
            jcd.setJcdAlias(jcdAlias);
            cr.addDescriptor(jcd);
        }
        if (platform != null && platform.length() == 0)
        {
            platform = null;
        }
View Full Code Here

TOP

Related Classes of org.apache.ojb.broker.metadata.ConnectionRepository

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.