コード例 #1
0
  @Override
  protected void configureMuleContext(MuleContextBuilder builder) {
    super.configureMuleContext(builder);

    // Configure EndpointMessageNotificationListener for notifications test
    ServerNotificationManager notificationManager = new ServerNotificationManager();
    notificationManager.addInterfaceToType(
        EndpointMessageNotificationListener.class, EndpointMessageNotification.class);
    notificationManager.addInterfaceToType(
        SecurityNotificationListener.class, SecurityNotification.class);

    builder.setNotificationManager(notificationManager);
  }
コード例 #2
0
 protected final void registerNotificationType(
     final ServerNotificationManager notificationManager,
     @SuppressWarnings("rawtypes") final Class<? extends ServerNotificationListener> listenerType,
     final Class<? extends ServerNotification> notificationType) {
   @SuppressWarnings("rawtypes")
   final Map<Class<? extends ServerNotificationListener>, Set<Class<? extends ServerNotification>>>
       mapping = notificationManager.getInterfaceToTypes();
   if (!mapping.containsKey(listenerType)) {
     notificationManager.addInterfaceToType(listenerType, notificationType);
   }
 }