algoDiffusion
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
package impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import interfaces.AlgoDiffusion;
|
||||
import interfaces.Capteur;
|
||||
import interfaces.ObserverDeCapteurAsync;
|
||||
|
||||
public class DiffusionAtomique implements AlgoDiffusion {
|
||||
|
||||
public CapteurImpl capteur;
|
||||
|
||||
@Override
|
||||
public void configure() {
|
||||
// TODO Auto-generated method stub
|
||||
@@ -12,7 +19,10 @@ public class DiffusionAtomique implements AlgoDiffusion {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'execture'");
|
||||
capteur.lock(); //TODO unlock
|
||||
List<ObserverDeCapteurAsync> canaux = capteur.observers;
|
||||
for (ObserverDeCapteurAsync canal : canaux) {
|
||||
canal.update(this.capteur);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user