wm.art.dev.listener:createListenerNode
This service creates a new listener node in the specified package and folder from the specified listener template and connection alias, and initializes the new listener in a disabled state.
You must perform the following steps to populate the input pipeline:
1. Use wm.art.dev.service:fetchListenerTemplateMetadata service to identify the supported listener template properties and configure the listenerSettings input parameter.
![*](chapterTOC_bullet.png)
Listener properties may or may not have default values, depending on the specific adapter's implementation.
![*](chapterTOC_bullet.png)
Depending on the underlying data type of the property, it might not be possible to assign a default value to a property.
![*](chapterTOC_bullet.png)
You may use the default values or override them with values that conform to the underlying data types of the properties.
![*](chapterTOC_bullet.png)
The property values are not automatically set to their default values; you must explicitly set all the required properties.
![*](chapterTOC_bullet.png)
If you omit a property, then no attempt is made to locate and assign default values to the property.
![*](chapterTOC_bullet.png)
Listener properties may be optional or a required property.
![*](chapterTOC_bullet.png)
A required property is identified when the
isRequired metadata attribute is set to
true.
![*](chapterTOC_bullet.png)
The absence of the
isRequired attribute implies that the property is not required.
![*](chapterTOC_bullet.png)
If you fail to set a required property, the
wm.art.dev.listener:createListenerNode service throws an exception.
![*](chapterTOC_bullet.png)
You may have properties that might be required, based on the current value of some other property.
![*](chapterTOC_bullet.png)
The number of properties to be configured is adapter-dependent. At a minimum, set those properties whose
isRequired attribute is set to
true.
2. Activate the listener using the pub.art.listener:enableListener service.
For more information, see the webMethods Integration Server Built-In Services Reference for your release.
The resource domains registered by the listener service template are set in the listener's properties according to the interdependencies between the resource domains. Knowledge of these interdependencies is adapter-specific, and beyond the scope of this service. This service does not interpret resource domains.
Input Parameters
Name | Description |
listenerName | String. Required. Name of the listener in the format: folder:node. |
packageName | String. Required. Package where the listener is installed. |
connectionAlias | String. Required. Name of the connection in the format: folder:node. |
listenerTemplate | String. Required. Fully qualified pathname of the listener template class. |
listenerSettings | IData. Required. Structure for passing the listener's property values. |
| systemName | String. Required. Internal name of the property. ![*](chapterTOC_bullet.png) The following Java data types are supported for connections: char, short, int, long, float, double, boolean, java.lang.String, java.lang.Character, java.lang.Short, java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, java.lang.Boolean. |
| retryLimit | String. Required. Number of times that the system must attempt to start the listener if the initial attempt fails. |
| retryBackoffTimeout | String. Required. Number of seconds the system must wait between each attempt to start the listener. This field is irrelevant if the value of Retry Limit is 0. |
Output Parameters
None.
Example
You must construct listenerSettings to create a listener node. The value of a property's systemName is the internal name of the property. When constructing the input parameter listenerSettings, you must use this internal name as the key for setting a property's value. For example, if a listener template defines a property named portNumber, then its systemName as returned by wm.art.dev.listener:fetchListenerTemplateMetadata service is portNumber. If the caller is a Java application, it might then use this information to set this property's value as follows:
IData pipeline = IDataFactory.create();
IDataCursor pipeCursor = pipeline.getCursor();
.
.
.
IData lstnrSettings = IDataFactory.create();
IDataCursor lstnrCursor = lstnrSettings.getCursor();
lstnrCursor.insertAfter("portNumber", new Integer((int)8888));
.
.
.
pipeCursor.insertAfter("listenerSettings", lstnrSettings);
.
.
.
In this example, the portNumber property takes a java.lang.Integer value.