/** * Adds a Managed Element instance to the Runtime Model. It will hold automatically the UNMANAGED * state, until it will be resolved! * * @param element Managed Element instance to be added. */ public synchronized void add(ManagedElement element) { if (element != null) { ((AbstractManagedElement) element).updateState(ManagedElement.UNCHECKED); this.elements.put(element.getUUID(), element); ((CubeAgentImpl) this.agent).deleteUnmanagedElement(element.getUUID()); // setChanged(); // notifyListeners(new Notification(RuntimeModelListener.NEW_UNCHECKED_INSTANCE, element)); } }
public boolean setAgentOfElement(String managed_element_uuid, String agentUri) { ManagedElement me1 = getLocalElement(managed_element_uuid); if (me1 != null) { ((AbstractManagedElement) me1).setCubeAgent(agentUri); return true; } else { try { throw new Exception( "RuntimeModelController.setAgentOfElement (for remote elements) is not yet implemented!"); } catch (Exception e) { e.printStackTrace(); } } return false; }