Author: scamp
Date: Fri Jun 10 12:11:54 2005
New Revision: 190008
URL: http://svn.apache.org/viewcvs?rev=190008&view=rev
Log: (empty)
Added:
incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/weatherStation/OpStatusChanger.java
Modified:
incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/weatherStation/WeatherStationService.java
Added:
incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/weatherStation/OpStatusChanger.java
URL:
http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/weatherStation/OpStatusChanger.java?rev=190008&view=auto
==============================================================================
---
incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/weatherStation/OpStatusChanger.java
(added)
+++
incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/weatherStation/OpStatusChanger.java
Fri Jun 10 12:11:54 2005
@@ -0,0 +1,44 @@
+package org.wsdmdemo.service.weatherStation;
+
+import
org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument;
+
+
+/**
+ * @author Sal Campana
+ */
+public class OpStatusChanger implements Runnable
+{
+ private WeatherStationService m_weatherStation;
+
+
+ public OpStatusChanger(WeatherStationService weatherStationService)
+ {
+ m_weatherStation = weatherStationService;
+ }
+
+ /**
+ * When an object implementing interface <code>Runnable</code> is used
+ * to create a thread, starting the thread causes the object's
+ * <code>run</code> method to be called in that separately executing
+ * thread.
+ * <p/>
+ * The general contract of the method <code>run</code> is that it may
+ * take any action whatsoever.
+ *
+ * @see Thread#run()
+ */
+ public void run()
+ {
+ try
+ {
+ Thread.sleep(60000);
+ }
+ catch (InterruptedException e)
+ {
+ ;
+ }
+
+
m_weatherStation.changeOperationalStatus(OperationalStatusDocument.OperationalStatus.AVAILABLE);
+
+ }
+}
Modified:
incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/weatherStation/WeatherStationService.java
URL:
http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/weatherStation/WeatherStationService.java?rev=190008&r1=190007&r2=190008&view=diff
==============================================================================
---
incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/weatherStation/WeatherStationService.java
(original)
+++
incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/weatherStation/WeatherStationService.java
Fri Jun 10 12:11:54 2005
@@ -58,6 +58,10 @@
//set status to unavailable
changeOperationalStatus(OperationalStatusDocument.OperationalStatus.UNAVAILABLE);
//todo spawn thread with timer to reset the op status to avail
+
+ Thread thread = new Thread(new OpStatusChanger(this));
+ thread.start();
+
return responseDocument;
}
@@ -66,7 +70,7 @@
*
* @param status
*/
- private void
changeOperationalStatus(OperationalStatusDocument.OperationalStatus.Enum status)
+ public void
changeOperationalStatus(OperationalStatusDocument.OperationalStatus.Enum status)
{
SetResourcePropertiesPortTypeImpl setResourcePropertiesPortType = new
SetResourcePropertiesPortTypeImpl(getResourceContext());
SetResourcePropertiesDocument setResourcePropertiesDocument =
SetResourcePropertiesDocument.Factory.newInstance();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]