コード例 #1
0
  private void loadSettings(final String theFile) {
    CCXMLElement myProcessXML = CCXMLIO.createXMLElement(CCNIOUtil.dataPath(theFile));
    System.out.println(CCNIOUtil.dataPath(theFile));
    CCXMLElement myStartTimeXML = myProcessXML.child("starttime");
    if (myStartTimeXML != null) _myStartTime = myStartTimeXML.intContent(0);

    CCXMLElement myRestartTimeXML = myProcessXML.child("restarttime");
    if (myRestartTimeXML != null) _myRestartTime = myRestartTimeXML.intContent(0);

    CCXMLElement myClassNameXML = myProcessXML.child("class");
    if (myClassNameXML == null)
      throw new RuntimeException("You have to define a class to start inside the process.xml!");
    _myClassName = myClassNameXML.content();

    CCXMLElement myClassPathXML = myProcessXML.child("classpath");
    if (myClassPathXML == null)
      throw new RuntimeException("You have to define a classpath inside the process.xml!");

    for (CCXMLElement myLibXML : myClassPathXML) {
      _myLibraries.add(myLibXML.content());
    }

    CCXMLElement myVMParametersXML = myProcessXML.child("vm_options");
    if (myVMParametersXML != null) {
      for (CCXMLElement myVMParameterXML : myVMParametersXML) {
        _myVirtualMachineOptions.add(myVMParameterXML.content());
      }
    }

    loadRestartOptions(myProcessXML.child("restart"));
  }
コード例 #2
0
  private void loadRestartOptions(CCXMLElement theRestartOptionsXML) {
    if (theRestartOptionsXML == null) return;

    CCXMLElement myMinFrameRateXML = theRestartOptionsXML.child("minFrameRate");
    if (myMinFrameRateXML != null) {
      addCommandHandler(
          "-frameRate", new CCWatchDogFrameRateRestart(myMinFrameRateXML.floatContent()));
    }
    CCXMLElement myMaxOffTimeXML = theRestartOptionsXML.child("maxOffTime");
    if (myMaxOffTimeXML != null) {
      _myMaxOffTime = myMaxOffTimeXML.intContent();
    }
  }