}
public void startService() {
if (configuration != null) {
try {
FilterFactory ff = new FilterFactory();
// Creo todos los filtros
IFilter filter = null;
IFilter prevFilter = null;
Node node = null;
Element element = null;
String[] names = this.getServiceName().getCanonicalName().split("=");
channelName = names[names.length-1];
if (channelName == null) {
logger.error("| Nos se pudo obtener el nombre del canal!!!! "+names+"|");
return;
}
if (jndi == null || jndi.trim().equals(""))
jndi = "localhost:1099";
logger.info(channelName+"| Iniciando connection...|");
logger.info(channelName+"| Servicio jndi: "+jndi+"|");
AttributeChangeNotificationFilter nf = new AttributeChangeNotificationFilter();
nf.enableAttribute("ChannelState");
incomingTopic = configuration.getAttribute("incomingTopic");
outgoingTopic = configuration.getAttribute("outgoingTopic");
idxLink = 0;
NodeList nodes = configuration.getChildNodes();
for (int i = 0; i < nodes.getLength(); i++) {
node = nodes.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
element = (Element) node;
filter = ff.createFilter(channelName, jndi, timeout, flushTime, incomingTopic, outgoingTopic, element);
if (filter == null)
return;
this.addNotificationListener((NotificationListener) filter, nf, this);
if (prevFilter != null)
prevFilter.setFilterTM(filter);