use of com.sun.enterprise.deployment.InboundResourceAdapter in project Payara by payara.
the class MessageListenerNode method writeDescriptor.
/**
* write the descriptor class to a DOM tree and return it
*
* @param parent node for the DOM tree
* @param the descriptor to write
* @return the DOM tree top node
*/
public Node writeDescriptor(Node parent, Descriptor descriptor) {
if (!(descriptor instanceof InboundResourceAdapter)) {
throw new IllegalArgumentException(getClass() + " cannot handle descriptors of type " + descriptor.getClass());
}
Iterator msgListeners = ((InboundResourceAdapter) descriptor).getMessageListeners().iterator();
if (!msgListeners.hasNext()) {
throw new RuntimeException("There must be at least one messagelistener for this inbound resource adapter");
}
// message listeners
for (; msgListeners.hasNext(); ) {
MessageListener msgListener = (MessageListener) msgListeners.next();
Node msgListenerNode = appendChild(parent, ConnectorTagNames.MSG_LISTENER);
appendTextChild(msgListenerNode, ConnectorTagNames.MSG_LISTENER_TYPE, msgListener.getMessageListenerType());
// activation spec node
ActivationSpecNode actSpecNode = new ActivationSpecNode();
msgListenerNode = actSpecNode.writeDescriptor(msgListenerNode, msgListener);
}
return parent;
}
Aggregations