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();
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);
}