Adds a <CODE>RtfDestinationListener</CODE> to the appropriate <CODE>RtfDestination</CODE>.

@param destination the destination string for the listener
@param listener
the new RtfDestinationListener.
433906
public static boolean addListener(String destination, RtfDestinationListener listener) {
		RtfDestination dest = getDestination(destination);
		if(dest != null) {
			return dest.addListener(listener);
		}
		return false;
	}
96462
public void addListener(ISUPListener listener) {
        if (listener == null) {
            throw new NullPointerException("Listener must not be null!");
        }
        if (this.listeners.contains(listener)) {
            throw new IllegalArgumentException("Listener already present: " + listener + " !");
        } else {
            this.listeners.add(listener);
        }

    }
443739
public void setDestinationPathInRfs(String destinationPathInRfs) {

        String destination;
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(destinationPathInRfs)) {
            destination = null;
        } else {
            destination = destinationPathInRfs.trim();
        }
        if (destination != null) {
            File destinationFolder = new File(destination);
            if (!destinationFolder.exists() || !destinationFolder.isDirectory()) {
                // destination folder does not exist
                throw new CmsIllegalArgumentException(
                    Messages.get().container(Messages.ERR_RFS_DESTINATION_NOT_THERE_1, destination));
            }
            if (!destinationFolder.canWrite()) {
                // destination folder can't be written to
                throw new CmsIllegalArgumentException(
                    Messages.get().container(Messages.ERR_RFS_DESTINATION_NO_WRITE_1, destination));
            }
            destination = destinationFolder.getAbsolutePath();
            if (destination.endsWith(File.separator)) {
                // ensure that the destination folder DOES NOT end with a file separator
                destination = destination.substring(0, destination.length() - 1);
            }
        }
        m_destinationPathInRfs = destination;
    }
318264
public void addListener(AgentRosterListener listener) {
        synchronized (listeners) {
            if (!listeners.contains(listener)) {
                listeners.add(listener);

                // Fire events for the existing entries and presences in the roster
                for (EntityBareJid jid : getAgents()) {
                    // Check again in case the agent is no longer in the roster (highly unlikely
                    // but possible)
                    if (entries.contains(jid)) {
                        // Fire the agent added event
                        listener.agentAdded(jid);
                        Jid j;
                        try {
                            j = JidCreate.from(jid);
                        }
                        catch (XmppStringprepException e) {
                            throw new IllegalStateException(e);
                        }
                        Map<Resourcepart, Presence> userPresences = presenceMap.get(j);
                        if (userPresences != null) {
                            Iterator<Presence> presences = userPresences.values().iterator();
                            while (presences.hasNext()) {
                                // Fire the presence changed event
                                listener.presenceChanged(presences.next());
                            }
                        }
                    }
                }
            }
        }
    }
525885
public void addListener(WindowListener<K,R,P> listener) {
        this.listeners.addIfAbsent(new UnwrappedWeakReference<WindowListener<K,R,P>>(listener));
    }
754092
public static void deregisterMessagingEngineListener(
            final SibRaMessagingEngineListener listener, final String busName) {

        final String methodName = "deregisterMessagingEngineListener";
        if (TRACE.isEntryEnabled()) {
            SibTr.entry(TRACE, methodName, new Object[] { listener, busName });
        }

        synchronized (MESSAGING_ENGINE_LISTENERS) {

            final Set listeners = (Set) MESSAGING_ENGINE_LISTENERS.get(busName);
            if (listeners != null) {
                listeners.remove(listener);
                if (listeners.isEmpty()) {
                    MESSAGING_ENGINE_LISTENERS.remove(busName);
                }
            }

        }

        if (TRACE.isEntryEnabled()) {
            SibTr.exit(TRACE, methodName);
        }

    }
127077
public void addListener(ForwardingClientListener listener) {
		if (listener != null) {
			clientlisteners.addElement(listener);

			SocketListener s;
			Enumeration<SocketListener> en = socketlisteners.elements();
			while (en.hasMoreElements()) {
				s = (SocketListener) en.nextElement();
				if (s.isListening()) {
					listener.forwardingStarted(
							ForwardingClientListener.LOCAL_FORWARDING,
							generateKey(s.addressToBind, s.portToBind),
							s.hostToConnect, s.portToConnect);

				}
			}
			if (Log.isDebugEnabled()) {
				Log.debug(this, "enumerated socketlisteners");
			}

			Enumeration<String> en2 = incomingtunnels.keys();
			String key;
			String destination;
			String hostToConnect;
			int portToConnect;
			while (en2.hasMoreElements()) {
				key = en2.nextElement();
				if (key.equals(X11_KEY)
						|| ssh.getContext().getX11Display() != null
						&& ssh.getContext().getX11Display().equals(key))
					continue;
				destination = (String) remoteforwardings.get(key);
				hostToConnect = destination.substring(0,
						destination.indexOf(':'));
				portToConnect = Integer.parseInt(destination
						.substring(destination.indexOf(':') + 1));

				listener.forwardingStarted(
						ForwardingClientListener.REMOTE_FORWARDING, key,
						hostToConnect, portToConnect);

			}
			if (Log.isDebugEnabled()) {
				Log.debug(this, "enumerated incomingtunnels");
			}

			String display = ssh.getContext().getX11Display();

			if (Log.isDebugEnabled()) {
				Log.debug(this, "display is " + display);
			}

			if (display != null && isXForwarding) {
				String hostname = "localhost";
				int screen;
				int idx = display.indexOf(':');
				if (idx != -1) {
					hostname = display.substring(0, idx);
					screen = Integer.parseInt(display.substring(idx + 1));
				} else {
					screen = Integer.parseInt(display);
				}

				listener.forwardingStarted(
						ForwardingClientListener.X11_FORWARDING, X11_KEY,
						hostname, screen);
			}
		}
	}
1236582
public void addListener(ChangeListener listener) {
        synchronized (hsChangeListeners) {
            hsChangeListeners.add(listener);
            changeListenerCount = hsChangeListeners.size();
            bUpdateChangeListener = true;
        }
    }
1050648
public AsyncMessage createMessageForDestination(String destination) {
        AsyncMessage message = this.defaultMessageCreator.createMessage();
        message.setDestination(destination);
        return message;
    }
1347885
private void callDestinationListener(String destinationName) throws SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "callDestinationListener", new Object[] { destinationName });

        DestinationListenerDataObject listenerDataObject = null;
        DestinationListener destinationListener = null;
        DestinationAvailability listenersDestinationAvailability = null;
        SICoreConnection listenersConnection = null;
        DestinationNamePattern destinationNamePattern = null;

        BaseDestinationHandler destinationHandler = null;

        try
        {
            destinationHandler = (BaseDestinationHandler) getDestination(destinationName, false);
        } catch (SIMPDestinationCorruptException e)
        {
            FFDCFilter.processException(
                                        e,
                                        "com.ibm.ws.sib.processor.impl.DestinationManager.callDestinationListener",
                                        "1:7589:1.508.1.7",
                                        this);

            SibTr.exception(tc, e);

            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(tc, "callDestinationListener", "Destination corrupt");

            // Finding that a restored destination has been marked as corrupt is no
            // reason to cause the transaction to fail.  Andrew Whitfield says that
            // a destination listener will not want to know about corrupt destinations
            // so we end up just returning.
            return;
        } catch (SIException e)
        {
            FFDCFilter.processException(
                                        e,
                                        "com.ibm.ws.sib.processor.impl.DestinationManager.callDestinationListener",
                                        "1:7608:1.508.1.7",
                                        this);

            SibTr.exception(tc, e);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(tc, "callDestinationListener", "SIResourceException");
            throw new SIResourceException(e);
        }

        if (!(destinationHandler.definition.getDestinationType() == DestinationType.TOPICSPACE))
        {

            for (int i = 0; i < destinationListeners.size(); i++)
            {
                listenerDataObject = destinationListeners.get(i);
                destinationListener = listenerDataObject.getDestinationLister();
                listenersDestinationAvailability = listenerDataObject.getDestinationAvailability();
                listenersConnection = listenerDataObject.getConnection();
                destinationNamePattern = listenerDataObject.getDestinationNamePattern();

                SIDestinationAddress destinationAddress = null;

                if (isAvailable(destinationHandler, listenersDestinationAvailability)
                    && (!(destinationHandler.isSystem()))
                    && listenerDataObject.getDestinationType() == destinationHandler.definition.getDestinationType())
                {
                    // Check whether a destination name pattern was specified
                    if (destinationNamePattern == null || destinationNamePattern.match(destinationName))
                    {
                        // No pattern or the pattern matches the name.
                        destinationAddress =
                                        (
                                        (SIDestinationAddressFactory) MessageProcessor.getSingletonInstance(
                                                        SIMPConstants.SI_DESTINATION_ADDRESS_FACTORY)).createSIDestinationAddress(
                                                                                                                                  destinationHandler.getName(),
                                                                                                                                  true);
                        // call the listener
                        destinationListener.destinationAvailable(
                                                                 listenersConnection,
                                                                 destinationAddress,
                                                                 listenersDestinationAvailability);
                    }
                }
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "callDestinationListener");
    }
1281199
public void addPostSelectionChangedListener(
			ISelectionChangedListener listener)
	{
		if (fOutlineViewer != null)
		{
			fOutlineViewer.addPostSelectionChangedListener(listener);
		} else
		{
			fPostSelectionChangedListeners.add(listener);
		}
	}
187964
@Override
    public void registerInjectionTargetListener(WebSphereInjectionTargetListener<?> listener) {
        Object instance = listener.getObject();
        injectionTargetListeners.put(instance, listener);
    }
1039194
@Override
    public void notifyReceiveAllowedRCD(DestinationHandler destinationHandler)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "notifyReceiveAllowedRCD", new Object[] { destinationHandler });

        _targetDestinationHandler.notifyReceiveAllowedRCD(destinationHandler);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "notifyReceiveAllowedRCD");
    }
38748
public void setDestinationName(final String destinationName) {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
            SibTr.debug(this, TRACE, "DestinationName", destinationName);
        }
        _destinationName = destinationName;

    }
1191737
public void addListener(final PathAlterationListener listener) {
    if (listener != null) {
      this.listeners.put(listener, new ExceptionCatchingPathAlterationListenerDecorator(listener));
    }
  }
1257881
public void createDestination(Destination dest, Reliability defaultReliability) 
    throws JMSException
  {

    try
    {
    
      if (tcInt.isEntryEnabled())
        SibTr.entry(tcInt, "createDestination(Destination)");    
         
      com.ibm.wsspi.sib.core.DestinationType destType = null;
      String name = null;
  
      try
      {
  
        // Work out which type of Destination we want to create.
        if (dest instanceof JmsQueue)
        {
          destType = com.ibm.wsspi.sib.core.DestinationType.QUEUE;
          name = ((JmsQueue) dest).getQueueName();
  
        } else if (dest instanceof JmsTopic)
        {
          destType = com.ibm.wsspi.sib.core.DestinationType.TOPICSPACE;
          name = ((JmsTopic) dest).getTopicSpace();
        } else
        {
          destType = null;
          name = null;
        }
        
        if (tcInt.isDebugEnabled())
        {
          SibTr.debug(tcInt, "    name: "+name);
          SibTr.debug(tcInt, "destType: "+destType);
        }
          
  
        if (destType != null)
        {
          // Defer to the other method.
          createDestination(name, destType, defaultReliability);
        } else
        {
          throw new JMSException("Could not create Destination - destType was null");
        }
  
      } catch (JMSException e)
      {
        // No FFDC code needed
        if (tcInt.isDebugEnabled())
          SibTr.debug(tcInt, "JMSException during createDestination", e);
          
        throw e;
  
      } catch (Exception f)
      {
        // No FFDC code needed
        if (tcInt.isDebugEnabled())
          SibTr.debug(tcInt, "Exception during createDestionation", f);
          
        JMSException jmse = new JMSException("Exception from createDestination");
        jmse.setLinkedException(f);
        jmse.initCause(f);
        throw jmse;
  
      } //try

    } finally
    {    
      if (tcInt.isEntryEnabled())
         SibTr.exit(tcInt, "createDestination(Destination)");
    }//

  }
375905
public void addListener(ComObjectListener listener) {
        if(listener==null)
            throw new IllegalArgumentException("listener is null");
        if(listeners.contains(listener))
            throw new IllegalArgumentException("can't register the same listener twice");
        listeners.add(listener);
    }