org.objectweb.fractal.api.Component client = cItf.getFcItfOwner(); org.objectweb.fractal.api.Component server = sItf.getFcItfOwner(); if (client.equals(server)) { return; } catch (org.objectweb.fractal.api.NoSuchInterfaceException ignored) { if (cItf.isFcInternalItf()) { if (cSc != null) { org.objectweb.fractal.api.Component[] sP = sSc.getFcSuperComponents(); if (sItf.isFcInternalItf()) { if (cSc != null) { org.objectweb.fractal.api.Component[] cP = cSc.getFcSuperComponents(); throw new org.objectweb.fractal.julia.control.binding.ChainedIllegalBindingException(null, weaveableOptC, sId, cItf.getFcItfName(), sItf.getFcItfName(), "Not a local binding");
if (sItf.isFcInternalItf()) { final InterfaceType serverType = (InterfaceType) sItf.getFcItfType(); if (serverType.isFcCollectionItf()) { eic = (ExportedInterfaceController) sItf.getFcItfOwner() .getFcInterface("/exported-itf-controller"); } catch (final NoSuchInterfaceException e) { eic.exportFcInterface(sItf.getFcItfName(), (Interface) _this_weaveableC.getFcInterface(clientItfName)); return;
String getFullInterfaceName(final Interface itf) { try { final String ownerName = Fractal.getNameController(itf.getFcItfOwner()) .getFcName(); return ownerName + '.' + itf.getFcItfName(); } catch (final NoSuchInterfaceException e) { return "anonymous." + itf.getFcItfName(); } }
public String[] listFc() { Object[] itfs = _this_weaveableC.getFcInterfaces(); int size = 0; for (Object o : itfs) { Interface itf = (Interface)o; InterfaceType it = (InterfaceType) itf.getFcItfType(); if( it.isFcClientItf() ) { size++; } } String[] names = new String[size]; int i = 0; for (Object o : itfs) { Interface itf = (Interface)o; InterfaceType it = (InterfaceType) itf.getFcItfType(); if( it.isFcClientItf() ) { names[i] = itf.getFcItfName(); i++; } } return names; }
logger.fine(" - FCITF Name = " + i.getFcItfName()); logger.fine(" - FCITF Type = " + i.getFcItfType()); logger.fine(" - FCITF internal = " + i.isFcInternalItf()); String stringName = i.getFcItfType().toString();
try { sItf = ((Interface)(serverItf)); sItfType = ((InterfaceType)(sItf.getFcItfType())); } catch (ClassCastException e) { bindFc(cItfType ,clientItfName ,serverItf); throw new ChainedIllegalBindingException(null , weaveableC , sItf.getFcItfOwner() , clientItfName , sItf.getFcItfName() , "Cannot bind two client interfaces together"); Class c = Class.forName(cItfType.getFcItfSignature()); if (!(c.isAssignableFrom(s))) { throw new ChainedIllegalBindingException(null , weaveableC , sItf.getFcItfOwner() , clientItfName , sItf.getFcItfName() , "The server interface type is not a subtype of the client interface type"); throw new ChainedIllegalBindingException(null , weaveableC , ((Interface)(serverItf)).getFcItfOwner() , clientItfName , ((Interface)(serverItf)).getFcItfName() , "A mandatory interface cannot be bound to an optional interface");
@Override protected void addInterfaces(Object[] rawItfs, Set<Node> result) { NodeFactory nf = (NodeFactory) model; for (Object rawItf : rawItfs) { Interface itf = (Interface) rawItf; String itfName = itf.getFcItfName(); if ( !itfName.endsWith("-controller") && !itfName.equalsIgnoreCase("component") && !(itf instanceof TinfiComponentOutInterface )) { result.add(nf.createScaServiceNode(itf)); } } } }
/** * Parse arguments and call createBinding() */ public Object apply(List<Object> args, Context ctx) throws ScriptExecutionError { Map<String, Object> hints = new HashMap<String, Object>(); InterfaceNode itf = (InterfaceNode) args.get(0); String uri = (String) args.get(1); hints.put(PLUGIN_ID, "ws"); hints.put(WsConnectorConstants.URI, uri); this.createBinding(itf.getName(), itf.getInterface().getFcItfOwner(), itf.isClient(), hints); return null; }
if (!(((InterfaceType) (((Interface) itf[i]).getFcItfType())) .isFcClientItf())) { if (((InterfaceType) (((Interface) itf[i]).getFcItfType())) .getFcItfSignature().equals(signature)) { res.add(itf[i]);
final InterfaceType itfType = (InterfaceType) i.getFcItfType(); if (itfType.isFcClientItf() && !i.isFcInternalItf()) {
/** * @see org.ow2.frascati.tinfi.control.binding.BasicBindingControllerMixin#listFc() */ public String[] listFc() { Object[] itfs = weaveableC.getFcInterfaces(); int size = 0; for (Object o : itfs) { Interface itf = ((Interface)(o)); InterfaceType it = ((InterfaceType)(itf.getFcItfType())); if (it.isFcClientItf()) { size++; } } String[] names = new String[size]; int i = 0; for (Object o : itfs) { Interface itf = ((Interface)(o)); InterfaceType it = ((InterfaceType)(itf.getFcItfType())); if (it.isFcClientItf()) { names[i] = itf.getFcItfName(); i++; } } return names; }
public void unexportFcInterface(final String clientItfName) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException { if (!fcExportedInterfaces.containsKey(clientItfName)) { throw new ChainedNoSuchInterfaceException(null, _this_weaveableC, "Interface '" + clientItfName + "' does not correspond to an exported client interface."); } final Interface innerItf = fcExportedInterfaces.get(clientItfName); for (final String itfName : getBindingController(innerItf.getFcItfOwner()) .listFc()) { if (itfName.startsWith(innerItf.getFcItfName())) { throw new ChainedIllegalBindingException(null, innerItf.getFcItfOwner(), _this_weaveableC, innerItf.getFcItfName(), clientItfName, "Cannot unexport the collection interface. Interface '" + itfName + "' must be unbound first."); } } fcExportedInterfaces.remove(clientItfName); }
try { sItf = ((org.objectweb.fractal.api.Interface) (serverItf)); sItfType = ((org.objectweb.fractal.api.type.InterfaceType) (sItf.getFcItfType())); } catch (java.lang.ClassCastException e) { bindFc(cItfType, clientItfName, serverItf); throw new org.objectweb.fractal.julia.control.binding.ChainedIllegalBindingException(null, weaveableC, sItf.getFcItfOwner(), clientItfName, sItf.getFcItfName(), "Cannot bind two client interfaces together"); java.lang.Class c = java.lang.Class.forName(cItfType.getFcItfSignature()); if (!(c.isAssignableFrom(s))) { throw new org.objectweb.fractal.julia.control.binding.ChainedIllegalBindingException(null, weaveableC, sItf.getFcItfOwner(), clientItfName, sItf.getFcItfName(), "The server interface type is not a subtype of the client interface type"); throw new org.objectweb.fractal.julia.control.binding.ChainedIllegalBindingException(null, weaveableC, ((org.objectweb.fractal.api.Interface) (serverItf)).getFcItfOwner(), clientItfName, ((org.objectweb.fractal.api.Interface) (serverItf)).getFcItfName(), "A mandatory interface cannot be bound to an optional interface");
public Object getFcInterface( String arg0 ) throws NoSuchInterfaceException { Object[] interfaces = getFcInterfaces(); for (int i = 0; i < interfaces.length; i++) { String name = ((Interface)interfaces[i]).getFcItfName(); if( name.equals(arg0) ) { return interfaces[i]; } } throw new NoSuchInterfaceException(arg0); }
/** * Parse arguments and call createBinding() */ public Object apply(List<Object> args, Context ctx) throws ScriptExecutionError { Map<String, Object> hints = new HashMap<String, Object>(); InterfaceNode itf = (InterfaceNode) args.get(0); String uri = (String) args.get(1); hints.put(PLUGIN_ID, "rest"); hints.put(RestConnectorConstants.URI, uri); this.createBinding(itf.getName(), itf.getInterface().getFcItfOwner(), itf.isClient(), hints); return null; }
/** * @see org.ow2.frascati.tinfi.control.binding.CollectionInterfaceBindingControllerMixin#unbindFc(java.lang.String) */ private void unbindFc$3(java.lang.String clientItfName) throws org.objectweb.fractal.api.NoSuchInterfaceException, org.objectweb.fractal.api.control.IllegalBindingException, org.objectweb.fractal.api.control.IllegalLifeCycleException { org.objectweb.fractal.api.Interface itf = ((org.objectweb.fractal.api.Interface) (weaveableC.getFcInterface(clientItfName))); org.objectweb.fractal.api.type.InterfaceType it = ((org.objectweb.fractal.api.type.InterfaceType) (itf.getFcItfType())); if (it.isFcCollectionItf()) { fcBindings.remove(clientItfName); }else { unbindFc$4(clientItfName); } }
Component client = cItf.getFcItfOwner(); Component server = sItf.getFcItfOwner(); if (client.equals(server)) { return ; } catch (NoSuchInterfaceException ignored) { if (cItf.isFcInternalItf()) { if (cSc != null) { Component[] sP = sSc.getFcSuperComponents(); if (sItf.isFcInternalItf()) { if (cSc != null) { Component[] cP = cSc.getFcSuperComponents(); throw new ChainedIllegalBindingException(null , weaveableOptC , sId , cItf.getFcItfName() , sItf.getFcItfName() , "Not a local binding");
for (int i = 0; i < itfs.length; ++i) { Interface cItf = (Interface)itfs[i]; InterfaceType cItfType = (InterfaceType)cItf.getFcItfType(); if (cItfType.isFcCollectionItf()) { Component c = cItf.getFcItfOwner(); BindingController bc = (BindingController)c.getFcInterface("binding-controller"); InterfaceType sItfType = (InterfaceType)sItf.getFcItfType(); if (sItf.isFcInternalItf() && sItfType.isFcCollectionItf() && sItf.getFcItfName().equals(sItfType.getFcItfName())) Component sComp = sItf.getFcItfOwner(); try { BindingController bc = cc = (ContentController)sComp.getFcInterface("content-controller"); String s = sItf.getFcItfName(); String[] itfs = bc.listFc(); for (int i = 0; i < itfs.length; ++i) {
/** * @see org.objectweb.fractal.juliac.fraclet.control.binding.FracletBindingControllerMixin#listFc() */ public java.lang.String[] listFc() { if (bc) return listFc$0(); java.lang.Object[] itfs = weaveableC.getFcInterfaces(); int size = 0; for (java.lang.Object o : itfs) { org.objectweb.fractal.api.Interface itf = ((org.objectweb.fractal.api.Interface) (o)); org.objectweb.fractal.api.type.InterfaceType it = ((org.objectweb.fractal.api.type.InterfaceType) (itf.getFcItfType())); if (it.isFcClientItf()) { size++; } } java.lang.String[] names = new java.lang.String[size]; int i = 0; for (java.lang.Object o : itfs) { org.objectweb.fractal.api.Interface itf = ((org.objectweb.fractal.api.Interface) (o)); org.objectweb.fractal.api.type.InterfaceType it = ((org.objectweb.fractal.api.type.InterfaceType) (itf.getFcItfType())); if (it.isFcClientItf()) { names[i] = itf.getFcItfName(); i++; } } return names; }
/** * Get the list of intent nodes for a given business interface. * * @param ic - The intent controller of the interface owner (the component under introspection). * @param itf - The interface to search intents on. * @return The list of intents found for this interface (can be empty!). * @throws NoSuchInterfaceException if an interface is not found. */ private List<ScaIntentNode> getIntentNodes(SCABasicIntentController ic, Interface itf) throws NoSuchInterfaceException { List<ScaIntentNode> nodes = new ArrayList<ScaIntentNode>(); String itfName = itf.getFcItfName(); if ( !itfName.endsWith("-controller") && !itfName.equals("component")) { // no intents on controllers List<IntentHandler> intents = ic.listFcIntentHandler( itf.getFcItfName() ); for (IntentHandler intent : intents) { Component impl = ((Interface) intent).getFcItfOwner(); String name = Fractal.getNameController(impl).getFcName(); nodes.add( new ScaIntentNode((FraSCAtiModel) this.model, ic, name, impl, itf) ); } } return nodes; }