Exemple #1
0
  public synchronized boolean registerMessageListener(
      String destinationName, MessageListener messageListener) {

    Destination destination = _destinations.get(destinationName);

    if (destination == null) {
      throw new IllegalStateException("Destination " + destinationName + " is not configured");
    }

    boolean registered = destination.register(messageListener);

    if (registered) {
      fireMessageListenerRegisteredEvent(destination, messageListener);
    }

    return registered;
  }