1 23 24 package org.objectweb.fractal.julia.control.binding; 25 26 import org.objectweb.fractal.api.NoSuchInterfaceException; 27 import org.objectweb.fractal.api.control.BindingController; 28 import org.objectweb.fractal.api.control.IllegalBindingException; 29 import org.objectweb.fractal.api.control.IllegalLifeCycleException; 30 31 import java.util.HashMap ; 32 import java.util.Map ; 33 34 44 45 public abstract class BasicBindingControllerMixin implements BindingController { 46 47 51 private BasicBindingControllerMixin () { 52 } 53 54 58 67 68 public Map fcBindings; 69 70 public String [] listFc () { 71 if (fcBindings == null) { 72 return new String [0]; 73 } 74 return (String [])fcBindings.keySet().toArray(new String [fcBindings.size()]); 75 } 76 77 public Object lookupFc (final String clientItfName) 78 throws NoSuchInterfaceException 79 { 80 if (fcBindings == null) { 81 return null; 82 } 83 Object serverItf = fcBindings.get(clientItfName); 84 return serverItf == fcBindings ? null : serverItf; 85 } 86 87 public void bindFc (final String clientItfName, final Object serverItf) throws 88 NoSuchInterfaceException, 89 IllegalBindingException, 90 IllegalLifeCycleException 91 { 92 if (fcBindings == null) { 93 fcBindings = new HashMap (); 94 } 95 fcBindings.put(clientItfName, serverItf); 96 } 97 98 public void unbindFc (final String clientItfName) throws 99 NoSuchInterfaceException, 100 IllegalBindingException, 101 IllegalLifeCycleException 102 { 103 if (fcBindings != null) { 104 fcBindings.put(clientItfName, fcBindings); 105 } 106 } 107 108 112 } 113 | Popular Tags |