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.ContentController; 29 import org.objectweb.fractal.api.control.IllegalBindingException; 30 import org.objectweb.fractal.api.control.IllegalLifeCycleException; 31 import org.objectweb.fractal.api.type.InterfaceType; 32 33 import org.objectweb.fractal.julia.ComponentInterface; 34 import org.objectweb.fractal.julia.Interceptor; 35 36 49 50 public abstract class CompositeBindingMixin { 51 52 56 private CompositeBindingMixin () { 57 } 58 59 63 79 80 public void bindFc ( 81 final InterfaceType clientItfType, 82 final String clientItfName, 83 final Object serverItf) 84 throws 85 NoSuchInterfaceException, 86 IllegalBindingException, 87 IllegalLifeCycleException 88 { 89 _super_bindFc(clientItfType, clientItfName, serverItf); 90 Object complementaryItf; 91 if (clientItfType.isFcClientItf()) { 92 complementaryItf = 93 _this_weaveableCC.getFcInternalInterface(clientItfName); 94 } else { 95 complementaryItf = 96 _this_weaveableC.getFcInterface(clientItfName); 97 } 98 ComponentInterface itf = (ComponentInterface)complementaryItf; 99 if (itf.hasFcInterceptor()) { 100 Object newImpl = itf.getFcItfImpl(); 101 ((Interceptor)newImpl).setFcItfDelegate(serverItf); 102 } else { 103 itf.setFcItfImpl(serverItf); 104 } 105 } 106 107 122 123 public void unbindFc ( 124 final InterfaceType clientItfType, 125 final String clientItfName) 126 throws 127 NoSuchInterfaceException, 128 IllegalBindingException, 129 IllegalLifeCycleException 130 { 131 _super_unbindFc(clientItfType, clientItfName); 132 Object complementaryItf; 133 if (clientItfType.isFcClientItf()) { 134 complementaryItf = 135 _this_weaveableCC.getFcInternalInterface(clientItfName); 136 } else { 137 complementaryItf = 138 _this_weaveableC.getFcInterface(clientItfName); 139 } 140 ComponentInterface itf = (ComponentInterface)complementaryItf; 141 if (itf.hasFcInterceptor()) { 142 Object newImpl = itf.getFcItfImpl(); 143 ((Interceptor)newImpl).setFcItfDelegate(null); 144 } else { 145 itf.setFcItfImpl(null); 146 } 147 } 148 149 153 158 159 public Component _this_weaveableC; 160 161 166 167 public ContentController _this_weaveableCC; 168 169 183 184 public abstract void _super_bindFc ( 185 InterfaceType clientItfType, 186 String clientItfName, 187 Object serverItf) 188 throws 189 NoSuchInterfaceException, 190 IllegalBindingException, 191 IllegalLifeCycleException; 192 193 206 207 public abstract void _super_unbindFc ( 208 InterfaceType clientItfType, 209 String clientItfName) 210 throws 211 NoSuchInterfaceException, 212 IllegalBindingException, 213 IllegalLifeCycleException; 214 } 215 | Popular Tags |