Exemple #1
0
 @Override
 public void handleMessage(Message msg) {
   try {
     if (msg instanceof APIMessage) {
       handleApiMessage((APIMessage) msg);
     } else {
       handleLocalMessage(msg);
     }
   } catch (Exception e) {
     bus.logExceptionWithMessageDump(msg, e);
     bus.replyErrorByMessageType(msg, e);
   }
 }
 protected void handleApiMessage(APIMessage msg) {
   try {
     if (msg instanceof APIDeleteBackupStorageMsg) {
       handle((APIDeleteBackupStorageMsg) msg);
     } else if (msg instanceof APIChangeBackupStorageStateMsg) {
       handle((APIChangeBackupStorageStateMsg) msg);
     } else if (msg instanceof APIAttachBackupStorageToZoneMsg) {
       handle((APIAttachBackupStorageToZoneMsg) msg);
     } else if (msg instanceof APIDetachBackupStorageFromZoneMsg) {
       handle((APIDetachBackupStorageFromZoneMsg) msg);
     } else if (msg instanceof APIScanBackupStorageMsg) {
       handle((APIScanBackupStorageMsg) msg);
     } else if (msg instanceof APIUpdateBackupStorageMsg) {
       handle((APIUpdateBackupStorageMsg) msg);
     } else if (msg instanceof APIReconnectBackupStorageMsg) {
       handle((APIReconnectBackupStorageMsg) msg);
     } else {
       bus.dealWithUnknownMessage(msg);
     }
   } catch (Exception e) {
     bus.logExceptionWithMessageDump(msg, e);
     bus.replyErrorByMessageType(msg, e);
   }
 }