private void setListener() {
		
		// which is a service
		XMLElement service = null;
		if (source.getAddress().startsWith("/jbossesb/services")) {
			service = source;
		} else {
			service = target;
		}
		
		// TODO choose right listener (based on provider's type)
		StringBuilder listener = new StringBuilder();
		Dialog dialog = new ListenersDialog(new Shell(), listener);
		if (dialog.open() != Window.OK) {
			return;
		}

		// check if exists listeners section
		boolean listenersExists = false;
		for (XMLElement child : service.getChildren()) {
			if (child.getAddress().equals("/jbossesb/services/service/listeners")) {
				listenersExists = true;
			}
		}
		
		// create listeners section (if doesn't exists)
		if (!listenersExists) {
			XMLElement xmlListeners = new XMLElement();
			xmlListeners.setAddress("/jbossesb/services/service/listeners");
			xmlListeners.setName("Listeners");
			service.addChildElement(xmlListeners);
		}
		
		// create listener in service
		String address = "/jbossesb/services/service/listeners/" + listener;
		PropertiesManipulator prop = new PropertiesManipulator(address);
		XMLElement xmlListener = new XMLElement();
		xmlListener.setAddress("/jbossesb/services/service/listeners/" + listener);
		xmlListener.setName(prop.getSomeElementValue(address, ElementValues.NAME));
		xmlListener.setHint(prop.getSomeElementValue(address, ElementValues.HINT));
		dialog = new EditDialog(new Shell(), xmlListener);
		if (dialog.open() != Window.OK) {
			undo();
			return;
		}
		
		// set busid
		XMLAttribute busid = xmlListener.getAttribute("busidref");
		if (busid == null) {
			String name = prop.getSomeAttributeValue(address + "\busidref", AttributeValues.NAME);
			String type = prop.getSomeAttributeValue(address + "\busidref", AttributeValues.TYPE);
			String hint = prop.getSomeAttributeValue(address + "\busidref", AttributeValues.HINT);
			busid = new XMLAttribute(type, false, null, bus.toString(), name, hint, "busidref");
			xmlListener.addAttribute(busid);
		} else {
			busid.setValue(bus.toString());
		}
		
		
		// add to the model
		for (XMLElement child : service.getChildren()) {
			if (child.getAddress().equals("/jbossesb/services/service/listeners")) {
				child.addChildElement(xmlListener);
				service.refresh();
				break;
			}
		}
	}