Examples of ResourceInfo


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

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

        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

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

        }

        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

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

    }

    public void testQueue() throws Exception {
        ConfigurationFactory factory = new ConfigurationFactory();

        ResourceInfo resourceInfo = factory.configureService(new Resource("myQueue", "Queue"), ResourceInfo.class);

        assertNotNull(resourceInfo);
        assertEquals("myQueue", resourceInfo.id);
        assertNotNull(resourceInfo.constructorArgs);
        assertNotNull(resourceInfo.properties);
View Full Code Here

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

                        }
                    }
                    properties.setProperty("TransactionSupport", transactionSupport);
                    properties.setProperty("ResourceAdapter", connectorInfo.resourceAdapter.id);

                    ResourceInfo resourceInfo = configFactory.configureService(resource, ResourceInfo.class);
                    connectorInfo.outbound.add(resourceInfo);
                }
            }

            InboundResource inbound = resourceAdapter.getInboundResourceAdapter();
            if (inbound != null) {
                for (MessageListener messageListener : inbound.getMessageAdapter().getMessageListener()) {
                    String id = getId(messageListener, inbound, connectorModule);

                    Container container = new Container(id, "MESSAGE", null);

                    Properties properties = container.getProperties();
                    properties.setProperty("ResourceAdapter", connectorInfo.resourceAdapter.id);
                    properties.setProperty("MessageListenerInterface", messageListener.getMessageListenerType());
                    properties.setProperty("ActivationSpecClass", messageListener.getActivationSpec().getActivationSpecClass());

                    MdbContainerInfo mdbContainerInfo = configFactory.configureService(container, MdbContainerInfo.class);
                    connectorInfo.inbound.add(mdbContainerInfo);
                }
            }

            for (AdminObject adminObject : resourceAdapter.getAdminObject()) {

                String id = getId(adminObject, resourceAdapter, connectorModule);
                String className = adminObject.getAdminObjectClass();
                String type = adminObject.getAdminObjectInterface();

                ServiceProvider provider = new ServiceProvider(className, id, "Resource");
                provider.getTypes().add(type);

                ServiceUtils.registerServiceProvider(appId, provider);

                Resource resource = new Resource(id, type, appId + "#" + id);
                Properties properties = resource.getProperties();
                for (ConfigProperty property : adminObject.getConfigProperty()) {
                    String name = property.getConfigPropertyName();
                    String value = property.getConfigPropertyValue();
                    if (value != null) {
                        properties.setProperty(name, value);
                    }
                }
                ResourceInfo resourceInfo = configFactory.configureService(resource, ResourceInfo.class);
                connectorInfo.adminObject.add(resourceInfo);
            }

            appInfo.connectors.add(connectorInfo);
        }
View Full Code Here

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

     *
     * @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

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

     *
     * @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

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

     *
     * @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

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

     *
     * @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

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

     *
     * @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
TOP
Copyright © 2018 www.massapi.com. 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.