コード例 #1
0
ファイル: RESTReservations.java プロジェクト: mksh/jicofo
 /** Stops this instance and all threads created by it. */
 public void stop() {
   if (focusManager != null) {
     focusManager.setFocusAllocationListener(null);
     focusManager = null;
   }
   if (confDurationGuard != null) {
     confDurationGuard.cancel();
     confDurationGuard = null;
   }
 }
コード例 #2
0
ファイル: RESTReservations.java プロジェクト: mksh/jicofo
  /**
   * Initializes this instance and starts background tasks required by <tt>RESTReservations</tt> to
   * work properly.
   *
   * @param focusManager <tt>FocusManager</tt> instance that manages conference pool.
   */
  public void start(FocusManager focusManager) {
    if (this.focusManager != null) throw new IllegalStateException("already started");
    if (focusManager == null) throw new NullPointerException("focusManager");

    this.focusManager = focusManager;
    focusManager.setFocusAllocationListener(this);

    confDurationGuard = new Timer("ConferenceDuartionGuard");
    confDurationGuard.scheduleAtFixedRate(
        new ConferenceExpireTask(), EXPIRE_INTERVAL, EXPIRE_INTERVAL);
  }