1 23 24 package org.objectweb.fractal.gui.model; 25 26 import java.util.ArrayList ; 27 import java.util.List ; 28 29 33 34 public class BasicServerInterface extends BasicInterface 35 implements ServerInterface 36 { 37 38 42 43 private List bindings; 44 45 50 51 BasicServerInterface (final BasicComponent owner) { 52 super(owner); 53 complementaryItf = new BasicClientInterface(this); 54 bindings = new ArrayList (); 55 } 56 57 62 63 BasicServerInterface (final ClientInterface externalItf) { 64 super(externalItf); 65 bindings = new ArrayList (); 66 } 67 68 73 74 BasicServerInterface (final ServerInterface rootCollectionItf, final String suffix) { 75 super(rootCollectionItf, 0); 76 if (suffix != null) { 77 this.name = suffix; 78 } 79 complementaryItf = new BasicClientInterface(this); 80 bindings = new ArrayList (); 81 ((BasicInterface)rootCollectionItf).addSlaveCollectionInterface(this); 82 } 83 84 public List getBindings () { 85 return bindings; 86 } 87 88 94 95 void addBinding (final Binding binding) { 96 for (int i = 0; i < bindings.size(); ++i) { 97 Binding b = (Binding)bindings.get(i); 98 if (b.getClientInterface() == binding.getClientInterface() && b.getServerInterface() == binding.getServerInterface()) { 99 return; 100 } 101 } 102 bindings.add(binding); 103 } 104 105 111 112 void removeBinding (final Binding binding) { 113 bindings.remove(binding); 114 } 115 } 116 | Popular Tags |