if (inboundResourceAdapter == null) {
inboundResourceAdapter = new InboundResourceadapter();
connector.getResourceAdapter().setInboundResourceAdapter(inboundResourceAdapter);
}
MessageAdapter messageAdapter = inboundResourceAdapter.getMessageAdapter();
if (messageAdapter == null) {
messageAdapter = new MessageAdapter();
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);