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 41 42 public abstract class CheckBindingMixin implements BindingController { 43 44 48 private CheckBindingMixin () { 49 } 50 51 55 68 69 public void bindFc (final String clientItfName, final Object serverItf) throws 70 NoSuchInterfaceException, 71 IllegalBindingException, 72 IllegalLifeCycleException 73 { 74 if (_this_lookupFc(clientItfName) != null) { 75 throw new ChainedIllegalBindingException( 76 null, 77 _this_weaveableOptC, 78 null, 79 clientItfName, 80 null, 81 "Already bound"); 82 } 83 _super_bindFc(clientItfName, serverItf); 84 } 85 86 98 99 public void unbindFc (final String clientItfName) throws 100 NoSuchInterfaceException, 101 IllegalBindingException, 102 IllegalLifeCycleException 103 { 104 if (_this_lookupFc(clientItfName) == null) { 105 throw new ChainedIllegalBindingException(null, 106 _this_weaveableOptC, 107 null, 108 clientItfName, 109 null, 110 "Not bound"); 111 } 112 _super_unbindFc(clientItfName); 113 } 114 115 119 124 125 public Component _this_weaveableOptC; 126 127 138 139 public abstract Object _this_lookupFc (String clientItfName) throws 140 NoSuchInterfaceException; 141 142 154 155 public abstract void _super_bindFc (String clientItfName, Object serverItf) throws 156 NoSuchInterfaceException, 157 IllegalBindingException, 158 IllegalLifeCycleException; 159 160 172 173 public abstract void _super_unbindFc (String clientItfName) throws 174 NoSuchInterfaceException, 175 IllegalBindingException, 176 IllegalLifeCycleException; 177 } 178 | Popular Tags |