1 23 24 package org.objectweb.fractal.julia.control.binding; 25 26 import org.objectweb.fractal.api.Component; 27 import org.objectweb.fractal.api.NoSuchInterfaceException; 28 import org.objectweb.fractal.api.control.BindingController; 29 import org.objectweb.fractal.api.control.IllegalBindingException; 30 import org.objectweb.fractal.api.control.IllegalLifeCycleException; 31 32 import org.objectweb.fractal.julia.ComponentInterface; 33 import org.objectweb.fractal.julia.Interceptor; 34 35 49 50 public abstract class InterceptorBindingMixin implements BindingController { 51 52 56 private InterceptorBindingMixin () { 57 } 58 59 63 76 77 public Object lookupFc (final String clientItfName) 78 throws NoSuchInterfaceException 79 { 80 Object o = _super_lookupFc(clientItfName); 81 if (o instanceof Interceptor) { 82 o = ((Interceptor)o).getFcItfDelegate(); 84 } 85 return o; 86 } 87 88 103 104 public void bindFc (final String clientItfName, final Object serverItf) throws 105 NoSuchInterfaceException, 106 IllegalBindingException, 107 IllegalLifeCycleException 108 { 109 Object o = _this_weaveableC.getFcInterface(clientItfName); 110 if (o instanceof ComponentInterface) { 111 o = ((ComponentInterface)o).getFcItfImpl(); 112 if (o instanceof Interceptor) { 113 ((Interceptor)o).setFcItfDelegate(serverItf); 114 } else { 115 o = serverItf; 116 } 117 } else { 118 o = serverItf; 119 } 120 _super_bindFc(clientItfName, o); 121 } 122 123 136 137 public void unbindFc (final String clientItfName) throws 138 NoSuchInterfaceException, 139 IllegalBindingException, 140 IllegalLifeCycleException 141 { 142 Object o = _this_weaveableC.getFcInterface(clientItfName); 143 if (o instanceof ComponentInterface) { 144 o = ((ComponentInterface)o).getFcItfImpl(); 145 if (o instanceof Interceptor) { 146 ((Interceptor)o).setFcItfDelegate(null); 147 } 148 } 149 _super_unbindFc(clientItfName); 150 } 151 152 156 161 162 public Component _this_weaveableC; 163 164 176 177 public abstract Object _super_lookupFc (String clientItfName) throws 178 NoSuchInterfaceException; 179 180 192 193 public abstract void _super_bindFc (String clientItfName, Object serverItf) throws 194 NoSuchInterfaceException, 195 IllegalBindingException, 196 IllegalLifeCycleException; 197 198 210 211 public abstract void _super_unbindFc (String clientItfName) throws 212 NoSuchInterfaceException, 213 IllegalBindingException, 214 IllegalLifeCycleException; 215 } 216 | Popular Tags |