Examples of ChangeRequest


Examples of de.fhkn.in.uce.stun.attribute.ChangeRequest

    private void sendIndicationWithChangeRequestAttribute(final int changeRequestFlag, final Socket sendSocket)
            throws IOException {
        logger.debug("Sending indication with change request flag = {}", changeRequestFlag); //$NON-NLS-1$
        final Message indication = MessageStaticFactory.newSTUNMessageInstance(STUNMessageClass.INDICATION,
                STUNMessageMethod.BINDING);
        indication.addAttribute(new ChangeRequest(changeRequestFlag));
        indication.writeTo(sendSocket.getOutputStream());
    }
View Full Code Here

Examples of model.devscore.dynamic.ChangeRequest

    // Iterator it2 = amchgs.iterator();
    for (int i = 0; i < amchgs.length; i++)
    /* while (it2.hasNext()) */{
      // ChangeRequest cr = (ChangeRequest) it2.next();
      ChangeRequest cr = amchgs[i];
      if (cr instanceof BasicCouplingChangeRequest) {

        entry = ((BasicCouplingChangeRequest) cr).getContext();

        // It may be that the context is a model that needs to be added before
        // (has to be looked up in the hash map)
        if (entry == null) {
          // try to fix the context

          // System.out.println("Need to fix the context!!");

          ModelChangeRequest cr2 =
              (ModelChangeRequest) modelsToAdd
                  .get(((BasicCouplingChangeRequest) cr).getModel1());

          if (cr2 != null) {
            entry = cr2.getContext();
          }

          if (entry == null) {

            throw new InvalidChangeRequestException(
                "Coupling change request from model ["
                    + ((BasicCouplingChangeRequest) cr).getModel1()
                        .getFullName()
                    + "] and port ["
                    + ((BasicCouplingChangeRequest) cr).getPort1().getName()
                    + "]. There is no valid context in which this change can take place");
          }
        }

        // System.out.println("CR in context "+entry.REMOTEgetFullName()+" type
        // "+cr.getClass().getName()+" \n "+cr.toString());

        List<ChangeRequest<?>> schg = strucChangesPerModel.get(entry);
        if (schg == null) {
          schg = new ArrayList<>();
          schg.add(cr);
          strucChangesPerModel.put(entry, schg);
        } else {
          schg.add(cr);
        }
      } else if (cr instanceof ModelChangeRequest) {
        entry = ((ModelChangeRequest) cr).getContext();

        if (entry == null) {
          throw new InvalidChangeRequestException("Model change request for "
              + ((ModelChangeRequest) cr).getModelName()
              + " But this model has no context model to be inserted in!!");
        }

        List<ChangeRequest<?>> schg = strucChangesPerModel.get(entry);
        if (schg == null) {
          schg = new ArrayList<>();
          schg.add(cr);
          strucChangesPerModel.put(entry, schg);
        } else {
          schg.add(cr);
        }
      } else if (cr instanceof PortChangeRequest) {

        // Test whether model already exists
        entry = ((PortChangeRequest) cr).getModel();

        // It may be that the model whose ports should be changed needs to be
        // added before (has to be looked up in the hash map)
        if (entry == null) {
          ModelChangeRequest cr2 =
              (ModelChangeRequest) modelsToAdd.get(((PortChangeRequest) cr)
                  .getModel());

          if (cr2 != null) {
            entry = cr2.getContext();
          }

          if (entry == null) {
            throw new InvalidChangeRequestException(
                "Port change request from model ["
                    + cr.getSource().getFullName()
                    + "] for model ["
                    + ((PortChangeRequest) cr).getModel().getFullName()
                    + "] and port ["
                    + ((PortChangeRequest) cr).getPort().getName()
                    + "]. There is no valid context in which this change can take place");
View Full Code Here

Examples of org.jboss.dna.graph.request.ChangeRequest

                // Remove all of the enqueued requests for this branch ...
                for (Iterator<Request> iter = this.requests.iterator(); iter.hasNext();) {
                    Request request = iter.next();
                    assert request instanceof ChangeRequest;
                    ChangeRequest change = (ChangeRequest)request;
                    if (change.changes(workspaceName, node.getPath())) {
                        iter.remove();
                    }
                }
            }
        }
View Full Code Here

Examples of org.jboss.dna.graph.request.ChangeRequest

        Path path = node.getPath();
        LinkedList<Request> branchRequests = new LinkedList<Request>();
        LinkedList<Request> nonBranchRequests = new LinkedList<Request>();
        for (Request request : this.requests) {
            assert request instanceof ChangeRequest;
            ChangeRequest change = (ChangeRequest)request;
            if (change.changes(workspaceName, path)) {
                branchRequests.add(request);
            } else {
                nonBranchRequests.add(request);
            }
        }
View Full Code Here

Examples of org.jboss.dna.graph.request.ChangeRequest

                // Remove all of the enqueued requests for this branch ...
                for (Iterator<Request> iter = this.requests.iterator(); iter.hasNext();) {
                    Request request = iter.next();
                    assert request instanceof ChangeRequest;
                    ChangeRequest change = (ChangeRequest)request;
                    if (change.changes(workspaceName, node.getPath())) {
                        iter.remove();
                    }
                }
            }
        }
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

                        // immediate parent if there is none.
                        NamedObj container = argument.getContainer();
                        String moml = "<deleteProperty name=\""
                                + argument.getName() + "\"/>\n";

                        ChangeRequest request = new MoMLChangeRequest(this,
                                container, moml);
                        container.addChangeListener(this);
                        container.requestChange(request);
                    }
                }
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

                    // Defer change requests so that if changes are
                    // requested during execution, they get queued.
                    previousDeferStatus = setDeferringChangeRequests(true);

                    while (requests.hasNext()) {
                        ChangeRequest change = (ChangeRequest) requests.next();
                        change.setListeners(_changeListeners);

                        if (_debugging) {
                            _debug("-- Executing change request "
                                    + "with description: "
                                    + change.getDescription());
                        }

                        // The change listeners should be those of this
                        // actor and any container that it has!
                        // FIXME: This is expensive... Better solution?
                        // We previously tried issuing a dummy change
                        // request to the container, but this caused big
                        // problems... (weird null-pointer expections
                        // deep in diva when making connections).
                        // Is it sufficient to just go to the top level?
                        List changeListeners = new LinkedList();
                        NamedObj container = getContainer();

                        while (container != null) {
                            List list = container.getChangeListeners();

                            if (list != null) {
                                changeListeners.addAll(list);
                            }

                            container = container.getContainer();
                        }

                        change.setListeners(changeListeners);

                        change.execute();
                    }
                } finally {
                    _workspace.doneWriting();
                    setDeferringChangeRequests(previousDeferStatus);
                }
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

        super._addEntity(entity);

        // Issue a change request to add the appropriate
        // ports and connections to the new entity.
        ChangeRequest request = new ChangeRequest(this, // originator
                "Adjust contained entities, ports and parameters") {
            // Override this to indicate that the change is localized.
            // This keeps the EntityTreeModel from closing open libraries
            // when notified of this change.
            public NamedObj getLocality() {
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

        // the time this executes.  Do not use MoML here because it
        // isn't necessary to generate any undo code.  _removePort()
        // takes care of the undo.
        final MirrorPort castPort = (MirrorPort) port;

        ChangeRequest request = new ChangeRequest(this,
                "Add a port on the inside") {
            // Override this to indicate that the change is localized.
            // This keeps the EntityTreeModel from closing open libraries
            // when notified of this change.
            public NamedObj getLocality() {
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

                return;
            }

            // Use a change request so we can be sure the port
            // being added is fully constructed.
            ChangeRequest request = new ChangeRequest(this,
                    "Add mirror port to the container.") {
                // Override this to indicate that the change is localized.
                // This keeps the EntityTreeModel from closing open libraries
                // when notified of this change.
                public NamedObj getLocality() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.