コード例 #1
0
ファイル: TelnetD.java プロジェクト: appnativa/rare
 /** Stop this telnet daemon, respectively all configured listeners. */
 public void stop() {
   for (int i = 0; i < m_Listeners.size(); i++) {
     PortListener plis = (PortListener) m_Listeners.get(i);
     // shutdown the Portlistener resources
     plis.stop();
   }
 } // stop
コード例 #2
0
ファイル: TelnetD.java プロジェクト: appnativa/rare
 /** Start this telnet daemon, respectively all configured listeners.<br> */
 public void start() {
   log.debug("start()");
   for (int i = 0; i < m_Listeners.size(); i++) {
     PortListener plis = (PortListener) m_Listeners.get(i);
     plis.start();
   }
 } // start
コード例 #3
0
ファイル: TelnetD.java プロジェクト: appnativa/rare
 /**
  * Returns a {@link PortListener} for the given identifier.
  *
  * @param id the identifier of the {@link PortListener} instance.
  * @return {@link PortListener} instance or null if an instance with the given identifier does not
  *     exist.
  */
 public PortListener getPortListener(String id) {
   if (id == null || id.length() == 0) {
     return null;
   }
   for (Iterator iterator = m_Listeners.iterator(); iterator.hasNext(); ) {
     PortListener portListener = (PortListener) iterator.next();
     if (portListener.getName().equals(id)) {
       return portListener;
     }
   }
   return null;
 } // getPortListener
コード例 #4
0
ファイル: TelnetD.java プロジェクト: appnativa/rare
  /**
   * Method to prepare the PortListener.<br>
   * Creates and prepares and runs a PortListener, with settings from the passed in Properties. Yet
   * the Listener will not accept any incoming connections before startServing() has been called.
   * this has the advantage that whenever a TelnetD Singleton has been factorized, it WILL 99% not
   * fail any longer (e.g. serve its purpose).
   *
   * @param settings Properties object that holds main settings.
   * @throws BootException if preparation fails.
   */
  private void prepareListener(String name, Properties settings) throws BootException {

    // factorize PortListener
    PortListener listener = PortListener.createPortListener(name, settings);
    // start the Thread derived PortListener
    try {
      m_Listeners.add(listener);
    } catch (Exception ex) {
      throw new BootException("Failure while starting PortListener thread: " + ex.getMessage());
    }
  } // prepareListener