Examples of MonitorException


Examples of com.webobjects.monitor._private.MonitorException

    if (responseContent != null) {
      byte[] responseContentBytes = responseContent.bytes();
      String responseContentString = new String(responseContentBytes);

      if (responseContentString.startsWith("ERROR")) {
        throw new MonitorException("Path " + thePath + " does not exist");
      }

      _JavaMonitorDecoder aDecoder = new _JavaMonitorDecoder();
      try {
        byte[] evilHackCombined = new byte[responseContentBytes.length + evilHack.length];
        // System.arraycopy(src, src_pos, dst, dst_pos, length);
        System.arraycopy(evilHack, 0, evilHackCombined, 0, evilHack.length);
        System.arraycopy(responseContentBytes, 0, evilHackCombined, evilHack.length,
            responseContentBytes.length);
        anArray = (NSArray) aDecoder.decodeRootObject(new NSData(evilHackCombined));
      } catch (WOXMLException wxe) {
        NSLog.err.appendln("RemoteBrowseClient _getFileListOutOfResponse Error decoding response: "
            + responseContentString);
        throw new MonitorException("Host returned bad response for path " + thePath);
      }

    } else {
      NSLog.err.appendln("RemoteBrowseClient _getFileListOutOfResponse Error decoding null response");
      throw new MonitorException("Host returned null response for path " + thePath);
    }

    String isRoots = aResponse.headerForKey("isRoots");
    String filepath = aResponse.headerForKey("filepath");
View Full Code Here

Examples of com.webobjects.monitor._private.MonitorException

      if (requestSucceeded) {
        aResponse = anHTTPConnection.readResponse();
      }

      if ((aResponse == null) || (!requestSucceeded) || (aResponse.status() != 200)) {
        throw new MonitorException("Error requesting directory listing for " + aString + " from " + aHost.name());
      }

      try {
        aFileListDictionary = _getFileListOutOfResponse(aResponse, aString);
      } catch (MonitorException me) {
        if (NSLog
            .debugLoggingAllowedForLevelAndGroups(NSLog.DebugLevelCritical, NSLog.DebugGroupDeployment))
          NSLog.debug.appendln("caught exception: " + me);
        throw me;
      }

      aHost.isAvailable = true;
    } catch (MonitorException me) {
      aHost.isAvailable = true;
      throw me;
    } catch (Exception localException) {
      aHost.isAvailable = false;
      NSLog.err.appendln("Exception requesting directory listing: ");
      localException.printStackTrace();
      throw new MonitorException("Exception requesting directory listing for " + aString + " from "
          + aHost.name() + ": " + localException.toString());
    }
    return aFileListDictionary;
  }
View Full Code Here

Examples of com.webobjects.monitor._private.MonitorException

                                } else {
                                    try {
                                        if (command.equals("STOP")) {
                                          //we need to expect a response here
                                            if (theApplication.localMonitor().terminateInstance(anInstance) == null)
                                              throw new MonitorException("No response to STOP " + anInstance.displayName());
                                        } else if (command.equals("REFUSE")) {
                                          //we need to expect a response here
                                            if (theApplication.localMonitor().stopInstance(anInstance) == null)
                                              throw new MonitorException("No response to REFUSE " + anInstance.displayName());
                                        } else if (command.equals("ACCEPT")) {
                                            if (theApplication.localMonitor().setAcceptInstance(anInstance) == null)
                                              throw new MonitorException("No response to ACCEPT " + anInstance.displayName());
                                            //we got a response, cancel any force quit task
                                            anInstance.cancelForceQuitTask();
                                        } else if (command.equals("QUIT")) {
                                            anInstance.setShouldDie(true);
                                        }
View Full Code Here

Examples of com.webobjects.monitor._private.MonitorException

    checkPassword();
    for (MInstance minstance: instancesArray()) {
      if (minstance.state == MObject.ALIVE || minstance.state == MObject.STARTING) {
        minstance.state = MObject.STOPPING;
        if (application().localMonitor().stopInstance(minstance) == null)
          throw new MonitorException("No response to STOP " + minstance.displayName());
      }
    }
    return response(ERXHttpStatusCodes.OK);   
  }
View Full Code Here

Examples of com.webobjects.monitor._private.MonitorException

 
  public WOActionResults forceQuitAction() throws MonitorException {
    for (MInstance minstance: instancesArray()) {
      minstance.state = MObject.STOPPING;
      if (application().localMonitor().terminateInstance(minstance) == null)
        throw new MonitorException("No response to STOP " + minstance.displayName());
    }
    return response(ERXHttpStatusCodes.OK);
  }
View Full Code Here

Examples of com.webobjects.monitor._private.MonitorException

    }

    protected void catchInstanceErrors(MInstance anInstance) throws MonitorException {
        MSiteConfig aConfig = theApplication.siteConfig();
        if (anInstance == null)
            throw new MonitorException("Attempt to command null instance on " + _hostName);
        if (anInstance.host() != aConfig.localHost())
            throw new MonitorException(anInstance.displayName() + " does not exist on " + _hostName + "; command failed");
        if (!anInstance.isRunning_W())
            throw new MonitorException(_hostName + ": " + anInstance.displayName() + " is not running");
    }
View Full Code Here

Examples of com.webobjects.monitor._private.MonitorException

            boolean requestSucceeded = anHTTPConnection.sendRequest(aRequest);

            if (requestSucceeded) {
                aResponse = anHTTPConnection.readResponse();
            } else {
                throw new MonitorException(_hostName + ": Failed to receive response from " + anInstance.displayName());
            }
            anInstance.succeededInConnection();
        } catch (NSForwardException ne) {
            if (ne.originalException() instanceof IOException) {
                anInstance.failedToConnect();
                throw new MonitorException(_hostName + ": Timeout while connecting to " + anInstance.displayName());
            }
            throw ne;
        } catch (MonitorException me) {
            anInstance.failedToConnect();
            throw me;
        } catch (Exception e) {
            anInstance.failedToConnect();
            throw new MonitorException(_hostName + ": Error while communicating with " + anInstance.displayName() + ": " + e);
        }
        return aResponse;
    }
View Full Code Here

Examples of edu.indiana.extreme.xbaya.monitor.MonitorException

                this.subscriptionID = this.wseClient.subscribe(this.brokerURL
                        .toString(), consumerUrl.getHost() + ":"
                        + consumerUrl.getPort(), this.topic);
            }
        } catch (IOException e) {
            throw new MonitorException("Failed to subscribe.", e);
        } catch (RuntimeException e) {
            throw new MonitorException("Failed to subscribe.", e);
        }
    }
View Full Code Here

Examples of edu.indiana.extreme.xbaya.monitor.MonitorException

                this.xmlConsumer.shutdown();
            }
            this.wseClient.unSubscribe(this.brokerURL.toString(),
                    this.subscriptionID);
        } catch (RuntimeException e) {
            throw new MonitorException("Failed to unsubscribe.", e);
        }

    }
View Full Code Here

Examples of edu.indiana.extreme.xbaya.monitor.MonitorException

            WsdlPortType firstPortType;
            WsdlPortTypeOperation wsdlPortTypeOperation;
      try {
        wsdlPortTypeOperation = WSDLUtil.getFirstOperation(this.modifiedWorkflow.getWorkflowWSDL());
      } catch (ComponentException e) {
        throw new MonitorException(e);
      }
            XmlElement part = soapBody
                    .element(wsdlPortTypeOperation.getName());
            XmlElement parameter = part.element(nodeID);
            // TODO support complex type.
            String value = parameter.requiredText();
            return value;
        }
        // TODO
        String message = "Couldn't find a notification of about the input with nodeID, "
                + nodeID;
        throw new MonitorException(message);
    }
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.