Examples of ResourceAdapter


Examples of org.apache.geronimo.management.geronimo.ResourceAdapter

        outer:
        for (int i = 0; i < modules.length; i++) {
            ResourceAdapterModule module = modules[i];
            ResourceAdapter[] adapters = module.getResourceAdapterInstances();
            for (int j = 0; j < adapters.length; j++) {
                ResourceAdapter adapter = adapters[j];
                JCAResource[] resources = adapter.getJCAResourceImplementations();
                for (int k = 0; k < resources.length; k++) {
                    JCAResource resource = resources[k];
                    JCAManagedConnectionFactory[] outboundFactories = resource.getOutboundFactories(connectionFactoryInterfaces);
                    if (outboundFactories.length > 0) {
                        list.add(module);
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.ResourceAdapter

        outer:
        for (int i = 0; i < modules.length; i++) {
            ResourceAdapterModule module = modules[i];
            ResourceAdapter[] adapters = module.getResourceAdapterInstances();
            for (int j = 0; j < adapters.length; j++) {
                ResourceAdapter adapter = adapters[j];
                JCAResource[] resources = adapter.getJCAResourceImplementations();
                for (int k = 0; k < resources.length; k++) {
                    JCAResource resource = resources[k];
                    JCAAdminObject[] adminObjects = resource.getAdminObjectInstances(adminObjectInterfaces);
                    if (adminObjects.length > 0) {
                        list.add(module);
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.ResourceAdapter

    public JCAManagedConnectionFactory[] getOutboundFactories(ResourceAdapterModule module, String[] connectionFactoryInterfaces) {
        List list = new ArrayList();

        ResourceAdapter[] resourceAdapters = module.getResourceAdapterInstances();
        for (int i = 0; i < resourceAdapters.length; i++) {
            ResourceAdapter resourceAdapter = resourceAdapters[i];
            JCAResource[] jcaResources = resourceAdapter.getJCAResourceImplementations();
            for (int j = 0; j < jcaResources.length; j++) {
                JCAResource jcaResource = jcaResources[j];
                JCAManagedConnectionFactory[] outboundFactories = jcaResource.getOutboundFactories(connectionFactoryInterfaces);
                list.addAll(Arrays.asList(outboundFactories));
            }
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.ResourceAdapter

    public JCAAdminObject[] getAdminObjects(ResourceAdapterModule module, String[] adminObjectInterfaces) {
        List list = new ArrayList();
        ResourceAdapter[] resourceAdapters = module.getResourceAdapterInstances();
        for (int i = 0; i < resourceAdapters.length; i++) {
            ResourceAdapter resourceAdapter = resourceAdapters[i];
            JCAResource[] jcaResources = resourceAdapter.getJCAResourceImplementations();
            for (int j = 0; j < jcaResources.length; j++) {
                JCAResource jcaResource = jcaResources[j];
                JCAAdminObject[] adminObjects  = jcaResource.getAdminObjectInstances(adminObjectInterfaces);
                list.addAll(Arrays.asList(adminObjects));
            }
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.ResourceAdapter

        ResourceAdapterModule[] modules = server.getResourceAdapterModules();
        for (int i = 0; i < modules.length; i++) {
            ResourceAdapterModule module = modules[i];
            ResourceAdapter[] adapters = module.getResourceAdapterInstances();
            for (int j = 0; j < adapters.length; j++) {
                ResourceAdapter adapter = adapters[j];
                JCAResource[] resources = adapter.getJCAResourceImplementations();
                list.addAll(Arrays.asList(resources));
            }

        }
        return (JCAResource[]) list.toArray(new JCAResource[list.size()]);
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.ResourceAdapter

        ResourceAdapterModule[] modules = application.getRAModules();
        for (int i = 0; i < modules.length; i++) {
            ResourceAdapterModule module = modules[i];
            ResourceAdapter[] adapters = module.getResourceAdapterInstances();
            for (int j = 0; j < adapters.length; j++) {
                ResourceAdapter adapter = adapters[j];
                JCAResource[] resources = adapter.getJCAResourceImplementations();
                list.addAll(Arrays.asList(resources));
            }

        }
        return (JCAResource[]) list.toArray(new JCAResource[list.size()]);
View Full Code Here

Examples of org.apache.openejb.jee.ResourceAdapter


        AppModule app = new AppModule(this.getClass().getClassLoader(), "testapp");

        Connector connector = new Connector("email-ra");
        ResourceAdapter adapter = connector.setResourceAdapter(new ResourceAdapter(EmailResourceAdapter.class));
        InboundResource inbound = adapter.setInboundResourceAdapter(new InboundResource());
        MessageAdapter messageAdapter = inbound.setMessageAdapter(new MessageAdapter());
        MessageListener listener = messageAdapter.addMessageListener(new MessageListener(EmailConsumer.class, EmailAccountInfo.class));
        listener.getActivationSpec().addRequiredConfigProperty("address");
        app.getResourceModules().add(new ConnectorModule(connector));
View Full Code Here

Examples of org.apache.openejb.jee.ResourceAdapter

                } catch (IOException e) {
                    throw new IllegalArgumentException("Invalid application lib path " + file.getAbsolutePath());
                }
            }

            ResourceAdapter resourceAdapter = connector.getResourceAdapter();
            if (resourceAdapter.getResourceAdapterClass() != null) {
                String id = getId(connectorModule);
                String className = resourceAdapter.getResourceAdapterClass();

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

                ServiceUtils.registerServiceProvider(appId, provider);

                Resource resource = new Resource(id, className, appId + "#" + id);

                for (ConfigProperty property : resourceAdapter.getConfigProperty()) {
                    String name = property.getConfigPropertyName();
                    String value = property.getConfigPropertyValue();
                    if (value != null) {
                        resource.getProperties().setProperty(name, value);
                    }
                }
                connectorInfo.resourceAdapter = configFactory.configureService(resource, ResourceInfo.class);
            }

            OutboundResourceAdapter outbound = resourceAdapter.getOutboundResourceAdapter();
            if (outbound != null) {
                String transactionSupport = "none";
                switch (outbound.getTransactionSupport()) {
                    case LOCAL_TRANSACTION:
                        transactionSupport = "local";
                        break;
                    case NO_TRANSACTION:
                        transactionSupport = "none";
                        break;
                    case XA_TRANSACTION:
                        transactionSupport = "xa";
                        break;
                }
                for (ConnectionDefinition connection : outbound.getConnectionDefinition()) {

                    String id = getId(connection, outbound, connectorModule);
                    String className = connection.getManagedConnectionFactoryClass();
                    String type = connection.getConnectionFactoryInterface();

                    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 : connection.getConfigProperty()) {
                        String name = property.getConfigPropertyName();
                        String value = property.getConfigPropertyValue();
                        if (value != null) {
                            properties.setProperty(name, value);
                        }
                    }
                    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();
View Full Code Here

Examples of org.apache.openejb.jee.ResourceAdapter

            }
          }

          if (connectorClass != null) {
          if (connector.getResourceAdapter() == null) {
            connector.setResourceAdapter(new ResourceAdapter());
          }

          if (connector.getResourceAdapter().getResourceAdapterClass() == null || connector.getResourceAdapter().getResourceAdapterClass().length() == 0) {
            connector.getResourceAdapter().setResourceAdapterClass(connectorClass.getName());
          }
View Full Code Here

Examples of org.apache.openejb.jee.ResourceAdapter

                } catch (IOException e) {
                    throw new IllegalArgumentException("Invalid application lib path " + file.getAbsolutePath());
                }
            }

            ResourceAdapter resourceAdapter = connector.getResourceAdapter();
            if (resourceAdapter.getResourceAdapterClass() != null) {
                String id = getId(connectorModule);
                String className = resourceAdapter.getResourceAdapterClass();

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

                ServiceUtils.registerServiceProvider(appId, provider);

                Resource resource = new Resource(id, className, appId + "#" + id);

                for (ConfigProperty property : resourceAdapter.getConfigProperty()) {
                    String name = property.getConfigPropertyName();
                    String value = property.getConfigPropertyValue();
                    if (value != null) {
                        resource.getProperties().setProperty(name, value);
                    }
                }
                connectorInfo.resourceAdapter = configFactory.configureService(resource, ResourceInfo.class);
            }

            OutboundResourceAdapter outbound = resourceAdapter.getOutboundResourceAdapter();
            if (outbound != null) {
                String transactionSupport = "none";
                switch (outbound.getTransactionSupport()) {
                    case LOCAL_TRANSACTION:
                        transactionSupport = "local";
                        break;
                    case NO_TRANSACTION:
                        transactionSupport = "none";
                        break;
                    case XA_TRANSACTION:
                        transactionSupport = "xa";
                        break;
                }
                for (ConnectionDefinition connection : outbound.getConnectionDefinition()) {

                    String id = getId(connection, outbound, connectorModule);
                    String className = connection.getManagedConnectionFactoryClass();
                    String type = connection.getConnectionFactoryInterface();

                    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 : connection.getConfigProperty()) {
                        String name = property.getConfigPropertyName();
                        String value = property.getConfigPropertyValue();
                        if (value != null) {
                            properties.setProperty(name, value);
                        }
                    }
                    properties.setProperty("TransactionSupport", transactionSupport);
                    if (connectorInfo.resourceAdapter != null) {
                      properties.setProperty("ResourceAdapter", connectorInfo.resourceAdapter.id);
                    }

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

            InboundResourceadapter 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();
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.