You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-dev@ws.apache.org by sc...@apache.org on 2005/08/04 23:34:21 UTC
svn commit: r227498 -
/webservices/muse/trunk/src/site/content/xdocs/tutorial/mod_service.xml
Author: scamp
Date: Thu Aug 4 14:34:19 2005
New Revision: 227498
URL: http://svn.apache.org/viewcvs?rev=227498&view=rev
Log:
added mount/unmount missing code
Modified:
webservices/muse/trunk/src/site/content/xdocs/tutorial/mod_service.xml
Modified: webservices/muse/trunk/src/site/content/xdocs/tutorial/mod_service.xml
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/site/content/xdocs/tutorial/mod_service.xml?rev=227498&r1=227497&r2=227498&view=diff
==============================================================================
--- webservices/muse/trunk/src/site/content/xdocs/tutorial/mod_service.xml (original)
+++ webservices/muse/trunk/src/site/content/xdocs/tutorial/mod_service.xml Thu Aug 4 14:34:19 2005
@@ -11,14 +11,48 @@
<p>In this step of the tutorial, the generated Service class (<code>FilesystemService</code>) is modified to include an <code>updateOperationalStatus</code> method.
This method updates the <code>OperationalStatus</code> property whenever a <code>Mount</code> or <code>Unmount</code> operation is performed and publishes
a <code>ResourcePropertyValueChangeEvent</code> to the <code>OperationalStatus</code> notification topic. A client that subscribes to the
- <code>OperationalStatus</code> notification topic receives a notification when this property changes.
+ <code>OperationalStatus</code> notification topic receives a notification when this property changes. The <code>mount</code> and <code>unmount</code> methods are implemented to call the <code>updateOperationalStatus</code> method when they are invoked.
</p>
</section>
<section>
<title>Modify the Service Class</title>
<p>Open <code>WORK_DIR/generated/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemService.java</code> and
- add the following method:</p>
+ add/replace the following methods:</p>
<source><![CDATA[
+ public org.apache.ws.resource.example.filesystem.UnmountResponseDocument unmount(org.apache.ws.resource.example.filesystem.UnmountDocument requestDoc)
+ throws org.apache.ws.resource.example.filesystem.MountDeviceBusyFaultException
+ {
+ try
+ {
+ ((FilesystemResource) getResource()).unmount();
+ updateOperationalStatus(org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument.OperationalStatus.UNAVAILABLE);
+ }
+ catch (Exception e)
+ {
+ throw new MountDeviceBusyFaultException(getNamespaceSet(), e.getLocalizedMessage());
+ }
+ org.apache.ws.resource.example.filesystem.UnmountResponseDocument responseDocument = org.apache.ws.resource.example.filesystem.UnmountResponseDocument.Factory.newInstance();
+ org.apache.ws.resource.example.filesystem.UnmountResponseDocument.UnmountResponse response = responseDocument.addNewUnmountResponse();
+ return responseDocument;
+ }
+
+ public org.apache.ws.resource.example.filesystem.MountResponseDocument mount(org.apache.ws.resource.example.filesystem.MountDocument requestDoc)
+ throws org.apache.ws.resource.example.filesystem.MountDeviceBusyFaultException
+ {
+ try
+ {
+ ((FilesystemResource) getResource()).mount();
+ updateOperationalStatus(org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument.OperationalStatus.AVAILABLE);
+ }
+ catch (Exception e)
+ {
+ throw new MountDeviceBusyFaultException(getNamespaceSet(), e.getLocalizedMessage());
+ }
+ org.apache.ws.resource.example.filesystem.MountResponseDocument responseDocument = org.apache.ws.resource.example.filesystem.MountResponseDocument.Factory.newInstance();
+ org.apache.ws.resource.example.filesystem.MountResponseDocument.MountResponse response = responseDocument.addNewMountResponse();
+ return responseDocument;
+ }
+
public void updateOperationalStatus(org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument.OperationalStatus.Enum newStatus)
{
org.apache.ws.notification.base.NotificationProducerResource resource = (org.apache.ws.notification.base.NotificationProducerResource)getResource();
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org