Package org.apache.openejb.assembler.classic

Examples of org.apache.openejb.assembler.classic.ResourceInfo


        }
        logger.debug(message);

        // if there is a provider with the specified name. use it
        if (hasServiceProvider(resourceId)) {
            ResourceInfo resourceInfo = configFactory.configureService(resourceId, ResourceInfo.class);
            return installResource(beanName, resourceInfo);
        } else if (hasServiceProvider(shortName)) {
            ResourceInfo resourceInfo = configFactory.configureService(shortName, ResourceInfo.class);
            return installResource(beanName, resourceInfo);
        }

        // if there are any resources of the desired type, use the first one
        id = firstMatching(type, required, appResources);
View Full Code Here


        String resourceId;
        resourceId = ServiceUtils.getServiceProviderId(type, required);
        if (resourceId == null) {
            throw new OpenEJBException("No provider available for resource-ref '" + resourceId + "' of type '" + type + "' for '" + beanName + "'.");
        }
        ResourceInfo resourceInfo = configFactory.configureService(resourceId, ResourceInfo.class);

        logAutoCreateResource(resourceInfo, type, beanName);
        return installResource(beanName, resourceInfo);
    }
View Full Code Here

        }

        Resource resource = new Resource(resourceId, null, providerId);
        resource.getProperties().setProperty("destination", resourceId);

        ResourceInfo resourceInfo = configFactory.configureService(resource, ResourceInfo.class);
        logAutoCreateResource(resourceInfo, type, beanName);
        return installResource(beanName, resourceInfo);
    }
View Full Code Here

     *
     * @throws Exception
     */
    public void test() throws Exception {

        ResourceInfo jta = addDataSource("Orange", OrangeDriver.class, "jdbc:orange:some:stuff", true);
        ResourceInfo nonJta = addDataSource("OrangeUnmanaged", OrangeDriver.class, "jdbc:orange:some:stuff", false);

        assertSame(jta, resources.get(0));
        assertSame(nonJta, resources.get(1));

        PersistenceUnitInfo unitInfo = addPersistenceUnit("orange-unit", "orange", "orangeUnmanaged");
View Full Code Here

     *
     * @throws Exception
     */
    public void testMultiple() throws Exception {

        ResourceInfo orangeJta = addDataSource("Orange", OrangeDriver.class, "jdbc:orange:some:stuff", true);
        ResourceInfo orangeNonJta = addDataSource("OrangeUnmanaged", OrangeDriver.class, "jdbc:orange:some:stuff", false);
        ResourceInfo limeJta = addDataSource("Lime", LimeDriver.class, "jdbc:lime:some:stuff", true);
        ResourceInfo limeNonJta = addDataSource("LimeUnmanaged", LimeDriver.class, "jdbc:lime:some:stuff", false);

        assertSame(orangeJta, resources.get(0));
        assertSame(orangeNonJta, resources.get(1));
        assertSame(limeJta, resources.get(2));
        assertSame(limeNonJta, resources.get(3));
View Full Code Here

     *
     * @throws Exception
     */
    public void testThirdPartyDataSources() throws Exception {

        ResourceInfo jta = addDataSource("Orange", OrangeDriver.class, "jdbc:orange:some:stuff", null);
        ResourceInfo nonJta = addDataSource("OrangeUnmanaged", OrangeDriver.class, "jdbc:orange:some:stuff", null);

        assertSame(jta, resources.get(0));
        assertSame(nonJta, resources.get(1));

        PersistenceUnitInfo unitInfo = addPersistenceUnit("orange-unit", "orange", "orangeUnmanaged");
View Full Code Here

     *
     * @throws Exception
     */
    public void testThirdPartyDataSources2() throws Exception {

        ResourceInfo dataSource = addDataSource("Orange", OrangeDriver.class, "jdbc:orange:some:stuff", null);

        assertSame(dataSource, resources.get(0));

        PersistenceUnitInfo unitInfo = addPersistenceUnit("orange-unit", "orange", null);

View Full Code Here

     *
     * @throws Exception
     */
    public void testThirdPartyDataSources3() throws Exception {

        ResourceInfo dataSource = addDataSource("Orange", OrangeDriver.class, "jdbc:orange:some:stuff", null);

        assertSame(dataSource, resources.get(0));

        PersistenceUnitInfo unitInfo = addPersistenceUnit("orange-unit", null, "orange");

View Full Code Here

     *
     * @throws Exception
     */
    public void testThirdPartyDataSources4() throws Exception {

        ResourceInfo dataSource = addDataSource("Orange", OrangeDriver.class, "jdbc:orange:some:stuff", null);

        assertSame(dataSource, resources.get(0));

        PersistenceUnitInfo unitInfo = addPersistenceUnit("orange-unit""orange", "orange");

View Full Code Here

     *
     * @throws Exception
     */
    public void testSameDataSourceForBoth1() throws Exception {

        ResourceInfo supplied = addDataSource("Orange", OrangeDriver.class, "jdbc:orange:some:stuff", true);

        assertSame(supplied, resources.get(0));

        PersistenceUnitInfo unitInfo = addPersistenceUnit("orange-unit", "orange", "orange");

        assertNotNull(unitInfo);

        ResourceInfo generated = resources.get(1);

        assertEquals(supplied.id, unitInfo.jtaDataSource);
        assertEquals(generated.id, unitInfo.nonJtaDataSource);


View Full Code Here

TOP

Related Classes of org.apache.openejb.assembler.classic.ResourceInfo

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.