- nodeListeners.remove(nodeListener);
- }
-
- /**
- * Notifies all listeners that a node was added.
- *
- * @param node
- * The node that was added.
- */
- private void fireNodeAdded(Node node) {
- for (NodeListener nodeListener: nodeListeners) {
- nodeListener.nodeAdded(node);
- }
- }
-
- /**
- * Notifies all listeners that a node was removed.
- *
- * @param node
- * The node that was removed
- */
- private void fireNodeRemoved(Node node) {
- for (NodeListener nodeListener: nodeListeners) {
- nodeListener.nodeRemoved(node);
- }
- }
-
- /**
- * Notifies all listeners that the given node was connected.
- *
- * @param node
- * The node that is now connected
- */
- private void fireNodeConnected(Node node) {
- for (NodeListener nodeListener: nodeListeners) {
- nodeListener.nodeConnected(node);
- }
- }
-
- /**
- * Notifies all listeners that a connection to a node has failed.
- *
- * @param node
- * The node that could not be connected
- * @param cause
- * The cause of the failure
- */
- private void fireNodeConnectionFailed(Node node, Throwable cause) {
- for (NodeListener nodeListener: nodeListeners) {
- nodeListener.nodeConnectionFailed(node, cause);
- }
- }
-
- /**
- * Notifies all listeners that the given node was disconnected.
- *
- * @param node
- * The node that is now disconnected
- * @param throwable
- * The exception that caused the disconnect, or <code>null</code>
- * if there was no exception
- */
- private void fireNodeDisconnected(Node node, Throwable throwable) {
- for (NodeListener nodeListener: nodeListeners) {
- nodeListener.nodeDisconnected(node, throwable);
- }