@Override public Object clone() throws CloneNotSupportedException { ComponentImpl clone = (ComponentImpl)super.clone(); clone.properties = new ArrayList<ComponentProperty>(); for (ComponentProperty property : getProperties()) { clone.properties.add((ComponentProperty)property.clone()); } clone.references = new ArrayList<ComponentReference>(); for (ComponentReference reference : getReferences()) { clone.references.add((ComponentReference)reference.clone()); } clone.services = new ArrayList<ComponentService>(); for (ComponentService service : getServices()) { clone.services.add((ComponentService)service.clone()); } // Clone the implementation.composite if(implementation instanceof Composite) { clone.implementation = (Composite) ((Composite) implementation).clone(); } // Clone the Lists for intents and policySets clone.requiredIntents = new ArrayList<Intent>(getRequiredIntents()); clone.policySets = new ArrayList<PolicySet>(getPolicySets()); return clone; }
@Override public Object clone() throws CloneNotSupportedException { ComponentImpl clone = (ComponentImpl)super.clone(); clone.properties = new ArrayList<ComponentProperty>(); for (ComponentProperty property : getProperties()) { clone.properties.add((ComponentProperty)property.clone()); } clone.references = new ArrayList<ComponentReference>(); for (ComponentReference reference : getReferences()) { clone.references.add((ComponentReference)reference.clone()); } clone.services = new ArrayList<ComponentService>(); for (ComponentService service : getServices()) { clone.services.add((ComponentService)service.clone()); } // Clone the implementation.composite if(implementation instanceof Composite) { clone.implementation = (Composite) ((Composite) implementation).clone(); } // Clone the Lists for intents and policySets clone.requiredIntents = new ArrayList<Intent>(getRequiredIntents()); clone.policySets = new ArrayList<PolicySet>(getPolicySets()); return clone; }
ComponentService service = (ComponentService)endpoint.getService().clone(); component.getServices().add(service); service.getBindings().clear();
ComponentService service = (ComponentService)endpoint.getService().clone(); component.getServices().add(service); service.getBindings().clear();