Example #1
0
 /*
  * (non-Javadoc)
  *
  * @see org.centny.jetty4a.server.api.ServerListener#init(java.io.File,
  * java.io.File, java.io.File)
  */
 @Override
 public void init(File root, File croot, File droot, Properties webp) {
   //
   new XmlGenerator(webp).convert(croot);
   //
   File realm = null;
   if (webp.containsKey("REALM")) {
     realm = new File(webp.getProperty("REALM"));
   } else {
     realm = new File(croot, "Realm.properties");
   }
   if (!realm.exists()) {
     this.log.warn("the realm configure file " + realm.getAbsolutePath() + " not exist");
     return;
   }
   try {
     this.hls = new HashLoginService("MGit Login");
     this.hls.setConfig(realm.getAbsolutePath());
     this.hls.start();
     this.log.debug("using realm configure file:" + realm.getAbsolutePath());
     sharedLoginService_ = this.hls;
   } catch (Exception e) {
     this.log.warn(e);
   }
   String sws = webp.getProperty("SYNC_WS");
   if (sws != null && sws.trim().length() > 0) {
     SyncMgr.smgr().setWsDir(new File(sws));
     SyncMgr.smgr().setSync2Remoete(true);
     SyncMgr.smgr().startTimer();
   }
 }
Example #2
0
 /*
  * (non-Javadoc)
  *
  * @see org.centny.jetty4a.server.api.ServerListener#destroy()
  */
 @Override
 public void destroy() {
   if (this.hls != null) {
     try {
       this.hls.stop();
     } catch (Exception e) {
       this.log.warn(e);
     }
   }
   if (SyncMgr.smgr().isTimerStarted()) {
     SyncMgr.smgr().stopTimer();
   }
 }