1 24 25 package org.objectweb.dream.adl; 26 27 import org.objectweb.fractal.adl.ADLException; 28 import org.objectweb.fractal.api.NoSuchInterfaceException; 29 import org.objectweb.fractal.api.control.BindingController; 30 import org.objectweb.fractal.api.control.IllegalBindingException; 31 import org.objectweb.fractal.api.control.IllegalLifeCycleException; 32 33 38 public abstract class AbstractDelagatingChecker 39 implements 40 Checker, 41 BindingController 42 { 43 44 45 public static final String CHECKER_OPT_ITF_NAME = "client-checker"; 46 47 protected Checker optChekerItf; 48 49 53 public void check(Object legacyComponent, Object node) throws ADLException 54 { 55 if (optChekerItf != null) 56 { 57 optChekerItf.check(legacyComponent, node); 58 } 59 doChek(legacyComponent, node); 60 } 61 62 protected abstract void doChek(Object legacyComponent, Object node) 63 throws ADLException; 64 65 68 public String [] listFc() 69 { 70 return new String []{CHECKER_OPT_ITF_NAME}; 71 } 72 73 76 public Object lookupFc(String clientItfName) throws NoSuchInterfaceException 77 { 78 if (CHECKER_OPT_ITF_NAME.equals(clientItfName)) 79 { 80 return optChekerItf; 81 } 82 return null; 83 } 84 85 89 public void bindFc(String clientItfName, Object serverItf) 90 throws NoSuchInterfaceException, IllegalBindingException, 91 IllegalLifeCycleException 92 { 93 if (CHECKER_OPT_ITF_NAME.equals(clientItfName)) 94 { 95 optChekerItf = (Checker) serverItf; 96 } 97 } 98 99 102 public void unbindFc(String clientItfName) throws NoSuchInterfaceException, 103 IllegalBindingException, IllegalLifeCycleException 104 { 105 if (CHECKER_OPT_ITF_NAME.equals(clientItfName)) 106 { 107 optChekerItf = null; 108 } 109 } 110 111 } | Popular Tags |