示例#1
0
 /** Custom initialization method, called by the enclosing actor, during its initialization. */
 public synchronized void initialize() {
   operationalSourcePorts = new HashSet<IOPort>();
   operationalSourcePorts.addAll(this.sourcePortList());
   if (isInput() && getContainer() instanceof MessageBuffer) {
     MessageBuffer _msgBfr = (MessageBuffer) getContainer();
     if (_msgBfr.acceptInputPort(this)) {
       Receiver[][] receivers = getReceivers();
       for (int i = 0; i < receivers.length; i++) {
         Receiver[] receivers2 = receivers[i];
         for (int j = 0; j < receivers2.length; j++) {
           Receiver receiver = receivers2[j];
           if (receiver instanceof MessageProvider) {
             ((MessageProvider) receiver).setMessageBuffer(_msgBfr);
           }
         }
       }
     } else {
       setMessageBuffer(null);
     }
   }
   //     first need to find a way to register the port statistics
   //     as children of the actor statistics
   statistics.reset();
   StatisticsServiceFactory.getService().registerStatistics(statistics);
 }