コード例 #1
0
 private boolean isSystemEventSupported(final SystemEvent event) {
   final String targetApplicationName = event.getTargetApplicationName();
   final String targetApplicationVersion = event.getTargetApplicationVersion();
   return (targetApplicationName == null || targetApplicationName.equals(applicationName))
       && (targetApplicationVersion == null
           || targetApplicationVersion.equals(applicationVersion));
 }
コード例 #2
0
 @Override
 public void handle(final SystemEvent event) {
   if (isSystemEventSupported(event)) {
     handleSystemEvent(event);
   } else {
     if (logger.isDebugEnabled()) {
       final String applicationNameSignature =
           event.getTargetApplicationName() == null ? "*" : event.getTargetApplicationName();
       final String applicationVersionSignature =
           event.getTargetApplicationVersion() == null ? "*" : event.getTargetApplicationVersion();
       logger.debug(
           "Ignoring message for '"
               + applicationNameSignature
               + "-"
               + applicationVersionSignature
               + "': "
               + event.type());
     }
   }
 }