Example usage for org.apache.commons.jxpath JXPathNotFoundException printStackTrace

List of usage examples for org.apache.commons.jxpath JXPathNotFoundException printStackTrace

Introduction

In this page you can find the example usage for org.apache.commons.jxpath JXPathNotFoundException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:org.cloudml.mrt.Coordinator.java

public void updateStatusInternalComponent(String name, String newState, String identity) {
    //A PeerStub identifies who launches the modifications
    PeerStub committer = new SystemOutPeerStub(identity);

    //A wrapper hides the complexity of invoking the coordinator
    CmdWrapper wrapper = new CmdWrapper(this, committer);

    //Update the value of status
    try {/*from   w  ww . j  ava2s. co m*/
        Thread.sleep(1500);
        journal.log(Level.INFO, ">> Updating the model..");
        wrapper.eSet("/componentInstances[name='" + name + "']",
                wrapper.makePair("status", "" + newState + ""));
        journal.log(Level.INFO, ">> Status of: " + name + " changed in: " + newState + "");

    } catch (org.apache.commons.jxpath.JXPathNotFoundException e) {
        journal.log(Level.INFO, "Machine: " + name + " not in this model");
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}

From source file:org.cloudml.mrt.Coordinator.java

public void updateStatus(String name, String newState, String identity) {
    //A PeerStub identifies who launches the modifications
    PeerStub committer = new SystemOutPeerStub(identity);

    //A wrapper hides the complexity of invoking the coordinator
    CmdWrapper wrapper = new CmdWrapper(this, committer);

    //Update the value of status
    try {//from   ww  w . j  a  va  2  s .c o  m
        Thread.sleep(1500);
        Object res = wrapper.eGet("/componentInstances[name='" + name + "']/status");
        if (res != null) {
            if (!res.toString().equals(newState)) {
                journal.log(Level.INFO, ">> Updating the model..");
                wrapper.eSet("/componentInstances[name='" + name + "']",
                        wrapper.makePair("status", "" + newState + ""));
                journal.log(Level.INFO, ">> Status of: " + name + " changed in: " + newState + "");
            }
        }

    } catch (org.apache.commons.jxpath.JXPathNotFoundException e) {
        journal.log(Level.INFO, "Machine: " + name + " not in this model");
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}

From source file:org.cloudml.mrt.Coordinator.java

public void updateIP(String name, String ip, String identity) {
    PeerStub committer = new SystemOutPeerStub(identity);
    CmdWrapper wrapper = new CmdWrapper(this, committer);
    try {//w w  w.j a  v  a 2s.  c o m
        Thread.sleep(1500);
        Object res = wrapper.eGet("/componentInstances[name='" + name + "']/publicAddress");
        if (res != null) {
            journal.log(Level.INFO, ">> Updating the model..");
            wrapper.eSet("/componentInstances[name='" + name + "']",
                    wrapper.makePair("publicAddress", "" + ip + ""));
            journal.log(Level.INFO, ">> IP of: " + name + " changed in: " + ip + "");
        }

    } catch (org.apache.commons.jxpath.JXPathNotFoundException e) {
        journal.log(Level.INFO, "Machine: " + name + " not in this model");
    } catch (InterruptedException e) {
        e.printStackTrace();
    }

}