Author: ips Date: Wed Jan 5 14:35:33 2005 New Revision: 124287 URL: http://svn.apache.org/viewcvs?view=rev&rev=124287 Log: various fixes
Modified: incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/BackupFrequencyCallback.java incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/CommentCallback.java incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/FsckPassNumberCallback.java incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/MountPointCallback.java incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/OptionsCallback.java incubator/apollo/trunk/src/site/content/xdocs/tutorial/callback.xml incubator/apollo/trunk/src/site/content/xdocs/tutorial/deploy.xml incubator/apollo/trunk/src/site/content/xdocs/tutorial/home.xml incubator/apollo/trunk/src/site/content/xdocs/tutorial/resource.xml incubator/apollo/trunk/src/site/content/xdocs/tutorial/service.xml incubator/apollo/trunk/src/site/content/xdocs/tutorial/test.xml Modified: incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/BackupFrequencyCallback.java Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/BackupFrequencyCallback.java?view=diff&rev=124287&p1=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/BackupFrequencyCallback.java&r1=124286&p2=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/BackupFrequencyCallback.java&r2=124287 ============================================================================== --- incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/BackupFrequencyCallback.java (original) +++ incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/BackupFrequencyCallback.java Wed Jan 5 14:35:33 2005 @@ -9,9 +9,8 @@ import example.filesystem.backend.FileSystem; - /** - * @author Sal Campana + * A callback for the BackupFrequency resource property. */ public class BackupFrequencyCallback implements SetResourcePropertyCallback { @@ -24,22 +23,19 @@ public void deleteProperty(QName propQName) { - //can't delete! - throw new UnsupportedOperationException("Min Occurs is !, You cannot Delete!"); + return; // no need to implement - Apollo will never call delete for a prop whose minOccurs != 0 } public void insertProperty(Object[] prop) { - for (int i = 0; i < prop.length; i++) - { - XmlInt xInt = (XmlInt) prop[i]; - m_fileSystem.setBackupFrequency(xInt.getIntValue()); - } + return; // no need to implement - Apollo will never call insert for a prop whose minOccurs == its maxOccurs } public void updateProperty(Object[] prop) { - insertProperty(prop); + // BackupFrequency prop has cardinality of 1, so passed array will always have exactly one element + XmlInt xInt = (XmlInt) prop[0]; + m_fileSystem.setBackupFrequency(xInt.getIntValue()); } public ResourceProperty refreshProperty(ResourceProperty prop) Modified: incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/CommentCallback.java Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/CommentCallback.java?view=diff&rev=124287&p1=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/CommentCallback.java&r1=124286&p2=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/CommentCallback.java&r2=124287 ============================================================================== --- incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/CommentCallback.java (original) +++ incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/CommentCallback.java Wed Jan 5 14:35:33 2005 @@ -8,7 +8,7 @@ import javax.xml.namespace.QName; /** - * Callback for the fs:Callback RP. + * A callback for the Comment resource property. */ public class CommentCallback implements SetResourcePropertyCallback { @@ -26,6 +26,7 @@ public void insertProperty( Object[] propElems ) { + // Comment prop has cardinality of 1, so passed array will always have exactly one element XmlString xString = (XmlString) propElems[0]; m_fileSystem.setComment( xString.getStringValue() ); } Modified: incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/FsckPassNumberCallback.java Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/FsckPassNumberCallback.java?view=diff&rev=124287&p1=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/FsckPassNumberCallback.java&r1=124286&p2=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/FsckPassNumberCallback.java&r2=124287 ============================================================================== --- incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/FsckPassNumberCallback.java (original) +++ incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/FsckPassNumberCallback.java Wed Jan 5 14:35:33 2005 @@ -11,7 +11,7 @@ /** - * @author Sal Campana + * A callback for the FsckPassNumber resource property. */ public class FsckPassNumberCallback implements SetResourcePropertyCallback { @@ -24,22 +24,19 @@ public void deleteProperty(QName propQName) { - //can't delete! - throw new UnsupportedOperationException("Min Occurs is !, You cannot Delete!"); + return; // no need to implement - Apollo will never call delete for a prop whose minOccurs != 0 } - public void insertProperty(Object[] prop) + public void insertProperty(Object[] propElems) { - updateProperty(prop); + return; // no need to implement - Apollo will never call insert for a prop whose minOccurs == its maxOccurs } - public void updateProperty(Object[] prop) + public void updateProperty(Object[] propElems) { - for (int i = 0; i < prop.length; i++) - { - XmlInt xInt = (XmlInt) prop[i]; - m_fileSystem.setFsckPassNumber(xInt.getIntValue()); - } + // FsckPassNumber prop has cardinality of 1, so passed array will always have exactly one element + XmlInt xInt = (XmlInt) propElems[0]; + m_fileSystem.setFsckPassNumber(xInt.getIntValue()); } public ResourceProperty refreshProperty(ResourceProperty prop) Modified: incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/MountPointCallback.java Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/MountPointCallback.java?view=diff&rev=124287&p1=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/MountPointCallback.java&r1=124286&p2=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/MountPointCallback.java&r2=124287 ============================================================================== --- incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/MountPointCallback.java (original) +++ incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/MountPointCallback.java Wed Jan 5 14:35:33 2005 @@ -6,9 +6,8 @@ import org.apache.xmlbeans.XmlString; import example.filesystem.backend.FileSystem; - /** - * @author Sal Campana + * A callback for the MountPoint resource property. */ public class MountPointCallback implements ResourcePropertyCallback { @@ -21,7 +20,6 @@ public ResourceProperty refreshProperty(ResourceProperty prop) { - XmlString xString = (XmlString) prop.get( 0 ); xString.setStringValue( m_fileSystem.getMountPoint() ); return prop; Modified: incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/OptionsCallback.java Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/OptionsCallback.java?view=diff&rev=124287&p1=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/OptionsCallback.java&r1=124286&p2=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/OptionsCallback.java&r2=124287 ============================================================================== --- incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/OptionsCallback.java (original) +++ incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/OptionsCallback.java Wed Jan 5 14:35:33 2005 @@ -19,100 +19,101 @@ import org.apache.ws.resource.example.filesystem.OptionsDocument; import org.apache.ws.resource.properties.ResourceProperty; import org.apache.ws.resource.properties.SetResourcePropertyCallback; + import javax.xml.namespace.QName; import java.util.Iterator; import java.util.List; /** - * @author Sal Campana + * A callback for the Options resource property. */ public class OptionsCallback - implements SetResourcePropertyCallback + implements SetResourcePropertyCallback { - /** DOCUMENT_ME */ - FileSystem m_fileSystem; - - /** - * Creates a new [EMAIL PROTECTED] OptionsCallback} object. - * - * @param fileSystem DOCUMENT_ME - */ - public OptionsCallback( FileSystem fileSystem ) - { - m_fileSystem = fileSystem; - } - - /** - * DOCUMENT_ME - * - * @param propQName DOCUMENT_ME - */ - public void deleteProperty( QName propQName ) - { - m_fileSystem.getOptions( ).clear( ); - } - - /** - * DOCUMENT_ME - * - * @param prop DOCUMENT_ME - */ - public void insertProperty( Object[] prop ) - { - updateProperty(prop); - } - - /** - * DOCUMENT_ME - * - * @param prop DOCUMENT_ME - * - * @return DOCUMENT_ME - */ - public ResourceProperty refreshProperty( ResourceProperty prop ) - { - Iterator iterator = prop.iterator( ); - while ( iterator.hasNext( ) ) - { - OptionsDocument.Options o = (OptionsDocument.Options) iterator.next( ); - clearOptionsFromProperty( o ); - - //add current options... - List options = m_fileSystem.getOptions( ); - for ( int i = 0; i < options.size( ); i++ ) - { - o.addOption( options.get( i ).toString( ) ); - } - } - - return prop; - } - - /** - * DOCUMENT_ME - * - * @param prop DOCUMENT_ME - */ - public void updateProperty( Object[] prop ) - { - List backendOptions = m_fileSystem.getOptions( ); - for ( int i = 0; i < prop.length; i++ ) - { - OptionsDocument.Options o = (OptionsDocument.Options) prop[i]; - String[] optionArray = o.getOptionArray( ); - for ( int j = 0; j < optionArray.length; j++ ) - { + /** + * DOCUMENT_ME + */ + FileSystem m_fileSystem; + + /** + * Creates a new [EMAIL PROTECTED] OptionsCallback} object. + * + * @param fileSystem DOCUMENT_ME + */ + public OptionsCallback( FileSystem fileSystem ) + { + m_fileSystem = fileSystem; + } + + /** + * DOCUMENT_ME + * + * @param propQName DOCUMENT_ME + */ + public void deleteProperty( QName propQName ) + { + return; // no need to implement - Apollo will never call delete for a prop whose minOccurs != 0 + } + + /** + * DOCUMENT_ME + * + * @param prop DOCUMENT_ME + */ + public void insertProperty( Object[] prop ) + { + return; // no need to implement - Apollo will never call insert for a prop whose minOccurs == its maxOccurs + } + + /** + * DOCUMENT_ME + * + * @param prop DOCUMENT_ME + * + * @return DOCUMENT_ME + */ + public ResourceProperty refreshProperty( ResourceProperty prop ) + { + Iterator iterator = prop.iterator(); + while ( iterator.hasNext() ) + { + OptionsDocument.Options o = (OptionsDocument.Options) iterator.next(); + clearOptionsFromProperty( o ); + + //add current options... + List options = m_fileSystem.getOptions(); + for ( int i = 0; i < options.size(); i++ ) + { + o.addOption( options.get( i ).toString() ); + } + } + + return prop; + } + + /** + * DOCUMENT_ME + * + * @param prop DOCUMENT_ME + */ + public void updateProperty( Object[] prop ) + { + List backendOptions = m_fileSystem.getOptions(); + // Options prop has cardinality of 1, so passed array will always have exactly one element + OptionsDocument.Options o = (OptionsDocument.Options) prop[0]; + String[] optionArray = o.getOptionArray(); + for ( int j = 0; j < optionArray.length; j++ ) + { backendOptions.add( optionArray[j] ); - } - } - } - - private void clearOptionsFromProperty( OptionsDocument.Options o ) - { - //remove the options... - for ( int i = 0; i < o.sizeOfOptionArray( ); i++ ) - { - o.removeOption( i ); - } - } + } + } + + private void clearOptionsFromProperty( OptionsDocument.Options o ) + { + //remove the options... + for ( int i = 0; i < o.sizeOfOptionArray(); i++ ) + { + o.removeOption( i ); + } + } } Modified: incubator/apollo/trunk/src/site/content/xdocs/tutorial/callback.xml Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/xdocs/tutorial/callback.xml?view=diff&rev=124287&p1=incubator/apollo/trunk/src/site/content/xdocs/tutorial/callback.xml&r1=124286&p2=incubator/apollo/trunk/src/site/content/xdocs/tutorial/callback.xml&r2=124287 ============================================================================== --- incubator/apollo/trunk/src/site/content/xdocs/tutorial/callback.xml (original) +++ incubator/apollo/trunk/src/site/content/xdocs/tutorial/callback.xml Wed Jan 5 14:35:33 2005 @@ -14,9 +14,10 @@ <section id="intro"> <title>Introduction</title> <p>Callback objects provide a means to keep resource properties in synch with the corresponding - state in the backend managed resource. You write callback objects and register them on any - non-static resource properties. The registration is typically done upon initialization of the - Resource class, in its <code>init</code> method. An example of this can be seen in the FileSystemResource.</p> + state in the backend managed resource. You write callback objects and register them on any + non-static resource properties. The registration of callbacks is typically done upon initialization of the + Resource class, in its <code>init</code> method. An example of this can be seen in the + FileSystemResource.</p> <p>There are two interfaces which can be implemented when writing a Callback object. Which one you choose will depend on how you would like each ResourceProperty to behave:</p> <ol> @@ -60,15 +61,18 @@ }</source> <p>In both cases the objects (XmlInt and Options) all extend XmlObject as a common class, however it is useful to utilize the defined class' operations directly.</p> <p>Once you have a handle on the passed-in object, you will need to set the equivalent value, from the current state of your backend, on the passed-in object.</p> - <p>The refreshProperty method is called before GetResourceProperty, GetMultipleResourceProperties and QueryResourceProperties requests.</p> + <p>The refreshProperty method is called by Apollo before servicing GetResourceProperty, GetMultipleResourceProperties and QueryResourceProperties requests.</p> </section> + <section id="setresource"> <title>Implementing the SetResourcePropertyCallback</title> <p>The SetResourcePropertyCallback is a way for the backend to be changed via requests to the front-end resource properties. The SetResourcePropertyCallback interface defines three methods:</p> <source>void deleteProperty( QName propQName ); void insertProperty( Object[] prop ); void updateProperty( Object[] prop );</source> - <p>The operations will follow the same semantics as are defined in the specification and will be restricted to the bounds of you schema. If you define an element with a maxOccurs="1", and attempt to add (insertProperty) another item to it, Apollo will generate a fault.</p> + <p>The operations will follow the same semantics as are defined in the specification and will be restricted to + the bounds of you schema. If you define an element with a maxOccurs="1", and attempt to add (insertProperty) + another item to it, Apollo will generate a fault.</p> <p>The CommentCallback illustrates how these methods <em>may</em> be implemented: </p> @@ -79,6 +83,7 @@ public void insertProperty( Object[] propElems ) { + // Comment prop has cardinality of 1, so passed array will always have exactly one element XmlString xString = (XmlString) propElems[0]; m_fileSystem.setComment( xString.getStringValue() ); } @@ -88,7 +93,9 @@ insertProperty( prop ); } </source> - <p>Notice that the deleteProperty method does nothing since the implementor knew that the method would never be called since the schema forbids it. The updateProperty simply hands-off to the insertProperty since the implementor knew that an update on the backend is the same as an insert. The insertProperty is the workhorse method and takes the Object[], obtains the value from it and sets it on the backend.</p> + <p>Notice that the deleteProperty method does nothing since the implementor knew that the method + would never be called since the schema forbids it. The updateProperty simply hands-off to the + insertProperty since the implementor knew that an update on the backend is the same as an insert. The insertProperty is the workhorse method and takes the Object[], obtains the value from it and sets it on the backend.</p> </section> <section id="register"> Modified: incubator/apollo/trunk/src/site/content/xdocs/tutorial/deploy.xml Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/xdocs/tutorial/deploy.xml?view=diff&rev=124287&p1=incubator/apollo/trunk/src/site/content/xdocs/tutorial/deploy.xml&r1=124286&p2=incubator/apollo/trunk/src/site/content/xdocs/tutorial/deploy.xml&r2=124287 ============================================================================== --- incubator/apollo/trunk/src/site/content/xdocs/tutorial/deploy.xml (original) +++ incubator/apollo/trunk/src/site/content/xdocs/tutorial/deploy.xml Wed Jan 5 14:35:33 2005 @@ -13,16 +13,16 @@ <section> <title>Introduction</title> - <p>This section will discuss how to deploy the Apollo web application into the Tomcat container.</p> + <p>This section will discuss how to deploy the Apollo web application into the Tomcat + container.</p> </section> <section id="deploy"> <title>Deploying the WebApp</title> - <p>Once you have deployed your service to the Apollo webapp, you will need to deploy the webapp to the - Tomcat container.</p> - <p>Deploying to Tomcat entails copying the webapp dir "wsrf" to <code>TOMCAT_HOME/webapps</code> directory. </p> - <note>The directory name under the TOMCAT_HOME/webapps directory denotes the webapp context. - Please ensure after copying, that there is a "wsrf" directory under <code>TOMCAT_HOME/webapps</code></note> + <p>Once you have deployed your service to the Apollo webapp, you will need to deploy + the webapp to the Tomcat container.</p> + <p>Deploying to Tomcat entails copying the <code>wsrf</code> webapp dir and its contents + to the <code>TOMCAT_HOME/webapps</code> directory. </p> </section> </body> Modified: incubator/apollo/trunk/src/site/content/xdocs/tutorial/home.xml Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/xdocs/tutorial/home.xml?view=diff&rev=124287&p1=incubator/apollo/trunk/src/site/content/xdocs/tutorial/home.xml&r1=124286&p2=incubator/apollo/trunk/src/site/content/xdocs/tutorial/home.xml&r2=124287 ============================================================================== --- incubator/apollo/trunk/src/site/content/xdocs/tutorial/home.xml (original) +++ incubator/apollo/trunk/src/site/content/xdocs/tutorial/home.xml Wed Jan 5 14:35:33 2005 @@ -13,13 +13,18 @@ <section id="intro"> <title>Introduction</title> - <p>This section will describe how to write a home for your resource class. 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>This section will describe how to write a home for your resource class. + 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> </section> <section id="class-declaration"> <title>Class Declaration</title> <p>When declaring your "home" you - <strong>should</strong> extend AbstractResourceHome. Extending AbstractResourceHome will provide services for caching instances and looking them up. It will also ensure that the correct interfaces are implemented so that Apollo can interact with your home. + <strong>should</strong> extend AbstractResourceHome. Extending AbstractResourceHome + will provide services for caching instances and looking them up. It will also ensure + that the correct interfaces are implemented so that Apollo can interact with your home. </p> <p>The FileSystemHome extends AbstractResourceHome and implements Serializable:</p> <source>public class FileSystemHome @@ -34,8 +39,8 @@ <source>public Resource getInstance( ResourceContext resourceContext )</source> <p>The getInstance(...) operation provides the ability for you to intercept the request for retrieving an instance. In the FileSystem example, we use the operation to determine - if the requested resource instance is a valid filesystems (i.e. one that is being managed via WSRF); - if it is not, we throw an exception.</p> + if the requested resource instance is a valid filesystems (i.e. one that is being managed + via WSRF); if it is not, we throw an exception.</p> <source>public Resource getInstance( ResourceContext resourceContext ) throws ResourceException, ResourceContextException, Modified: incubator/apollo/trunk/src/site/content/xdocs/tutorial/resource.xml Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/xdocs/tutorial/resource.xml?view=diff&rev=124287&p1=incubator/apollo/trunk/src/site/content/xdocs/tutorial/resource.xml&r1=124286&p2=incubator/apollo/trunk/src/site/content/xdocs/tutorial/resource.xml&r2=124287 ============================================================================== --- incubator/apollo/trunk/src/site/content/xdocs/tutorial/resource.xml (original) +++ incubator/apollo/trunk/src/site/content/xdocs/tutorial/resource.xml Wed Jan 5 14:35:33 2005 @@ -26,19 +26,22 @@ header which contains the resource id. When Apollo receives the request it will use the resource id to look up the corresponding resource instance to service the request.</p> - <p>This section will discuss how to write a resource class. Please note that the eventual - goal will be to generate most of this code for you via code generation. Currently, - however, you will need to write this class by hand.</p> - <p>Initially, you should model your resource off of the included FileSystemResource example. + <p>This section will discuss how to write a resource class. + Initially, you should model your resource off of the included FileSystemResource example. This will ensure you will write a valid resource class.</p> </section> <section id="class-declaration"> <title>Class Declaration</title> - <p>When declaring your Resource class you MUST implement org.apache.ws.resource.Resource which provides the necessary operations for dealing with the ResourcePropertySet and the resource's id. When defining a singleton service</p> - <note>The resource id is a custom WS-Addressing header element which you will define in your configuration information for your service.</note> - <p>Optionally, you may also implement PersistentResource, for providing hooks for persistence, and ScheduledResourceTerminationResource, for adding the ability to schedule when the resource should be terminated.</p> - <p>The FileSystemResource's class declarations is as follows:</p> + <p>When declaring your Resource class you MUST implement org.apache.ws.resource.Resource which + provides the necessary operations for dealing with the ResourcePropertySet and the + resource's id. When defining a singleton service</p> + <note>The resource id is a custom WS-Addressing header element which you will define in your configuration + information for your service.</note> + <p>Optionally, you may also implement PersistentResource, for providing hooks for persistence, + and ScheduledResourceTerminationResource, for adding the ability to schedule when the resource + should be terminated.</p> + <p>The FileSystemResource's class declaration is as follows:</p> <source>public class FileSystemResource extends AbstractFileSystemResource</source> <p>Notice that we've extended a base abstract class. This allows us to focus solely on the init() operation for registering callback objects and initializing the values of our ResourceProperties.</p> @@ -48,8 +51,8 @@ <section id="vars"> <title>Instance Variables</title> <p> The instance variables of AbstractFileSystemResource should include the resource id and the - ResourcePropertySet. The ResourcePropertySet will be the instance of the ResourceProperties - Document associated with this resource instance.</p> + ResourcePropertySet. The ResourcePropertySet is the object representation of the resource + properties document associated with this resource instance.</p> <note>Since it is not a requirement to have resource properties in your service, there is a PropertiesResource interface to denote that properties are being exposed.</note> </section> @@ -60,11 +63,7 @@ getters for the ResourcePropertySet and the resource id. There are also operations which allow you to initialize your resource or destroy your resource (init(..) and destroy()). The operations allow you to do setup, initializing your resource properties, - adding callback objects, and cleanup in your resource class. The exception, seen in the - AbstractFileSystemResource, are the operations for ScheduledResourceTerminationResource - in which we've provided a utility class (ResourcePropertyUtils) to help you implement - these methods.</p> - <note>The use of ResourcePropertyUtils is purely optional and is meant to help the implementor.</note> + adding callback objects, and cleanup in your resource class.</p> </section> </body> Modified: incubator/apollo/trunk/src/site/content/xdocs/tutorial/service.xml Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/xdocs/tutorial/service.xml?view=diff&rev=124287&p1=incubator/apollo/trunk/src/site/content/xdocs/tutorial/service.xml&r1=124286&p2=incubator/apollo/trunk/src/site/content/xdocs/tutorial/service.xml&r2=124287 ============================================================================== --- incubator/apollo/trunk/src/site/content/xdocs/tutorial/service.xml (original) +++ incubator/apollo/trunk/src/site/content/xdocs/tutorial/service.xml Wed Jan 5 14:35:33 2005 @@ -18,10 +18,8 @@ The public methods in the service class correspond to the SOAP operations exposed by your Web service. </p> - <p>This section will discuss how to write a service class. Please note that - the eventual goal will be to generate most of this code for you via code generation. - Currently, however, you will need to implement these classes by hand.</p> - <p>Initially, you should model your service off of the included FileSystemService example. + <p>This section will discuss how to write a service class. + Initially, you should model your service off of the included FileSystemService example. This will ensure you will write a valid service.</p> </section> @@ -41,7 +39,9 @@ <section id="abstract"> <title>The AbstractService class.</title> - <p>The abstract class is the superclass for your service and will contain most of the specification-specific operations and utility operations. Our description of writing the class will be based on the example.filesystem.AbstractFileSystemService class.</p> + <p>The abstract class is the superclass for your service and will contain most of the + specification-specific operations and utility operations. Our description of writing + the class will be based on the example.filesystem.AbstractFileSystemService class.</p> <p>We will describe the class in sections:</p> <ol> <li> @@ -61,7 +61,11 @@ <section id="class-declaration"> <title>Class Declaration</title> <p>When declaring your abstract class, you must implement - <code>org.apache.ws.resource.handler.WsrfService</code>. This interface provides methods for initialization, obtaining the ResourceContext and getting the SoapMethodNameMap use for mapping incoming request QName's to method name for a given object. It basically ensures that Apollo can interact with your service class. + <code>org.apache.ws.resource.handler.WsrfService</code>. This interface provides + methods for initialization, obtaining the ResourceContext and getting the + SoapMethodNameMap used for mapping incoming request QName's to method name + for a given object. It basically ensures that Apollo can interact with your + service class. </p> <p>The AbstractFileSystemService's class declaration is as follows:</p> <source> @@ -74,16 +78,22 @@ ImmediateResourceTerminationPortType, ScheduledResourceTerminationPortType</strong> </source> - <p>You should notice that the class implements WsrfService (described above) and various *PortType inerfaces. Each PortType interface is a Java representation of a specification's WSDL portType declaration. By implementing the PortType interface corresponding to the specification's/portTypes you are interested in, you will ensure you get the correct method signature for the method call. </p> - <note>As per the Web Services Resource 1.2 specification, a resource must expose resource properties and if you expose properties you MUST, at least, implement GetResourceProperty. This means your service must implement the GetResourcePropertyPortType.</note> + <p>You should notice that the class implements WsrfService (described above) and various *PortType + inerfaces. Each PortType interface is a Java representation of a specification's WSDL portType + declaration. By implementing the PortType interface corresponding to the specification's/portTypes + you are interested in, you will ensure you get the correct method signature for the method call. </p> <p>The packages: <strong>org.apache.ws.resource.properties.porttype</strong> and - <strong>org.apache.ws.resource.lifetime.porttype</strong> contain the interfaces for the specifications. You should refer to these packages when selecting the operations you'd like to support. + <strong>org.apache.ws.resource.lifetime.porttype</strong> contain the interfaces for the + specifications. You should refer to these packages when selecting the operations you'd like + to support. </p> </section> <section id="wsrfservice"> <title>WsrfService Interface</title> - <p>All services in Apollo need to implement the WsrfService interface. The interface provides operation "hooks" which will allow Apollo to interact with your service. There are currenty three operations defined by the interface:</p> + <p>All Apollo services must implement the WsrfService interface. The interface provides operation + "hooks" which will allow Apollo to interact with your service. There are currenty three operations defined + by the interface:</p> <source> /** * Returns the SoapMethodNameMap for the Service, to determine * which method to invoke for an incoming request. @@ -105,7 +115,7 @@ public void init( );</source> <p>The getMethodNameMap() returns a SoapMethodNameMap implementation which contains mappings of WSDL operation QNames to Java method names. If you have custom operations you will need to create an instance of ServiceSoapMethodName and add mappings for you operations.</p> <p>The getResourceContext() operation returns the ResourceContext associated with this service. This method may be left abstract in this class and later implemented in the Service extension of your abstract class.</p> - <p>The init() method is provided to give you an opportunity to initialize members for your Service (i.e. ServiceSoapMethodName )</p> + <p>The init() method is provided to give you an opportunity to initialize members for your Service (e.g. ServiceSoapMethodName )</p> </section> <section id="classvars"> <title>Class Variables</title> @@ -155,7 +165,11 @@ } } </source> - <p>XmlBeans will generate strongly-typed objects for the types defined in the schema section of your WSDL document, and these types may be used, however if you are unsure which type will get passed to your operation you can be sure it will be XmlObject since it is the base class for all objects in XmlBeans.</p> + + <p>XmlBeans will generate strongly-typed objects for the types defined in the schema section of + your WSDL document, and these types may be used, however if you are unsure which type will get + passed to your operation, you can be sure it will implement the XmlObject interface, since + all XmlBeans implement this interface.</p> </section> Modified: incubator/apollo/trunk/src/site/content/xdocs/tutorial/test.xml Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/xdocs/tutorial/test.xml?view=diff&rev=124287&p1=incubator/apollo/trunk/src/site/content/xdocs/tutorial/test.xml&r1=124286&p2=incubator/apollo/trunk/src/site/content/xdocs/tutorial/test.xml&r2=124287 ============================================================================== --- incubator/apollo/trunk/src/site/content/xdocs/tutorial/test.xml (original) +++ incubator/apollo/trunk/src/site/content/xdocs/tutorial/test.xml Wed Jan 5 14:35:33 2005 @@ -13,7 +13,7 @@ <section id="intro"> <title>Introduction</title> - <p>This section will describe how to test your service running in the Tomcat container.</p> + <p>This section will describe how to test your service running in the Tomcat servlet container.</p> </section> <section id="start"> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
