Пример #1
0
  private void buildInitialEventSelectorRefs() {
    initialEventSelectorMethods = new HashMap<String, Method>();
    Class<?>[] argtypes = new Class[] {InitialEventSelector.class};
    for (MEventEntry eventEntry : getDescriptor().getEventEntries().values()) {
      if (eventEntry.isReceived()
          && eventEntry.isInitialEvent()
          && eventEntry.getInitialEventSelectorMethod() != null
          && !this.initialEventSelectorMethods.containsKey(
              eventEntry.getInitialEventSelectorMethod())) {

        for (Method method : concreteSbbClass.getMethods()) {
          if (method.getName().equals(eventEntry.getInitialEventSelectorMethod())
              && Arrays.equals(method.getParameterTypes(), argtypes)) {
            this.initialEventSelectorMethods.put(
                eventEntry.getInitialEventSelectorMethod(), method);
            break;
          }
        }
      }
    }
  }
Пример #2
0
 private void buildEventHandlerRefs() {
   eventHandlerMethods = new HashMap<EventTypeID, EventHandlerMethod>();
   for (MEventEntry eventEntry : getDescriptor().getEventEntries().values()) {
     if (eventEntry.isReceived()) {
       String eventHandlerMethodName = "on" + eventEntry.getEventName();
       for (Method method : concreteSbbClass.getMethods()) {
         if (method.getName().equals(eventHandlerMethodName)) {
           EventHandlerMethod eventHandlerMethod = new EventHandlerMethod(method);
           if (method.getParameterTypes().length == 3) {
             eventHandlerMethod.setHasEventContextParam(true);
           }
           if (getDescriptor().getSbbActivityContextInterface() != null) {
             eventHandlerMethod.setHasCustomACIParam(true);
           }
           eventHandlerMethods.put(
               eventEntry.getEventReference().getComponentID(), eventHandlerMethod);
           break;
         }
       }
     }
   }
 }