Author: jruzzi
Date: Tue Jul 26 14:51:55 2005
New Revision: 225405

URL: http://svn.apache.org/viewcvs?rev=225405&view=rev
Log:
update

Modified:
    webservices/muse/trunk/src/site/content/xdocs/dev_guide/index.xml
    webservices/muse/trunk/src/site/content/xdocs/muws.xml
    webservices/muse/trunk/src/site/content/xdocs/site.xml
    webservices/muse/trunk/src/site/content/xdocs/tutorial/index.xml
    webservices/muse/trunk/src/site/content/xdocs/tutorial/mod_home.xml
    webservices/muse/trunk/src/site/content/xdocs/tutorial/mod_resource.xml
    webservices/muse/trunk/src/site/content/xdocs/tutorial/wsdl.xml

Modified: webservices/muse/trunk/src/site/content/xdocs/dev_guide/index.xml
URL: 
http://svn.apache.org/viewcvs/webservices/muse/trunk/src/site/content/xdocs/dev_guide/index.xml?rev=225405&r1=225404&r2=225405&view=diff
==============================================================================
--- webservices/muse/trunk/src/site/content/xdocs/dev_guide/index.xml (original)
+++ webservices/muse/trunk/src/site/content/xdocs/dev_guide/index.xml Tue Jul 
26 14:51:55 2005
@@ -2,13 +2,69 @@
 <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" 
"http://forrest.apache.org/dtd/document-v20.dtd";>

 <document>

        <header>

-               <title>WSRF Developer Guide</title>

+               <title>MUSE Developer Guide</title>

        </header>

        <body>

                <section>

-                       <title>WSRF Developer Guide</title>

-                       <p>TODO

-                       </p>

+                       <title>About this Guide</title>

+                       <p>The Developer Guide provides instructions for using 
many of the features that are included in MUSE. If you are new to this project, 
you should start 

+                       with the <a href="site:overview">Getting Started</a> 
and the <a href="site:tut">Tutorial</a> before reading this guide. They provide 
a good starting point for 

+                       learning how to use MUSE.</p>

+                       <note>MUSE is tightly integrated with <a 
href="ext:wsrf">Apache WSRF</a> as its WSRF foundation and <a 
href="ext:pubscribe">Apache Pubscribe</a>as its WSN 

+                       foundation. While it is not required, it is a good idea 
to start with Apache WSRF and Apache Pubscribe to learn more about these 
respective foundations. 

+                       You should also consult the Apache WSRF and Apache 
Pubscribe documentation while completing the instructions in this document. All 
of the tasks required in Apache WSRF and 

+                       Apache Pubscribe are also required in MUSE.

+                       </note>

+                       <p>The Developer guide often refers to different parts 
of the <a href="site:wsdm">Web Services Distributed Management (WSDM) 
specifications</a> that are defined by 

+                       the OASIS standards body. You should become familiar 
with these specifications and refer to them as needed.

+                       </p>

+                       <p>The Developer Guide guide often refers to Apache 
WSRF, Apache Pubscribe, Apache Axis, Apache Tomcat, Apache Ant, and Apache 
XMLBeans. Instructions for these 

+                       packages are included as required and are not meant to 
replace the formal documentation for these projects. Consult them as necessary.

+                       </p>

+               </section>

+               <section>

+                       <title>WSDM Overview</title>

+                       <p><a href="site:wsdm">WSDM</a> is defined by the OASIS 
standards body and is comprised of two separate specifcations:

+                       </p>

+                       <ul>

+                               <li>Management using Web Services (MUWS) - MUWS 
defines how to represent and access the manageability interfaces of resources 
as Web services. It is the 

+                               foundation of enabling management applications 
to be built using Web services and allows resources to be managed by many 
managers with one set of instrumentation. This 

+                               specification provides interoperable, base 
manageability for monitoring and control managers using Web services. WSDM MUWS 
is defined in two specifications, 

+                               MUWS Part 1, which defines the base 
architectural concepts and required components, and MUWS Part 2 which defines 
standard composeable support for manageability 

+                               capabilities.</li>

+                               <li>Management of WebServices (MOWS)- MOWS 
defines the manageability model for managing Web services as a resource and how 
to describe and access that 

+                               manageability using MUWS.</li>

+                       </ul>

+                       <p>MUSE is an implementation of both parts of the MUWS 
specification since MOWS is a domain specific implementation of MUWS.</p>

+               </section>

+               <section>

+                       <title>Conceptual Overview</title>

+                       <p>MUSE builds on top of Apache WSRF and Apache 
Pubscribe and provides three deliverables:</p>

+                       <ul>

+                               <li>APIs for MUWS management events, 
relationships, etc.</li>

+                               <li>implementation of the 
QueryRelationshipsByType operation defined by the MUWS specification</li>

+                               <li>an Advertiser service that exposes the 
MUWS-defined ManageableResourceCreation and ManageableResourceDestruction 
topics and publishes notifications to those 

+                               topics whenever any Resource instances are 
added or removed to any deployed MUWS services</li>

+                       </ul>

+                       <p>The MUWS specification defines a capability as a set 
of related operations, properties, and topics that a management resource may 
implement. The specification defines many 

+                       standard capabilities. Most of the standard 
capabilities include properties and/or topics, but not operations. There is 
only one capability that defines any operations, and it only 

+                       defines one. Hence, what Muse primarily provides is not 
implementations of operations, but rather implementations of the 
specification-defined topics that will automatically publish 

+                       notifications when the corresponding situation occurs. 
It also provides helper utility methods that can be used to easily add the 
various MUWS-defined topics to a producer 

+                       resource’s topic set.

+                       </p>

+               </section>

+               <section>

+                       <title>Design-Time</title>

+                       <p>A set of tools and integrations are provided that 
facilitate developing MUWS-compliant Web services. They are provided to help 
developers focus on 

+                       defining their WS Resource and Notification Topics 
without having to deal with low-level implementation details.</p>

+                       <note>These tools and integrations are not required to 
create MUWS-compliant Web services, but are instead provided to save you 
time.</note>

+                       <p>The tools and integrations include:</p>

+                       <ul>

+                               <li>A MUWS WSDL template for writing 
MUWS-compliant WSDLs</li>

+                               <li>A Wsdl2Java tool for generating Java 
Classes from a WSDL.</li>

+                               <li>An integration with Apache XMLBeans for 
generating custom types defined in the WSDL</li>

+                               <li>an integration with Apache Axis for 
automatically deploying WS Resources</li>

+                       </ul>

                </section>

        </body>

 </document>


Modified: webservices/muse/trunk/src/site/content/xdocs/muws.xml
URL: 
http://svn.apache.org/viewcvs/webservices/muse/trunk/src/site/content/xdocs/muws.xml?rev=225405&r1=225404&r2=225405&view=diff
==============================================================================
--- webservices/muse/trunk/src/site/content/xdocs/muws.xml (original)
+++ webservices/muse/trunk/src/site/content/xdocs/muws.xml Tue Jul 26 14:51:55 
2005
@@ -3,7 +3,7 @@
           "http://forrest.apache.org/dtd/document-v20.dtd";>

 <document>

        <header>

-               <title>Management using Web Services (MuWS) 
Specification</title>

+               <title>WSDM Specifications</title>

        </header>

        <body>

                <section>

@@ -13,7 +13,7 @@
        is chartered with defining Web services management. The TC produces two 
specifications:       

       </p>

                        <section>

-                               <title>Management <em>using</em> Web Services 
(MuWS)</title>

+                               <title>Management <em>using</em> Web Services 
(MUWS)</title>

                                <ul>

                                        <li>v1.0, Part 1 (OASIS Standard, 
2005-04-09): 

               [<a 
href="http://docs.oasis-open.org/wsdm/2004/12/wsdm-muws-part1-1.0.pdf";>spec</a>]
 

@@ -22,15 +22,14 @@
               [<a 
href="http://docs.oasis-open.org/wsdm/2004/12/wsdm-muws-part2-1.0.pdf";>spec</a>]
 

               [<a 
href="http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.wsdl";>WSDL</a>]
 

               [<a 
href="http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd";>XSD</a>]</li>

-                               <li>v0.5 (Committee Draft, 2004-04-02): 

+                                       <li>v0.5 (Committee Draft, 2004-04-02): 

               [<a 
href="http://www.oasis-open.org/committees/download.php/6234/cd-wsdm-muws-0.5.pdf";>spec</a>]
 

               [<a 
href="http://docs.oasis-open.org/wsdm/2004/04/muws-0.5/wsdl";>WSDL</a>] 

               [<a 
href="http://docs.oasis-open.org/wsdm/2004/04/muws-0.5/schema";>XSD</a>]</li>

-                                       

                                </ul>

                        </section>

                        <section>

-                               <title>Management <em>of</em> Web Services 
(MoWS)</title>

+                               <title>Management <em>of</em> Web Services 
(MOWS)</title>

                                <ul>

                                        <li>v1.0 (OASIS Standard, 2005-04-09): 

               [<a 
href="http://docs.oasis-open.org/wsdm/2004/12/wsdm-mows-1.0.pdf";>spec</a>] 

@@ -40,18 +39,18 @@
               [<a 
href="http://www.oasis-open.org/apps/org/workgroup/wsdm/download.php/6255/cd-wsdm-mows-0.5-20040402.pdf";>spec</a>]
 

               [<a 
href="http://docs.oasis-open.org/wsdm/2004/04/mows-0.5/wsdl";>WSDL</a>] 

               [<a 
href="http://docs.oasis-open.org/wsdm/2004/04/mows-0.5/schema";>XSD</a>]</li>

-                                                                       </ul>

+                               </ul>

                        </section>

                        <p/>

                        <p>

-       Of the two, MuWS is the core specification (i.e. MoWS is essentially a 
domain-specific application of MuWS:

+       Of the two, MUWS is the core specification (i.e. MOWS is essentially a 
domain-specific application of MUWS:

        management of web services, using Web services).

       </p>

                </section>

                <section>

                        <title>Related Specifications</title>

                        <p>

-       MuWS leverages and builds upon several other Web services 
specifications:

+       MUWS leverages and builds upon several other Web services 
specifications:

       </p>

                        <ul>

                                <li>W3C <a 
href="http://www.w3.org/2002/ws/addr/";>WS-Addressing</a>


Modified: webservices/muse/trunk/src/site/content/xdocs/site.xml
URL: 
http://svn.apache.org/viewcvs/webservices/muse/trunk/src/site/content/xdocs/site.xml?rev=225405&r1=225404&r2=225405&view=diff
==============================================================================
--- webservices/muse/trunk/src/site/content/xdocs/site.xml (original)
+++ webservices/muse/trunk/src/site/content/xdocs/site.xml Tue Jul 26 14:51:55 
2005
@@ -43,10 +43,17 @@
        </tutorial>

        <developer label="Developer Guide" href="dev_guide/" tab="doc">

                <dev label="Overview" href="index.html"/>

+               <compose label="MuWS WSDL" href="wsdl.html"/>

+               <tool label="Using Wsdl2Java" href="wsdl_tool.html"/>

+               <home label="Home Class" href=""/>

+               <producer label="Resource Class" href=""/>

+               <deploy label="Deploying" href="deploy.html"/>

+               <client label="Using the SOAP Client" href="client.html"/>

+               <log label="Logging" href="debug.html"/>

        </developer>

        <projects label="Related Projects">

                <wsrf label="Apache WSRF" href="ext:wsrf/"/>

-               <axis label="Apache Pubscribe" href="ext:pubscribe/"/>

+               <pubscribe label="Apache Pubscribe" href="ext:pubscribe/"/>

                <axis label="Axis" href="ext:axis"/>

                <addressing label="Addressing" href="ext:addressing"/>

                <xmlbeans label="XMLBeans" href="ext:xmlbeans.apache.org"/>

@@ -60,7 +67,11 @@
                <maven.apache.org href="http://maven.apache.org/"/>

                <ws.apache.org href="http://ws.apache.org/";>

                        <wsrf href="wsrf/"/>

+                       <wsrfwsdl href="wsrf/dev_guide/wsrf_wsdl.html"/>

+                       <spec href="wsrf/wsrf.html"/>

                        <pubscribe href="pubscribe/"/>

+                       <pubwsdl href="pubscribe/dev_guide/wsdl.html"/>

+                       <wsn href="pubscribe/wsn.html"/>

                        <mirrors href="mirrors.cgi"/>

                        <axis href="axis/"/>

                        <wsfx href="ws-fx/">


Modified: webservices/muse/trunk/src/site/content/xdocs/tutorial/index.xml
URL: 
http://svn.apache.org/viewcvs/webservices/muse/trunk/src/site/content/xdocs/tutorial/index.xml?rev=225405&r1=225404&r2=225405&view=diff
==============================================================================
--- webservices/muse/trunk/src/site/content/xdocs/tutorial/index.xml (original)
+++ webservices/muse/trunk/src/site/content/xdocs/tutorial/index.xml Tue Jul 26 
14:51:55 2005
@@ -3,7 +3,7 @@
           "http://forrest.apache.org/dtd/document-v20.dtd";>

 <document>

        <header>

-               <title>Apache WSRF Tutorial</title>

+               <title>Apache MUSE Tutorial</title>

        </header>

        <body>

                <section>


Modified: webservices/muse/trunk/src/site/content/xdocs/tutorial/mod_home.xml
URL: 
http://svn.apache.org/viewcvs/webservices/muse/trunk/src/site/content/xdocs/tutorial/mod_home.xml?rev=225405&r1=225404&r2=225405&view=diff
==============================================================================
--- webservices/muse/trunk/src/site/content/xdocs/tutorial/mod_home.xml 
(original)
+++ webservices/muse/trunk/src/site/content/xdocs/tutorial/mod_home.xml Tue Jul 
26 14:51:55 2005
@@ -8,60 +8,48 @@
        <body>

                <section>

                        <title>Introduction</title>

-                       <p>In this step of the tutorial, the generated Home 
classes (<code>FilesystemHome</code> and <code>HostHome</code>) are modified to 
include a 

-                       <code>getInstance</code> method. The Home is used to 
lookup the resource instance. It can act as a factory for creating instances 
upon request, or build all instances. 

-                       It is meant to be the entry point for locating a 
resource instance.

-                       </p>

+                       <p>The Home is used to lookup the resource instance. It 
can act as a factory for creating instances upon request, or build all 
instances. 

+                       It is meant to be the entry point for locating a 
resource instance. In this step of the tutorial, the generated Home classes 
(<code>FilesystemHome</code> and <code>

+                       HostHome</code>) are modified to include an 
<code>init()</code> method.</p>

                </section>

                <section>

                        <title>Modify the FileSytem Home Class</title>

                        <p>Open 
<code>WORK_DIR/generated/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java</code>
 and

-                       replace the <code>public Resource getInstance( 
ResourceContext resourceContext )</code> method with the following method:</p>

-                       <source><![CDATA[    public Resource getInstance( 
ResourceContext resourceContext )

-            throws ResourceException,

-            ResourceContextException,

-            ResourceUnknownException

+                       replace the <code>public void init()</code> method with 
the following method. You will also need to copy the instance variables 
below.</p>

+                       <source><![CDATA[    private static final String 
LVOL1_ID = "/dev/vg00/lvol1";

+    private static final String LVOL2_ID = "/dev/vg00/lvol2";

+

+    /**

+     * Create and add two resource instances.

+     *

+     * @throws Exception on error

+     */

+    public void init() throws Exception

     {

-        ResourceKey key = resourceContext.getResourceKey();

-        FilesystemResource resource = null;

-        try

-        {

-            resource = (FilesystemResource)find( key );

-        }

-        catch ( ResourceException re )

-        {

-            Object id = key.getValue();

-         /**

-          * Determine if the passed-in key is, in fact, something we expect.

-          */

-         if ( id.equals( "/dev/vg00/lvol1" ) || id.equals( "/dev/vg00/lvol2" ) 
)

-         {

-            try

-            {

-               resource = (FilesystemResource)createInstance( key);

-               EndpointReference epr = 
getEndpointReference(resourceContext.getBaseURL(  ) + "/" + 
getServiceName().getLocalPart() , key, 
SPEC_NAMESPACE_SET.getAddressingNamespace());

-               resource.setEndpointReference(epr);

-            }

-            catch ( Exception e )

-            {

-               throw new ResourceException( e );

-            }

-            add( key, resource );

-         }

-         else

-         {

-            throw new ResourceUnknownException( id,

-                  resourceContext.getServiceName() );

-            }

-        }

-        return resource;

+        super.init();

+        FilesystemResource lvol1Resource = (FilesystemResource) 
createInstance( LVOL1_ID );

+        add( lvol1Resource );

+        FilesystemResource lvol2Resource = (FilesystemResource) 
createInstance( LVOL1_ID );

+        add( lvol2Resource );

     }]]></source>

-               </section>

-               <section>

+               </section>

+               <section>

                        <title>Modify the Host Home Class</title>

                        <p>Open 
<code>WORK_DIR/generated/host/src/java/org/apache/ws/resource/example/host/HostHome.java</code>
 and

-                       replace the <code>public Resource getInstance( 
ResourceContext resourceContext )</code> method with the following method:

+                       replace the <code>init()</code> method with the 
following method:

                        </p>

+                       <source><![CDATA[ public void init() throws Exception

+    {

+        super.init();

+        // You may create and add any known resource instances here.

+        //String instance1_id = "00000001";

+        //HostResource instance1 = (HostResource) createInstance( instance1_id 
);

+        //add( instance1_id, instance1 );

+

+        HostResource host = (HostResource) createInstance( null );

+        add( host );

+    }

+                       ]]></source>

                        <p>

                                <img src="images/back.gif" alt="go to the 
previous step"/>

                                <a href="site:wsdl2java">Back</a>


Modified: 
webservices/muse/trunk/src/site/content/xdocs/tutorial/mod_resource.xml
URL: 
http://svn.apache.org/viewcvs/webservices/muse/trunk/src/site/content/xdocs/tutorial/mod_resource.xml?rev=225405&r1=225404&r2=225405&view=diff
==============================================================================
--- webservices/muse/trunk/src/site/content/xdocs/tutorial/mod_resource.xml 
(original)
+++ webservices/muse/trunk/src/site/content/xdocs/tutorial/mod_resource.xml Tue 
Jul 26 14:51:55 2005
@@ -9,156 +9,294 @@
                <section>

                        <title>Introduction</title>

                        <p>In this step of the tutorial, the generated Resource 
classes  (<code>FilesystemResource</code> and <code>HostResource</code>) are 
modified to include an 

-                       <code>init</code> method. The Resource class is the 
stateful instance-representation of a  Web service.The resource maintains the 
resource 

-                       <code>id</code> and the 
<code>ResourcePropertySet</code>. The resource <code>id</code> is the unique 
identifier for an instance of your Web 

-                       service. It allows you to have multiple resource 
instances, each with their own state, fronted by the same Web service. The 
stateful properties are 

-                       represented by the <code>ResourcePropertySet</code>. 
The <code>ResourcePropertySet</code> is the Java representation of the Resource 

-                       Properties document defined in the schema section of 
your WSDL file.

+                       <code>init</code> method as well as several methods for 
the filesystem's custom operations. The Resource class is the stateful 
instance-representation of a 

+                       Web service. The resource maintains the resource 
<code>id</code> and the <code>ResourcePropertySet</code>. The resource 
<code>id</code> is the unique 

+                       identifier for an instance of your Web service. It 
allows you to have multiple resource instances, each with their own state, 
fronted by the same Web service. The 

+                       stateful        properties are represented by the 
<code>ResourcePropertySet</code>. The <code>ResourcePropertySet</code> is the 
Java representation of the 

+                       Resource Properties document defined in the schema 
section of your WSDL file.

                        </p>

-                       <p>If the resource supports notifications, this class 
is also used to expose resource properties as notification topics and register 
the exposed topics.

+                       <p>

+                       The resource class is also used to expose resource 
properties as notification topics and register the exposed topics. This 
includes MUWS specific topics for all 

+                       properties that are defined in the schema section of 
the WSDL.

+                       </p>

+                       <p> 

+                       Lastly, the resource class is used to define any 
relationships this resource has to other resources. 

                        </p>

                </section>

                <section>

                        <title>Modify the FileSystem Resource Class</title>

                        <p>Open 
<code>WORK_DIR/generated/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java</code>
 and

-                       replace the <code>public void init()</code> method with 
the following method:</p>

-                       <source><![CDATA[    public void init()

+                       replace the <code>public void init()</code> method with 
the following methods:</p>

+                       <source><![CDATA[ public void init()

     {

-

         super.init();

 

-      /**

-       * The ResourcePropertySet which contains all the defined 
ResourceProperties

-       */

-      org.apache.ws.resource.properties.ResourcePropertySet 
resourcePropertySet = getResourcePropertySet();

-      org.apache.ws.resource.properties.ResourceProperty resourceProperty = 
null;

+        m_filesystem = new example.filesystem.backend.UnixFileSystem( m_id );

 

+        /*

+         * Add MUWS "capability topics" to the topic set.

+         */

+        ManagementEventTopic identityCapabilityTopic;

+        ManagementEventTopic manageabilityCharacteristicsCapabilityTopic;

+        ManagementEventTopic operationalStatusCapabilityTopic;

+        ManagementEventTopic relationshipsCapabilityTopic;

+        try

+        {

+            TopicSpace muwsTopicSpace = new TopicSpaceImpl( 
MuwsConstants.NSURI_MUWS_PART2_TOPICS );

+            getTopicSpaceSet().addTopicSpace( muwsTopicSpace );

 

+            identityCapabilityTopic = new XmlBeansManagementEventTopicImpl( 
IdentityCapability.TOPIC_NAME );

+            muwsTopicSpace.addTopic( identityCapabilityTopic );

+            manageabilityCharacteristicsCapabilityTopic = new 
XmlBeansManagementEventTopicImpl(

+                    ManageabilityCharacteristicsCapability.TOPIC_NAME );

+            muwsTopicSpace.addTopic( 
manageabilityCharacteristicsCapabilityTopic );

+            operationalStatusCapabilityTopic = new 
XmlBeansManagementEventTopicImpl(

+                    OperationalStatusCapability.TOPIC_NAME );

+            muwsTopicSpace.addTopic( operationalStatusCapabilityTopic );

+            relationshipsCapabilityTopic = new 
XmlBeansManagementEventTopicImpl( RelationshipsCapability.TOPIC_NAME );

+            muwsTopicSpace.addTopic( relationshipsCapabilityTopic );

+        }

+        catch ( Exception e )

+        {

+            throw new RuntimeException( "Failed to add MUWS capability topics 
to topic set of " + this.getClass().getName() + " resource with ID " + getID() 
+ ".", e );

+        }

 

-        /*

-         * This is where you should associate the backend instance with

-         * the resource instance for a given id.

+        org.apache.ws.resource.properties.ResourcePropertySet 
resourcePropertySet = getResourcePropertySet();

+        org.apache.ws.resource.properties.ResourceProperty resourceProperty;

+        try

+        {

+            /*

+                * Initialize each of our properties by calling 
resourceProperty.add(propElem) and/or resourceProperty.setCallback(callback)...

+                */

+            resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.DEVICESPECIALFILE );

+            DeviceSpecialFileDocument deviceDocXBean = 
DeviceSpecialFileDocument.Factory.newInstance();

+            deviceDocXBean.setDeviceSpecialFile( 
m_filesystem.getDeviceSpecialFile() );

+            resourceProperty.add( deviceDocXBean );

+

+            resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.TYPE );

+            TypeDocument typeDocXBean = TypeDocument.Factory.newInstance();

+            typeDocXBean.setType( m_filesystem.getType() );

+            resourceProperty.add( typeDocXBean );

+

+            BackupFrequencyDocument backupDocXBean = 
BackupFrequencyDocument.Factory.newInstance();

+            backupDocXBean.setBackupFrequency( 
m_filesystem.getBackupFrequency() );

+            resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.BACKUPFREQUENCY );

+            resourceProperty.add( backupDocXBean );

+            resourceProperty.setCallback( new 
example.filesystem.callback.BackupFrequencyCallback( m_filesystem ) );

+

+            CommentDocument commentDocXBean = 
CommentDocument.Factory.newInstance();

+            commentDocXBean.setComment( m_filesystem.getComment() );

+            resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.COMMENT );

+            resourceProperty.add( commentDocXBean );

+            resourceProperty.setCallback( new 
example.filesystem.callback.CommentCallback( m_filesystem ) );

+

+            FsckPassNumberDocument fsckDocXBean = 
FsckPassNumberDocument.Factory.newInstance();

+            fsckDocXBean.setFsckPassNumber( m_filesystem.getFsckPassNumber() );

+            resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.FSCKPASSNUMBER );

+            resourceProperty.add( fsckDocXBean );

+            resourceProperty.setCallback( new 
example.filesystem.callback.FsckPassNumberCallback( m_filesystem ) );

+

+            MountPointDirectoryDocument mountPointDocXBean = 
MountPointDirectoryDocument.Factory.newInstance();

+            mountPointDocXBean.setMountPointDirectory( 
m_filesystem.getMountPoint() );

+            resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.MOUNTPOINTDIRECTORY );

+            resourceProperty.add( mountPointDocXBean );

+            resourceProperty.setCallback( new 
example.filesystem.callback.MountPointCallback( m_filesystem ) );

+

+            OptionsDocument optionsDocXBean =

+                    OptionsDocument.Factory.newInstance();

+            org.apache.ws.resource.example.filesystem.OptionsDocument.Options 
options =

+                    optionsDocXBean.addNewOptions();

+            java.util.List backendOptions =

+                    m_filesystem.getOptions();

+            for ( int i = 0; i < backendOptions.size(); i++ )

+            {

+                options.addOption( (String) backendOptions.get( i ) );

+            }

+

+            resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.OPTIONS );

+            resourceProperty.add( optionsDocXBean );

+            resourceProperty.setCallback( new 
example.filesystem.callback.OptionsCallback( m_filesystem ) );

+

+            /*

+             * MUWS-defined properties.

+             */

+            // init the 
{http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd}ResourceId 
resource property

+            resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.RESOURCEID );

+            resourceProperty.setCallback( new 
ResourceIdResourcePropertyCallback( this ) );

+            // NOTE: it's not necessary to add a property change listener, 
since the ResourceId prop is immutable

+

+            // init the 
{http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd}ManageabilityCapability
 resource property

+            resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.MANAGEABILITYCAPABILITY );

+            // add property element for MUWS Identity capability...

+            ManageabilityCapabilityDocument identityCapabilityPropElem = 
ManageabilityCapabilityDocument.Factory.newInstance();

+            identityCapabilityPropElem.setManageabilityCapability( 
IdentityCapability.URI );

+            resourceProperty.add( identityCapabilityPropElem );

+            // add property element for MUWS ManageabilityCharacteristics 
capability...

+            ManageabilityCapabilityDocument 
manageabilityCharacteristicsCapabilityPropElem = 
ManageabilityCapabilityDocument.Factory.newInstance();

+            
manageabilityCharacteristicsCapabilityPropElem.setManageabilityCapability(

+                    ManageabilityCharacteristicsCapability.URI );

+            resourceProperty.add( 
manageabilityCharacteristicsCapabilityPropElem );

+            // add property element for MUWS OperationalStatus capability...

+            ManageabilityCapabilityDocument 
operationalStatusCapabilityPropElem = 
ManageabilityCapabilityDocument.Factory.newInstance();

+            operationalStatusCapabilityPropElem.setManageabilityCapability( 
OperationalStatusCapability.URI );

+            resourceProperty.add( operationalStatusCapabilityPropElem );

+            // add property element for MUWS Relationships capability...

+            ManageabilityCapabilityDocument relationshipsCapabilityPropElem = 
ManageabilityCapabilityDocument.Factory.newInstance();

+            relationshipsCapabilityPropElem.setManageabilityCapability( 
RelationshipsCapability.URI );

+            resourceProperty.add( relationshipsCapabilityPropElem );

+            // NOTE: it's not necessary to add a property change listener, 
since the ManageabilityCapability prop is immutable

+

+            // init the 
{http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd}OperationalStatus
 resource property

+            resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.OPERATIONALSTATUS );

+            resourceProperty.setCallback( new OperationalStatusCallback( 
m_filesystem ) );

+            resourceProperty.addChangeListener( 
operationalStatusCapabilityTopic ); // add for property-value-changed 
management events

+

+            // init the 
{http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd}Relationship 
resource property

+            resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.RELATIONSHIP );

+            
org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipDocument 
prop_relationship = 
org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipDocument.Factory.newInstance();

+            /*

+             * Create the relationship bean...

+             */

+            RelationshipType relationshipType = null;

+            relationshipType = prop_relationship.addNewRelationship();

+            RelationshipTypeType relationshipTypeType = 
relationshipType.addNewType();

+            XmlBeanUtils.addChildElement( relationshipTypeType, new QName( 
"http://myns.com/";, "ContainedBy", "myns" ) );

+

+            RelationshipParticipantType relationshipParticipantType = 
relationshipType.addNewParticipant();

+            ResourceProperty resourceIdProp = resourcePropertySet.get( 
FilesystemPropertyQNames.RESOURCEID );

+            XmlAnyURI resourceId = (XmlAnyURI) resourceIdProp.get( 0 );

+            relationshipParticipantType.setResourceId( 
resourceId.getStringValue() );

+            relationshipParticipantType.setRole( "urn:containee" );

+            // NOTE: the below line assumes that the Filesystem resource's 
EndpointReference field has been initialized

+            EndpointReferenceType filesystemReference = 
(EndpointReferenceType) 
((XmlBeansEndpointReference)getEndpointReference()).getXmlObject( 
Constants.NS_URI_ADDRESSING_2004_08 );

+            
relationshipParticipantType.setManageabilityEndpointReferenceArray( new 
EndpointReferenceType[] { filesystemReference } );

+

+            RelationshipParticipantType relationshipParticipantType2 = 
relationshipType.addNewParticipant();

+            ResourceHome hostHome = (ResourceHome) new InitialContext( 
).lookup( HOST_HOME_LOCATION );

+            PropertiesResource host = (PropertiesResource) hostHome.find( null 
); // host is a singleton resource w/ a null resource identifier

+            resourceIdProp = host.getResourcePropertySet().get( 
IdentityCapability.PROP_NAME_RESOURCE_ID );

+            resourceId = (XmlAnyURI) resourceIdProp.get( 0 );

+            relationshipParticipantType2.setResourceId( 
resourceId.getStringValue() );

+            relationshipParticipantType2.setRole( "urn:container" );

+            // NOTE: the below line assumes that the Host resource's 
EndpointReference field has been initialized

+            EndpointReferenceType hostReference = (EndpointReferenceType) 
((XmlBeansEndpointReference)host.getEndpointReference()).getXmlObject( 
Constants.NS_URI_ADDRESSING_2004_08 );

+            
relationshipParticipantType.setManageabilityEndpointReferenceArray( new 
EndpointReferenceType[] { hostReference } );

+

+            resourceProperty.add( prop_relationship );

+            resourceProperty.addChangeListener( relationshipsCapabilityTopic 
); // add for property-value-changed management events

+        }

+        catch ( Exception e )

+        {

+            throw new RuntimeException( "There was a problem in initializing 
your resource properties.  Please check your init() method. Cause: " +

+                    e.getLocalizedMessage() );

+        }

+        // Resource Property 
{http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd}TerminationTime
 is implemented by the framework.

+        // Resource Property 
{http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd}CurrentTime
 is implemented by the framework.

+        // Resource Property 
{http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}FixedTopicSet
 is implemented by the framework.

+        // Resource Property 
{http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}Topic
 is implemented by the framework.

+        // Resource Property 
{http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}TopicExpressionDialects
 is implemented by the framework.

+

+        /**

+         * This method enables the ResourceTermination Topic for notifications

+         * about this resource's termination.  If you would not like this

+         * behaviour either comment or remove the line of code.

+         */

+        try

+        {

+            
org.apache.ws.notification.topics.util.TopicUtils.addResourceTerminationTopic( 
getTopicSpaceSet(), this,

+                    SPEC_NAMESPACE_SET );

+        }

+        catch ( Exception e )

+        {

+            throw new RuntimeException(

+                    "Unable to init the ResourceTermination topic. Cause: " + 
e.getLocalizedMessage(), e );

+        }

+        /**

+         * This method call will make all resource properties be exposed

+         * as Topics.  If you would like to change that behaviour you can

+         * call TopicUtils.addResourcePropertyValueChangeTopic for each

+         * Topic you'd like to expose property change notifications for.

          */

-        example.filesystem.backend.FileSystem m_fileSystem = new 
example.filesystem.backend.UnixFileSystem( m_id );

+        try

+        {

+            
org.apache.ws.notification.topics.util.TopicUtils.addResourcePropertyValueChangeTopics(

+                    getResourcePropertySet(), getTopicSpaceSet() );

+        }

+        catch ( Exception e )

+        {

+            throw new RuntimeException(

+                    "Unable to init the ResourceProperty Changed topics. 
Cause: " + e.getLocalizedMessage(), e );

+        }

 

-      try{

-        /*

-         * Initialize each of our properties by calling 
resourceProperty.add(propElem) and/or resourceProperty.setCallback(callback)...

+        /**

+         * Initializes the Topic, TopicExpressionDialects and FixedTopicSet 
resource properties

+         *

+         * </br>

+         * <strong>NOTE this MUST be called last in the Resource.init() method 
to ensure all topics get registered</strong>

+         * </br>

+         * FixedTopicSet will be set based on the value returned from the 
[EMAIL PROTECTED] TopicSpaceSet#isFixed()} method.

+         * </br>

+         * Topic will have all root topics in the TopicSpaceSet, set to Simple 
dialect AND all child topics set ot

+         * Concrete dialect.

+         * </br>

+         *

+         * TopicExpressionDialects will be set to the engine's known Topic 
Dialects acquired from the TopicExpressionEngine

+         *

+         * @param topicSpaceSet

+         * @param propSet

          */

-        resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.DEVICESPECIALFILE );

-        DeviceSpecialFileDocument deviceDocXBean = 
DeviceSpecialFileDocument.Factory.newInstance();

-        deviceDocXBean.setDeviceSpecialFile( 
m_fileSystem.getDeviceSpecialFile() );

-        resourceProperty.add( deviceDocXBean );

-

-        resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.TYPE );

-        TypeDocument typeDocXBean = TypeDocument.Factory.newInstance();

-        typeDocXBean.setType( m_fileSystem.getType() );

-        resourceProperty.add( typeDocXBean );

-

-        BackupFrequencyDocument backupDocXBean = 
BackupFrequencyDocument.Factory.newInstance();

-        backupDocXBean.setBackupFrequency( m_fileSystem.getBackupFrequency() );

-        resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.BACKUPFREQUENCY );

-        resourceProperty.add( backupDocXBean );

-        resourceProperty.setCallback( new 
example.filesystem.callback.BackupFrequencyCallback( m_fileSystem ) );

-

-        CommentDocument commentDocXBean = 
CommentDocument.Factory.newInstance();

-        commentDocXBean.setComment( m_fileSystem.getComment() );

-        resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.COMMENT );

-        resourceProperty.add( commentDocXBean );

-        resourceProperty.setCallback( new 
example.filesystem.callback.CommentCallback( m_fileSystem ) );

-

-        FsckPassNumberDocument fsckDocXBean = 
FsckPassNumberDocument.Factory.newInstance();

-        fsckDocXBean.setFsckPassNumber( m_fileSystem.getFsckPassNumber() );

-        resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.FSCKPASSNUMBER );

-        resourceProperty.add( fsckDocXBean );

-        resourceProperty.setCallback( new 
example.filesystem.callback.FsckPassNumberCallback( m_fileSystem ) );

-

-        MountPointDirectoryDocument mountPointDocXBean = 
MountPointDirectoryDocument.Factory.newInstance();

-        mountPointDocXBean.setMountPointDirectory( 
m_fileSystem.getMountPoint() );

-        resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.MOUNTPOINTDIRECTORY );

-        resourceProperty.add( mountPointDocXBean );

-        resourceProperty.setCallback( new 
example.filesystem.callback.MountPointCallback( m_fileSystem ) );

-

-        OptionsDocument optionsDocXBean =

-                OptionsDocument.Factory.newInstance();

-        org.apache.ws.resource.example.filesystem.OptionsDocument.Options 
options =

-                optionsDocXBean.addNewOptions();

-        java.util.List backendOptions =

-                m_fileSystem.getOptions();

-        for ( int i = 0; i < backendOptions.size(); i++ )

-        {

-            options.addOption( (String) backendOptions.get( i ) );

-        }

-

-        resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.OPTIONS );

-        resourceProperty.add( optionsDocXBean );

-        resourceProperty.setCallback( new 
example.filesystem.callback.OptionsCallback( m_fileSystem ) );

-      }

-   catch (Exception e)

-   {

-      throw new javax.xml.rpc.JAXRPCException("There was a problem in 
initializing your resource properties.  Please check your init() method. Cause: 
" + e.getLocalizedMessage());

-   }

-      // Resource Property 
{http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd}TerminationTime
 is implemented by the framework.

-      // Resource Property 
{http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd}CurrentTime
 is implemented by the framework.

-      // Resource Property 
{http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}FixedTopicSet
 is implemented by the framework.

-      // Resource Property 
{http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}Topic
 is implemented by the framework.

-      // Resource Property 
{http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}TopicExpressionDialects
 is implemented by the framework.

-         

-         

-

-   /**

-    * This method enables the ResourceTermination Topic for notifications 

-    * about this resource's termination.  If you would not like this 

-    * behaviour either comment or remove the line of code.

-    */

-   try

-   {

-   
org.apache.ws.notification.topics.util.TopicUtils.addResourceTerminationTopic( 
getTopicSpaceSet(), this, SPEC_NAMESPACE_SET );   

-   }

-   catch (Exception e)

-   {

-   throw new javax.xml.rpc.JAXRPCException("Unable to init the 
ResourceTermination topic. Cause: " + e.getLocalizedMessage(), e);

-   }

-   /**

-    * This method call will make all resource properties be exposed

-    * as Topics.  If you would like to change that behaviour you can 

-    * call TopicUtils.addResourcePropertyValueChangeTopic for each

-    * Topic you'd like to expose property change notifications for.

-    */

-   try

-   {

-   
org.apache.ws.notification.topics.util.TopicUtils.addResourcePropertyValueChangeTopics(
 getResourcePropertySet(), getTopicSpaceSet() ); 

-   }

-   catch (Exception e)

-   {

-   throw new javax.xml.rpc.JAXRPCException("Unable to init the 
ResourceProperty Changed topics. Cause: " + e.getLocalizedMessage(), e);

-   }  

-                

-            /**

-     * Initializes the Topic, TopicExpressionDialects and FixedTopicSet 
resource properties

-     *

-     * </br>

-     * <strong>NOTE this MUST be called last in the Resource.init() method to 
ensure all topics get registered</strong>

-     * </br>

-     * FixedTopicSet will be set based on the value returned from the [EMAIL 
PROTECTED] TopicSpaceSet#isFixed()} method.

-     * </br>

-     * Topic will have all root topics in the TopicSpaceSet, set to Simple 
dialect AND all child topics set ot

-     * Concrete dialect.

-     * </br>

-     *

-     * TopicExpressionDialects will be set to the engine's known Topic 
Dialects acquired from the TopicExpressionEngine

-     *

-     * @param topicSpaceSet

-     * @param propSet

-     */

-        
org.apache.ws.notification.topics.util.TopicUtils.initNotificationProducerProperties(getTopicSpaceSet()
 , getResourcePropertySet());

-  }]]></source>

+        
org.apache.ws.notification.topics.util.TopicUtils.initNotificationProducerProperties(
 getTopicSpaceSet(),

+                getResourcePropertySet() );

+    }

+

+    public void mount() throws Exception

+    {

+        m_filesystem.mount();

+    }

+

+    public void unmount() throws Exception

+    {

+        m_filesystem.unmount();

+    }

+

+    public boolean isMounted()

+    {

+        return m_filesystem.isMounted();

+    }]]></source>

                </section>

                <section>

                        <title>Modify the Host Resource Class</title>

                        <p>Open 
<code>WORK_DIR/generated/host/src/java/org/apache/ws/resource/example/host/HostResource.java</code>
 and

                        replace the <code>public void init()</code> method with 
the following method:

                        </p>

+                       <source><![CDATA[public void init()

+    {

+        super.init();

+

+        /**

+                * The ResourcePropertySet which contains all the defined 
ResourceProperties

+                */

+               org.apache.ws.resource.properties.ResourcePropertySet 
resourcePropertySet = getResourcePropertySet();

+               org.apache.ws.resource.properties.ResourceProperty 
resourceProperty = null;

+

+

+       try{

+               // init the 
{http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd}ResourceId 
resource property

+               resourceProperty = resourcePropertySet.get( 
FilesystemPropertyQNames.RESOURCEID );

+               resourceProperty.setCallback( new 
ResourceIdResourcePropertyCallback( this ) );

+               // NOTE: it's not necessary to add a property change listener, 
since the ResourceId prop is immutable

+

+

+

+               }

+       catch (Exception e)

+       {

+          throw new javax.xml.rpc.JAXRPCException("There was a problem in 
initializing your resource properties.  Please check your init() method. Cause: 
" + e.getLocalizedMessage());

+       }

+

+

+   }]]></source>

+

                        <p>

                                <img src="images/back.gif" alt="go to the 
previous step"/>

                                <a href="site:modhome">Back</a>


Modified: webservices/muse/trunk/src/site/content/xdocs/tutorial/wsdl.xml
URL: 
http://svn.apache.org/viewcvs/webservices/muse/trunk/src/site/content/xdocs/tutorial/wsdl.xml?rev=225405&r1=225404&r2=225405&view=diff
==============================================================================
--- webservices/muse/trunk/src/site/content/xdocs/tutorial/wsdl.xml (original)
+++ webservices/muse/trunk/src/site/content/xdocs/tutorial/wsdl.xml Tue Jul 26 
14:51:55 2005
@@ -18,10 +18,10 @@
                        composing the WSDLs using the template are provided in 
the <a href="site:compose">Developer Guide</a>.

                        </p>

                        <p>Both the FileSystem WSDL and Host WSDL are an 
example of a MUWS WSDL that contains a single portType 

-                       (<code>FileSystemPortType</code> and 
<code>HostPortType</code> respectively). The FileSystem WSDL exposes optional 
portTypes defined by the WSRF-RP, 

+                       (<code>FileSystemPortType</code> and 
<code>HostPortType</code> respectively). The FileSystem WSDL exposes operations 
defined by the WSRF-RP, 

                        WSRF-RL,  WSN-BN, and MUWS. The WSDL also defines two 
custom operations, <code>Mount</code> and <code>Unmount</code>, as well as 
corresponding custom 

-                       resource properties. The Host WSDL is very basic and 
only contains a single operation from WSRF-RP (getResourceProperty). The host 
resource is a simple way 

-                       to show how different resources can be related. Most of 
the interaction with these WS Resources is done through FileSystem.

+                       resource properties. The Host WSDL is very basic and 
only contains a single operation from WSRF-RP (getResourceProperty). The host 
resource is only used to 

+                       demonstrate how different resources can be related. 
Most of the interaction with these WS Resources is done through FileSystem.

                        </p>

                </section>

                <section>




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to