home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-12-16 | 2.0 KB | 83 lines |
- /*
- * URLList.java
- *
- *
- * Copyright 1996 Sybase, Inc. All rights reserved.
- */
-
-
- /**
- * URLPollingThread is a thread that will forever sleep for a
- * specified interval, wake up, poll a list of URLs.
- */
-
- public class URLPollingThread extends Thread
- //******************************************
- {
-
- //-------------------------------------------------------------
- // Public Methods
- //-------------------------------------------------------------
-
- /**
- * Sets the URL list for this thread
- * @param aList URL list
- */
-
- public void setURLList( URLList aList )
- //*************************************
- {
- _list = aList;
- }
-
- public synchronized void run()
- //****************************
- {
- try {
- for( ;; ) {
- // Sleep for the specified interval. Then wake up
- // and poll the current list of URLs to see if
- // they've been modified since went to sleep
- sleep( _sleepTime );
- _list.pollURLs();
- }
-
- } catch( InterruptedException e ) {
- }
- }
-
-
- //-------------------------------------------------------------
- // Properties
- //-------------------------------------------------------------
-
-
- /**
- * Returns the poll (sleep) interval
- */
-
- public long getSleepTime()
- //************************
- {
- return _sleepTime;
- }
-
- /**
- * Sets the poll (sleep) interval
- */
-
- public void setSleepTime( long sTime )
- //************************************
- {
- _sleepTime = sTime;
- }
-
- //-------------------------------------------------------------
- // Data
- //-------------------------------------------------------------
-
- static private URLList _list = null;
- static private long _sleepTime = 60000;
-
- }
-