Changeset 391


Ignore:
Timestamp:
04/26/2010 03:56:21 PM (11 years ago)
Author:
pedro.cuba
Message:

Fixed the problem of the Synchronizer not being added to the simulation. This happened when the Migration was added before the handlers were set.

Location:
libs/cmion/cmionMain/src/cmion/level2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libs/cmion/cmionMain/src/cmion/level2/competencies/Migration.java

    r383 r391  
    188188                 
    189189                // These handlers detect when the MigrationCompetency is added or 
    190                 // removed from the simulation and add/remove Synchronization 
     190                // removed from the simulation and add/remove Synchronizer 
    191191                // element accordingly. 
    192192                this.getEventHandlers().add(new SimulationAddedHandler()); 
    193193                this.getEventHandlers().add(new SimulationRemovedHandler()); 
     194                 
     195                // Check if the Migration was added before the handlers were set 
     196                // and add the Synchronizer if necessary. 
     197                if(getSimulation() != null){ 
     198                        getSimulation().getElements().add(sync); 
     199                } 
    194200                 
    195201                this.getRequestHandlers().add(new MigrationExecuter()); 
  • libs/cmion/cmionMain/src/cmion/level2/migration/Synchronizer.java

    r383 r391  
    120120 
    121121                        } catch (IOException e) { 
    122                                 // TODO Auto-generated catch block 
    123122                                e.printStackTrace(); 
    124123                        } catch (SAXException e) { 
    125                                 // TODO Auto-generated catch block 
    126124                                e.printStackTrace(); 
    127125                        } 
     
    232230                                fullMessage.appendChild(root); 
    233231                                 
    234                                 //TODO Check why the order of next lines matters. In ION it shouldn't matter. 
    235232                                raise(new SynchronizationStart(request.host, request.port, fullMessage)); 
    236233                                schedule(new SendMessage(request.host, request.port)); 
Note: See TracChangeset for help on using the changeset viewer.