public NotificationEnvelopeClass(final NotificationEnvelope e, final MethodHandler mt) {
   if (!e.value().equals("")) {
     this.key = e.value();
   } else if (mt.getGenericClassOfFirstArgument() != null) {
     this.key = mt.getGenericClassOfFirstArgument().getName();
   } else {
     this.key = null;
     LogService.writeWarning(mt, "Could not get notification envelope!");
   }
 }
 /* (non-Javadoc)
  * @see dima.introspectionBasedAgent.shells.IntrospedMethodsTrunk#init()
  */
 @Override
 public void load(final ActiveComponentInterface a) {
   for (final MethodHandler mt : this.getRelevantMethods(a)) {
     if (!this.checkMethodValidity(mt)) {
       LogService.writeException(a, "cannot add " + mt + " method not valid ");
     } else {
       this.addMethod(mt);
     }
   }
 }
 private boolean checkTransientMethodValidity(final MethodHandler mt) {
   if (mt.isAnnotationPresent(Transient.class)) {
     if (!(mt.getReturnType().equals(boolean.class) || mt.getReturnType().equals(Boolean.class))) {
       LogService.writeException(
           mt.getMyComponent(), "method " + mt + " must return a boolean value");
       return false;
     } else {
       return true;
     }
   } else {
     return true;
   }
 }
 private boolean checkStepMethodValidity(final MethodHandler mt) {
   if (mt.isAnnotationPresent(ProactivityInitialisation.class)
       || mt.isAnnotationPresent(PreStepComposant.class)
       || mt.isAnnotationPresent(StepComposant.class)
       || mt.isAnnotationPresent(PostStepComposant.class)
       || mt.isAnnotationPresent(ProactivityFinalisation.class)) {
     if (mt.getParameterTypes().length > 0) {
       LogService.writeException(
           mt.getMyComponent(), "StepComposant method " + mt + " can not take any argument!");
       return false;
     } else {
       return true;
     }
   } else {
     return true;
   }
 }
Beispiel #5
0
 @Override
 public void proactivityTerminate() {
   LogService.write(this.getId(), "La factoriel de " + this.n + " vaut " + this.liste.pop());
   this.desactivateWithFipa();
   //		System.exit(1);
 }