1 23 24 package org.objectweb.fractal.julia; 25 26 import org.objectweb.fractal.api.Component; 27 import org.objectweb.fractal.api.NoSuchInterfaceException; 28 import org.objectweb.fractal.api.Type; 29 import org.objectweb.fractal.api.type.ComponentType; 30 import org.objectweb.fractal.api.type.InterfaceType; 31 32 import java.util.Map ; 33 34 44 45 public abstract class TypeComponentMixin implements Component { 46 47 51 private TypeComponentMixin () { 52 } 53 54 58 69 70 public Object getFcInterface (final String interfaceName) 71 throws NoSuchInterfaceException 72 { 73 if (interfaceName.indexOf('/') != -1) { 74 return _super_getFcInterface(interfaceName); 75 } 76 ComponentType compType = (ComponentType)_this_getFcType(); 77 InterfaceType itfType; 78 try { 79 itfType = compType.getFcInterfaceType(interfaceName); 80 } catch (NoSuchInterfaceException e) { 81 throw new ChainedNoSuchInterfaceException(null, this, interfaceName); 82 } 83 Object result; 84 try { 85 result = _super_getFcInterface(interfaceName); 86 } catch (NoSuchInterfaceException e) { 87 if (itfType.isFcCollectionItf()) { 88 result = _super_getFcInterface("/collection/" + itfType.getFcItfName()); 89 result = ((ComponentInterface)result).clone(); 90 ((ComponentInterface)result).setFcItfName(interfaceName); 91 _this_fcInterfaces.put(interfaceName, result); 92 } else { 93 throw e; 94 } 95 } 96 return result; 97 } 98 99 103 107 108 public Map _this_fcInterfaces; 109 110 115 116 public abstract Type _this_getFcType (); 117 118 128 129 public abstract Object _super_getFcInterface (String interfaceName) 130 throws NoSuchInterfaceException; 131 } 132 | Popular Tags |