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