inboundResourceAdapter.setMessageAdapter(messageAdapter);
}
classes = finder.findAnnotatedClasses(Activation.class);
for (Class<?> cls : classes) {
MessageListener messageListener = null;
Activation activationAnnotation = cls.getAnnotation(Activation.class);
List<MessageListener> messageListeners = messageAdapter.getMessageListener();
for (MessageListener ml : messageListeners) {
if (cls.getName().equals(ml.getActivationSpec().getActivationSpecClass())) {
messageListener = ml;
break;
}
}
if (messageListener == null) {
Class<?>[] listeners = activationAnnotation.messageListeners();
for (Class<?> listener : listeners) {
messageAdapter.addMessageListener(new MessageListener(listener.getName(), cls.getName()));
}
}
}
classes = finder.findAnnotatedClasses(AdministeredObject.class);
List<AdminObject> adminObjects = connector.getResourceAdapter().getAdminObject();
for (Class<?> cls : classes) {
AdministeredObject administeredObjectAnnotation = cls.getAnnotation(AdministeredObject.class);
Class[] adminObjectInterfaces = administeredObjectAnnotation.adminObjectInterfaces();
AdminObject adminObject = null;
for (AdminObject admObj : adminObjects) {
if (admObj.getAdminObjectClass().equals(cls.getName())) {
adminObject = admObj;
}
}
if (adminObject == null) {
for (Class iface : adminObjectInterfaces) {
AdminObject newAdminObject = new AdminObject();
newAdminObject.setAdminObjectClass(cls.getName());
newAdminObject.setAdminObjectInterface(iface.getName());
adminObjects.add(newAdminObject);
}
}
}
// need to make a list of classes to process for config properties
// resource adapter
String raCls = connector.getResourceAdapter().getResourceAdapterClass();
process(connectorModule.getClassLoader(), raCls, connector.getResourceAdapter());
// managedconnectionfactory
if (connector.getResourceAdapter() != null && connector.getResourceAdapter().getOutboundResourceAdapter() != null) {
List<org.apache.openejb.jee.ConnectionDefinition> connectionDefinitions = connector.getResourceAdapter().getOutboundResourceAdapter().getConnectionDefinition();
for (org.apache.openejb.jee.ConnectionDefinition connectionDefinition : connectionDefinitions) {
process(connectorModule.getClassLoader(), connectionDefinition.getManagedConnectionFactoryClass(), connectionDefinition);
}
}
// administeredobject
if (connector.getResourceAdapter() != null) {
List<AdminObject> raAdminObjects = connector.getResourceAdapter().getAdminObject();
for (AdminObject raAdminObject : raAdminObjects) {
process(connectorModule.getClassLoader(), raAdminObject.getAdminObjectClass(), raAdminObject);
}
}
// activationspec
if (connector.getResourceAdapter() != null && connector.getResourceAdapter().getInboundResourceAdapter() != null && connector.getResourceAdapter().getInboundResourceAdapter().getMessageAdapter() != null) {
List<MessageListener> messageListeners = connector.getResourceAdapter().getInboundResourceAdapter().getMessageAdapter().getMessageListener();
for (MessageListener messageListener : messageListeners) {
ActivationSpec activationSpec = messageListener.getActivationSpec();
process(connectorModule.getClassLoader(), activationSpec.getActivationSpecClass(), activationSpec);
}
}
return connectorModule;