1 24 25 package org.objectweb.dream.adl; 26 27 import java.util.Map ; 28 29 import org.objectweb.fractal.adl.ADLException; 30 import org.objectweb.fractal.adl.Factory; 31 import org.objectweb.fractal.api.Component; 32 import org.objectweb.fractal.api.NoSuchInterfaceException; 33 import org.objectweb.fractal.api.control.BindingController; 34 import org.objectweb.fractal.api.control.IllegalBindingException; 35 import org.objectweb.fractal.api.control.IllegalLifeCycleException; 36 37 40 public class ReconfigurationImpl implements Reconfiguration, BindingController 41 { 42 43 Factory factoryItf; 44 45 49 public void addComponents(Component composite, String reconfADL, Map context) 50 throws ADLException 51 { 52 context.put("legacy:./", composite); 53 factoryItf.newComponent(reconfADL, context); 54 } 55 56 59 public String [] listFc() 60 { 61 return new String []{"factory"}; 62 } 63 64 67 public Object lookupFc(String clientItfName) throws NoSuchInterfaceException 68 { 69 if ("factory".equals(clientItfName)) 70 { 71 return factoryItf; 72 } 73 return null; 74 } 75 76 80 public void bindFc(String clientItfName, Object serverItf) 81 throws NoSuchInterfaceException, IllegalBindingException, 82 IllegalLifeCycleException 83 { 84 if ("factory".equals(clientItfName)) 85 { 86 factoryItf = (Factory) serverItf; 87 } 88 } 89 90 93 public void unbindFc(String clientItfName) throws NoSuchInterfaceException, 94 IllegalBindingException, IllegalLifeCycleException 95 { 96 if ("factory".equals(clientItfName)) 97 { 98 factoryItf = null; 99 } 100 } 101 102 } | Popular Tags |