Return-Path: Delivered-To: apmail-ws-pubscribe-commits-archive@www.apache.org Received: (qmail 78080 invoked from network); 12 Jul 2005 23:21:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Jul 2005 23:21:13 -0000 Received: (qmail 96845 invoked by uid 500); 12 Jul 2005 23:21:13 -0000 Delivered-To: apmail-ws-pubscribe-commits-archive@ws.apache.org Received: (qmail 96825 invoked by uid 500); 12 Jul 2005 23:21:13 -0000 Mailing-List: contact pubscribe-commits-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: pubscribe-dev@ws.apache.org Delivered-To: mailing list pubscribe-commits@ws.apache.org Received: (qmail 96809 invoked by uid 500); 12 Jul 2005 23:21:13 -0000 Delivered-To: apmail-ws-pubscribe-cvs@ws.apache.org Received: (qmail 96787 invoked by uid 99); 12 Jul 2005 23:21:12 -0000 X-ASF-Spam-Status: No, hits=-9.3 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 12 Jul 2005 16:20:58 -0700 Received: (qmail 78014 invoked by uid 65534); 12 Jul 2005 23:20:55 -0000 Message-ID: <20050712232055.78009.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r216047 [1/2] - in /webservices/pubscribe/trunk/src/examples/filesystem: ./ epr/ lib/ requests/ src/ src/java/ src/java/example/ src/java/example/filesystem/ src/java/example/filesystem/backend/ src/java/example/filesystem/callback/ src/jav... Date: Tue, 12 Jul 2005 23:20:50 -0000 To: pubscribe-cvs@ws.apache.org From: jruzzi@apache.org X-Mailer: svnmailer-1.0.2 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jruzzi Date: Tue Jul 12 16:20:48 2005 New Revision: 216047 URL: http://svn.apache.org/viewcvs?rev=216047&view=rev Log: moved from tutorial Added: webservices/pubscribe/trunk/src/examples/filesystem/ webservices/pubscribe/trunk/src/examples/filesystem/build.properties webservices/pubscribe/trunk/src/examples/filesystem/build.xml webservices/pubscribe/trunk/src/examples/filesystem/epr/ webservices/pubscribe/trunk/src/examples/filesystem/epr/filesystem.txt webservices/pubscribe/trunk/src/examples/filesystem/lib/ webservices/pubscribe/trunk/src/examples/filesystem/lib/FileSystem-xbeans.jar (with props) webservices/pubscribe/trunk/src/examples/filesystem/notifproducer.jsp webservices/pubscribe/trunk/src/examples/filesystem/requests/ webservices/pubscribe/trunk/src/examples/filesystem/requests/BadGetCurrentMessage.soap webservices/pubscribe/trunk/src/examples/filesystem/requests/GetCurrentMessage.soap webservices/pubscribe/trunk/src/examples/filesystem/requests/Pause_Subscription.soap webservices/pubscribe/trunk/src/examples/filesystem/requests/Resume_Subscription.soap webservices/pubscribe/trunk/src/examples/filesystem/requests/SetResourceProperties_updateMountPointProp.soap webservices/pubscribe/trunk/src/examples/filesystem/requests/Subscribe_updateMountPointProp.soap webservices/pubscribe/trunk/src/examples/filesystem/requests/_TEMPLATE.soap webservices/pubscribe/trunk/src/examples/filesystem/soapclient.xml webservices/pubscribe/trunk/src/examples/filesystem/src/ webservices/pubscribe/trunk/src/examples/filesystem/src/java/ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/NotifRequestUtils.java webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/CommentCallback.java webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/FsckPassNumberCallback.java webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/MountPointCallback.java webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OptionsCallback.java webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemPropertyQNames.java webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemService.java webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_deploy.wsdd webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_jndi-config.xml webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/MountDeviceBusyFaultException.java webservices/pubscribe/trunk/src/examples/filesystem/src/wsdl/ webservices/pubscribe/trunk/src/examples/filesystem/src/wsdl/FileSystem.wsdl Added: webservices/pubscribe/trunk/src/examples/filesystem/build.properties URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/build.properties?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/build.properties (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/build.properties Tue Jul 12 16:20:48 2005 @@ -0,0 +1,13 @@ +# **** NOTE: This file will not be overwritten during generation **** + +endpoint.url = http://localhost:8080/pubscribe/services/filesystem + +# Uncomment and modify the below lines if you would like to deploy to a +# webapp located somewhere other than the default location of +# ../webapps/hermes (e.g. \${env.CATALINA_HOME}/webapps/pubscribe ) +pubscribe.webapp.dir =${env.CATALINA_HOME}/webapps/pubscribe + +# Uncomment and modify the below lines if you require a proxy to connect to external web sites +#http.proxyHost = proxy.xyz.com +#http.proxyPort = 8088 +#http.nonProxyHosts = localhost Added: webservices/pubscribe/trunk/src/examples/filesystem/build.xml URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/build.xml?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/build.xml (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/build.xml Tue Jul 12 16:20:48 2005 @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + Using webapp dir: ${pubscribe.webapp.dir} + + + + + + + + + + + + + + + + + + + + + + + Deploying filesystem classes to ${pubscribe.webapp.dir}/WEB-INF/classes/... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: webservices/pubscribe/trunk/src/examples/filesystem/epr/filesystem.txt URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/epr/filesystem.txt?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/epr/filesystem.txt (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/epr/filesystem.txt Tue Jul 12 16:20:48 2005 @@ -0,0 +1,9 @@ + + + +
http://localhost:9081/pubscribe/services/Filesystem
+ + /dev/vg00/lvol1 + +
+ Added: webservices/pubscribe/trunk/src/examples/filesystem/lib/FileSystem-xbeans.jar URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/lib/FileSystem-xbeans.jar?rev=216047&view=auto ============================================================================== Binary file - no diff available. Propchange: webservices/pubscribe/trunk/src/examples/filesystem/lib/FileSystem-xbeans.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: webservices/pubscribe/trunk/src/examples/filesystem/notifproducer.jsp URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/notifproducer.jsp?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/notifproducer.jsp (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/notifproducer.jsp Tue Jul 12 16:20:48 2005 @@ -0,0 +1,61 @@ + +<%@ page import="example.NotifRequestUtils "%> + +<% + if(request.getParameter("page") == null) + { +%> + + + +Producer Resource Gui + + +

Producer Resource Gui

+
+This form will trigger a ResourcePropertyChangedNotification on a Producer Resource's Simple-Type Resource Property. Modify the Comment Message and click the button to trigger the event. +

Notification Producer EPR URL (a file on a URL which contains the 2004/08 EPR XML):

+

Simple-Type Property to be Changed (Note: Must be in format usable from QName.valueOf(..) see example in textfield):

+

Value to be Changed:

+

+

+ +
+ + + +<% +} +else +{ + boolean bool = NotifRequestUtils.invokeSetResourceProperty(request.getParameter( "prop" ), request.getParameter("msg") ,request.getParameter( "serviceurl" )); + %> + + +Producer Resource Gui + + +

Producer Resource Gui

+ <% + if(!bool) + { + out.println("Invoke prop change failed!"); + } + + else + { + out.println("Invoke prop change was successful!"); + } + %> + +
+

+

+
+ + +<% + +} +%> + Added: webservices/pubscribe/trunk/src/examples/filesystem/requests/BadGetCurrentMessage.soap URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/requests/BadGetCurrentMessage.soap?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/requests/BadGetCurrentMessage.soap (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/requests/BadGetCurrentMessage.soap Tue Jul 12 16:20:48 2005 @@ -0,0 +1,17 @@ + + +
+ http://localhost:8080/pubscribe/services/filesystem + http://ws.apache.org/resource/example/filesystem/FileSystemPortType/yourWsdlRequestName + /dev/vg00/lvol1 +
+ + + + fs:foo + + + +
Added: webservices/pubscribe/trunk/src/examples/filesystem/requests/GetCurrentMessage.soap URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/requests/GetCurrentMessage.soap?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/requests/GetCurrentMessage.soap (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/requests/GetCurrentMessage.soap Tue Jul 12 16:20:48 2005 @@ -0,0 +1,17 @@ + + +
+ http://localhost:8080/pubscribe/services/filesystem + http://ws.apache.org/resource/example/filesystem/FileSystemPortType/yourWsdlRequestName + /dev/vg00/lvol1 +
+ + + + fs:MountPointDirectory + + + +
Added: webservices/pubscribe/trunk/src/examples/filesystem/requests/Pause_Subscription.soap URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/requests/Pause_Subscription.soap?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/requests/Pause_Subscription.soap (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/requests/Pause_Subscription.soap Tue Jul 12 16:20:48 2005 @@ -0,0 +1,15 @@ + + +
+ http://localhost:8080/pubscribe/services/SubscriptionManager + http://localhost:8080/pubscribe/services/SubscriptionManager/yourWsdlRequestName + 4623a820-7483-11d9-9a53-fe396408008d +
+ + + + + +
Added: webservices/pubscribe/trunk/src/examples/filesystem/requests/Resume_Subscription.soap URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/requests/Resume_Subscription.soap?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/requests/Resume_Subscription.soap (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/requests/Resume_Subscription.soap Tue Jul 12 16:20:48 2005 @@ -0,0 +1,15 @@ + + +
+ http://localhost:8080/pubscribe/services/SubscriptionManager + http://localhost:8080/pubscribe/services/SubscriptionManager/yourWsdlRequestName + 4623a820-7483-11d9-9a53-fe396408008d +
+ + + + + +
Added: webservices/pubscribe/trunk/src/examples/filesystem/requests/SetResourceProperties_updateMountPointProp.soap URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/requests/SetResourceProperties_updateMountPointProp.soap?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/requests/SetResourceProperties_updateMountPointProp.soap (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/requests/SetResourceProperties_updateMountPointProp.soap Tue Jul 12 16:20:48 2005 @@ -0,0 +1,18 @@ + + +
+ http://localhost:8080/pubscribe/services/filesystem + http://ws.apache.org/resource/example/filesystem/FileSystemPortType/yourWsdlRequestName + /dev/vg00/lvol1 +
+ + + + + /var/tmp/foo + + + + +
Added: webservices/pubscribe/trunk/src/examples/filesystem/requests/Subscribe_updateMountPointProp.soap URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/requests/Subscribe_updateMountPointProp.soap?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/requests/Subscribe_updateMountPointProp.soap (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/requests/Subscribe_updateMountPointProp.soap Tue Jul 12 16:20:48 2005 @@ -0,0 +1,29 @@ + + +
+ http://localhost:8080/pubscribe/services/filesystem + http://ws.apache.org/resource/example/filesystem/FileSystemPortType/yourWsdlRequestName + /dev/vg00/lvol1 +
+ + + + + + + http://localhost:8080/pubscribe/services/filesystem + + + + fs:MountPointDirectory + + true + + + + +
Added: webservices/pubscribe/trunk/src/examples/filesystem/requests/_TEMPLATE.soap URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/requests/_TEMPLATE.soap?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/requests/_TEMPLATE.soap (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/requests/_TEMPLATE.soap Tue Jul 12 16:20:48 2005 @@ -0,0 +1,14 @@ + + +
+ http://localhost:8080/wsrf/services/filesystem + http://ws.apache.org/resource/example/filesystem/FileSystemPortType/yourWsdlRequestName + /dev/vg00/lvol1 +
+ + + + + +
Added: webservices/pubscribe/trunk/src/examples/filesystem/soapclient.xml URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/soapclient.xml?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/soapclient.xml (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/soapclient.xml Tue Jul 12 16:20:48 2005 @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + Using webapp dir: ${pubscribe.webapp.dir} + + + + + + + + + + + + + + + + Reading SOAP request from: ${xml} ,,, + + + + + + Sending SOAP request to ${url} ... + + ========================== REQUEST ============================ + + + ========================== RESPONSE ============================ + + + + + + + + + + + + + + Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/NotifRequestUtils.java URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/NotifRequestUtils.java?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/NotifRequestUtils.java (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/NotifRequestUtils.java Tue Jul 12 16:20:48 2005 @@ -0,0 +1,158 @@ +package example; + +import org.apache.axis.message.addressing.Constants; +import org.apache.ws.XmlObjectWrapper; +import org.apache.ws.addressing.EndpointReference; +import org.apache.ws.addressing.XmlBeansEndpointReference; +import org.apache.ws.util.XmlBeanUtils; +import org.apache.ws.util.soap.SoapClient; +import org.apache.xmlbeans.XmlObject; +import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.SetResourcePropertiesDocument; +import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.SetResourcePropertiesResponseDocument; +import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.UpdateType; +import org.xmlsoap.schemas.soap.envelope.Envelope; +import org.xmlsoap.schemas.soap.envelope.EnvelopeDocument; +import org.xmlsoap.schemas.soap.envelope.Header; +import org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceDocument; + +import javax.xml.namespace.QName; +import java.net.URI; +import java.net.URL; + + +/** + * @author Sal Campana + */ +public class NotifRequestUtils +{ + public static XmlObject sendRequest(XmlObject requestDoc, String action, EndpointReference epr) + { + EnvelopeDocument requestEnvelopeDoc = createEnvelope(); + Envelope requestEnvelope = requestEnvelopeDoc.getEnvelope(); + addAddressingHeaders(requestEnvelope.getHeader(), action, epr); + XmlBeanUtils.addChildElement(requestEnvelope.getBody(), requestDoc); + try + { + URL endpointURL = new URL(epr.getAddress()); + System.out.println("Sending Request to " + endpointURL.toString()); + URI actionURI = new URI(action); + String response = SoapClient.sendRequest(endpointURL, requestEnvelopeDoc.newInputStream(), actionURI); + EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse(response); + Envelope responseEnvelope = responseEnvelopeDoc.getEnvelope(); + XmlObject[] responseBodyElems = XmlBeanUtils.getChildElements(responseEnvelope.getBody()); + System.out.println("Recieved response from " + endpointURL.toString()); + if (responseBodyElems.length == 0) + { + return null; + } + else + { + return responseBodyElems[0]; + } + + } + catch (Exception e) + { + System.out.println("An Exception Occurred!"); + e.printStackTrace(); + throw new RuntimeException(e); + } + } + + public static boolean invokeSetResourceProperty(String prop, String value, String filesystemEPRUrl) + { + SetResourcePropertiesDocument setResourcePropertiesDocument = SetResourcePropertiesDocument.Factory.newInstance(); + SetResourcePropertiesDocument.SetResourceProperties setResourceProperties = setResourcePropertiesDocument.addNewSetResourceProperties(); + UpdateType updateType = UpdateType.Factory.newInstance(); + + XmlObject simpleType = XmlBeanUtils.addChildElement(updateType, QName.valueOf(prop)); + XmlBeanUtils.setValue(simpleType, value); + setResourceProperties.setUpdateArray(new UpdateType[]{updateType}); + + XmlObject xmlObject = sendRequest(setResourcePropertiesDocument, "http://SetResourceProperties", createEpr(filesystemEPRUrl)); + if (xmlObject instanceof SetResourcePropertiesResponseDocument.SetResourcePropertiesResponse) + { + return true; + } + else + { + System.out.println("The returned XmlObject from SetResourcePropertiesRequest for Comment: " + xmlObject.toString()); + return false; + } + } + + private static EndpointReference createEpr(String filesystemUrl) + { + XmlBeansEndpointReference epr = null; + try + { + EndpointReferenceDocument eprdoc = (EndpointReferenceDocument) XmlObject.Factory.parse(new URL(filesystemUrl)); + epr = new XmlBeansEndpointReference(eprdoc.getEndpointReference()); + } + catch (Exception e) + { + e.printStackTrace(); + } + + return epr; + } + + private static EnvelopeDocument createEnvelope() + { + EnvelopeDocument envelopeDoc = EnvelopeDocument.Factory.newInstance(); + Envelope envelope = envelopeDoc.addNewEnvelope(); + envelope.addNewHeader(); + envelope.addNewBody(); + return envelopeDoc; + } + + private static void addAddressingHeaders(Header header, String action, EndpointReference epr) + { + XmlObject eprXBean = ((XmlObjectWrapper) epr).getXmlObject(); + XmlObject toElem; + XmlObject actionElem; + if (eprXBean.schemaType().getName().getNamespaceURI().equals(Constants.NS_URI_ADDRESSING_2003_03)) + { + org.xmlsoap.schemas.ws.x2003.x03.addressing.ToDocument toDoc = org.xmlsoap.schemas.ws.x2003.x03.addressing.ToDocument.Factory.newInstance(); + org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI attributedURI = toDoc.addNewTo(); + attributedURI.setStringValue(epr.getAddress()); + toElem = toDoc; + org.xmlsoap.schemas.ws.x2003.x03.addressing.ActionDocument actionDoc = org.xmlsoap.schemas.ws.x2003.x03.addressing.ActionDocument.Factory.newInstance(); + org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI actionType = actionDoc.addNewAction(); + actionType.setStringValue(action); + actionElem = actionDoc; + } + else + { + org.xmlsoap.schemas.ws.x2004.x08.addressing.ToDocument toDoc = org.xmlsoap.schemas.ws.x2004.x08.addressing.ToDocument.Factory.newInstance(); + org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI attributedURI = toDoc.addNewTo(); + attributedURI.setStringValue(epr.getAddress()); + toElem = toDoc; + org.xmlsoap.schemas.ws.x2004.x08.addressing.ActionDocument actionDoc = org.xmlsoap.schemas.ws.x2004.x08.addressing.ActionDocument.Factory.newInstance(); + org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI actionType = actionDoc.addNewAction(); + actionType.setStringValue(action); + actionElem = actionDoc; + } + XmlBeanUtils.addChildElement(header, toElem); + XmlBeanUtils.addChildElement(header, actionElem); + XmlBeansEndpointReference newepr = null; + if (eprXBean.schemaType().getName().getNamespaceURI().equals(Constants.NS_URI_ADDRESSING_2003_03)) + { + newepr = new XmlBeansEndpointReference((org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType) eprXBean); + } + else + { + newepr = new XmlBeansEndpointReference((org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType) eprXBean); + } + if (newepr.getReferenceProperties() != null) + { + XmlObject[] refPropElems = (XmlObject[]) newepr.getReferenceProperties(); + for (int i = 0; i < refPropElems.length; i++) + { + XmlBeanUtils.addChildElement(header, refPropElems[i]); + } + } + } + + +} Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java Tue Jul 12 16:20:48 2005 @@ -0,0 +1,33 @@ +package example.filesystem.backend; + +import java.util.List; + +/** + * @author Sal Campana + */ +public interface FileSystem +{ + String getDeviceSpecialFile(); + + String getMountPoint(); + + void setMountPoint(String mountDir); + + String getType(); + + int getBackupFrequency(); + + void setBackupFrequency(int backupFrequency); + + List getOptions(); + + void setOptions(List options); + + String getComment(); + + void setComment(String comment); + + int getFsckPassNumber(); + + void setFsckPassNumber(int fsckPassNumber); +} Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java Tue Jul 12 16:20:48 2005 @@ -0,0 +1,87 @@ +package example.filesystem.backend; + +import java.util.List; +import java.util.ArrayList; + + +/** + * This is a mock filesystem to act as the backend for the example FileSystemService + * + * @author Sal Campana + */ +public class UnixFileSystem implements FileSystem +{ + + private String m_mountPoint="/usr"; + private String m_type = "vxfs"; + private int m_backupFrequency=0; + private int m_fsckPassNumber=2; + private List m_options; + private String m_comment="user files"; + private String m_deviceSpecialFile = "/dev/vg00/lvol7"; + + public UnixFileSystem(String devicePath) + { + m_deviceSpecialFile = devicePath; + m_options = new ArrayList(); + m_options.add("delaylog"); + m_options.add("quota"); + } + + public String getDeviceSpecialFile() + { + return m_deviceSpecialFile; + } + public String getMountPoint() + { + return m_mountPoint; + } + public void setMountPoint(String mountDir) + { + m_mountPoint=mountDir; + } + public String getType() + { + return m_type; + } + + public int getBackupFrequency() + { + return m_backupFrequency; + } + + public void setBackupFrequency(int backupFrequency) + { + m_backupFrequency = backupFrequency; + } + + public List getOptions() + { + return m_options; + } + + public void setOptions(List options) + { + m_options = options; + } + + public String getComment() + { + return m_comment; + } + + public void setComment(String comment) + { + m_comment = comment; + } + + public int getFsckPassNumber() + { + return m_fsckPassNumber; + } + + public void setFsckPassNumber(int fsckPassNumber) + { + m_fsckPassNumber = fsckPassNumber; + } +} Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java Tue Jul 12 16:20:48 2005 @@ -0,0 +1,48 @@ +package example.filesystem.callback; + +import org.apache.ws.resource.properties.SetResourcePropertyCallback; +import org.apache.ws.resource.properties.ResourceProperty; +import org.apache.ws.resource.properties.impl.CallbackFailedException; +import org.apache.ws.resource.example.filesystem.BackupFrequencyDocument; +import org.apache.xmlbeans.XmlInt; + +import javax.xml.namespace.QName; + +import example.filesystem.backend.FileSystem; + +/** + * A callback for the BackupFrequency resource property. + */ +public class BackupFrequencyCallback implements SetResourcePropertyCallback +{ + FileSystem m_fileSystem; + + public BackupFrequencyCallback(FileSystem fileSystem) + { + m_fileSystem = fileSystem; + } + + public void deleteProperty(QName propQName) throws CallbackFailedException + { + return; // no need to implement - WSRF will never call delete for a prop whose minOccurs != 0 + } + + public void insertProperty(Object[] prop) throws CallbackFailedException + { + return; // no need to implement - WSRF will never call insert for a prop whose minOccurs == its maxOccurs + } + + public void updateProperty(Object[] prop) throws CallbackFailedException + { + // 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) throws CallbackFailedException + { + XmlInt xInt = (XmlInt) prop.get( 0 ); + xInt.setIntValue( m_fileSystem.getBackupFrequency() ); + return prop; + } +} Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/CommentCallback.java URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/CommentCallback.java?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/CommentCallback.java (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/CommentCallback.java Tue Jul 12 16:20:48 2005 @@ -0,0 +1,46 @@ +package example.filesystem.callback; + +import example.filesystem.backend.FileSystem; +import org.apache.ws.resource.properties.ResourceProperty; +import org.apache.ws.resource.properties.SetResourcePropertyCallback; +import org.apache.ws.resource.properties.impl.CallbackFailedException; +import org.apache.xmlbeans.XmlString; + +import javax.xml.namespace.QName; + +/** + * A callback for the Comment resource property. + */ +public class CommentCallback implements SetResourcePropertyCallback +{ + FileSystem m_fileSystem; + + public CommentCallback( FileSystem fileSystem ) + { + m_fileSystem = fileSystem; + } + + public void deleteProperty( QName propQName ) throws CallbackFailedException + { + return; // no need to implement - WSRF will never call delete for a prop whose minOccurs != 0 + } + + public void insertProperty( Object[] propElems ) throws CallbackFailedException + { + // 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() ); + } + + public void updateProperty( Object[] prop ) throws CallbackFailedException + { + insertProperty( prop ); + } + + public ResourceProperty refreshProperty( ResourceProperty prop ) throws CallbackFailedException + { + XmlString xString = (XmlString) prop.get( 0 ); + xString.setStringValue( m_fileSystem.getComment() ); + return prop; + } +} Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/FsckPassNumberCallback.java URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/FsckPassNumberCallback.java?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/FsckPassNumberCallback.java (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/FsckPassNumberCallback.java Tue Jul 12 16:20:48 2005 @@ -0,0 +1,49 @@ +package example.filesystem.callback; + +import org.apache.ws.resource.properties.SetResourcePropertyCallback; +import org.apache.ws.resource.properties.ResourceProperty; +import org.apache.ws.resource.properties.impl.CallbackFailedException; +import org.apache.ws.resource.example.filesystem.FsckPassNumberDocument; +import org.apache.xmlbeans.XmlInt; + +import javax.xml.namespace.QName; + +import example.filesystem.backend.FileSystem; + + +/** + * A callback for the FsckPassNumber resource property. + */ +public class FsckPassNumberCallback implements SetResourcePropertyCallback +{ + FileSystem m_fileSystem; + + public FsckPassNumberCallback(FileSystem fileSystem) + { + m_fileSystem = fileSystem; + } + + public void deleteProperty(QName propQName) throws CallbackFailedException + { + return; // no need to implement - WSRF will never call delete for a prop whose minOccurs != 0 + } + + public void insertProperty(Object[] propElems) throws CallbackFailedException + { + return; // no need to implement - WSRF will never call insert for a prop whose minOccurs == its maxOccurs + } + + public void updateProperty(Object[] propElems) throws CallbackFailedException + { + // 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) throws CallbackFailedException + { + XmlInt xInt = (XmlInt) prop.get( 0 ); + xInt.setIntValue( m_fileSystem.getFsckPassNumber() ); + return prop; + } +} Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/MountPointCallback.java URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/MountPointCallback.java?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/MountPointCallback.java (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/MountPointCallback.java Tue Jul 12 16:20:48 2005 @@ -0,0 +1,28 @@ +package example.filesystem.callback; + +import org.apache.ws.resource.properties.ResourcePropertyCallback; +import org.apache.ws.resource.properties.ResourceProperty; +import org.apache.ws.resource.properties.impl.CallbackFailedException; +import org.apache.ws.resource.example.filesystem.MountPointDirectoryDocument; +import org.apache.xmlbeans.XmlString; +import example.filesystem.backend.FileSystem; + +/** + * A callback for the MountPoint resource property. + */ +public class MountPointCallback implements ResourcePropertyCallback +{ + FileSystem m_fileSystem; + + public MountPointCallback(FileSystem fileSystem) + { + m_fileSystem = fileSystem; + } + + public ResourceProperty refreshProperty(ResourceProperty prop) throws CallbackFailedException + { + XmlString xString = (XmlString) prop.get( 0 ); + xString.setStringValue( m_fileSystem.getMountPoint() ); + return prop; + } +} Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OptionsCallback.java URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OptionsCallback.java?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OptionsCallback.java (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OptionsCallback.java Tue Jul 12 16:20:48 2005 @@ -0,0 +1,120 @@ +/*=============================================================================* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *=============================================================================*/ +package example.filesystem.callback; + +import example.filesystem.backend.FileSystem; +import org.apache.ws.resource.example.filesystem.OptionsDocument; +import org.apache.ws.resource.properties.ResourceProperty; +import org.apache.ws.resource.properties.SetResourcePropertyCallback; +import org.apache.ws.resource.properties.impl.CallbackFailedException; + +import javax.xml.namespace.QName; +import java.util.Iterator; +import java.util.List; + +/** + * A callback for the Options resource property. + */ +public class OptionsCallback + implements SetResourcePropertyCallback +{ + /** + * DOCUMENT_ME + */ + FileSystem m_fileSystem; + + /** + * Creates a new {@link OptionsCallback} object. + * + * @param fileSystem DOCUMENT_ME + */ + public OptionsCallback( FileSystem fileSystem ) + { + m_fileSystem = fileSystem; + } + + /** + * DOCUMENT_ME + * + * @param propQName DOCUMENT_ME + */ + public void deleteProperty( QName propQName ) throws CallbackFailedException + { + return; // no need to implement - WSRF will never call delete for a prop whose minOccurs != 0 + } + + /** + * DOCUMENT_ME + * + * @param prop DOCUMENT_ME + */ + public void insertProperty( Object[] prop ) throws CallbackFailedException + { + return; // no need to implement - WSRF 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 ) throws CallbackFailedException + { + 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 ) throws CallbackFailedException + { + 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 ); + } + } +} \ No newline at end of file Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java Tue Jul 12 16:20:48 2005 @@ -0,0 +1,190 @@ + +package org.apache.ws.resource.example.filesystem; + +import org.apache.ws.addressing.EndpointReference; + +/** + * **** WARNING: This file will be overwritten during generation **** + * + * An abstract Filesystem WS-Resource. + *

+ * NOTE: This class is generated and is NOT meant to be modified. + */ +public abstract class AbstractFilesystemResource implements org.apache.ws.resource.lifetime.ScheduledResourceTerminationResource, org.apache.ws.resource.PropertiesResource, org.apache.ws.notification.base.NotificationProducerResource { + + /** + * The resource ID of the instance. + */ + protected String m_id; + + /** The EndpointReference for this resource **/ + protected EndpointReference m_endpointReference; + + /** + * The set of properties associated with this resource. + */ + protected org.apache.ws.resource.properties.ResourcePropertySet m_propSet; + + + /** + * A list of termination listeners to be notified when the resource is terminated. + */ + private java.util.List m_terminationListeners = new java.util.ArrayList(); + + + /** + * DOCUMENT_ME + * + * @param id DOCUMENT_ME + */ + public void setID( Object id ) + { + if ( m_id != null ) + { + throw new IllegalStateException( "This resource's ID has already been set." ); + } + + try + { + m_id = (String) id; + } + catch ( ClassCastException cce ) + { + throw new IllegalArgumentException( "Specified ID is not a String." ); + } + } + + /** + * DOCUMENT_ME + * + * @param listener DOCUMENT_ME + */ + public void addTerminationListener( org.apache.ws.resource.lifetime.ResourceTerminationListener listener) + { + m_terminationListeners.add(listener); + } + + /** + * DOCUMENT_ME + * + * @return DOCUMENT_ME + */ + public Object getID() + { + return m_id; + } + + public void destroy() + { + org.apache.ws.resource.lifetime.ResourceTerminationEvent rte = new org.apache.ws.resource.lifetime.impl.ResourceTerminationEventImpl(getID(),"Resource Destroyed"); + for (int i = 0; i < m_terminationListeners.size(); i++) + { + org.apache.ws.resource.lifetime.ResourceTerminationListener resourceTerminationEventListener = (org.apache.ws.resource.lifetime.ResourceTerminationListener) m_terminationListeners.get(i); + resourceTerminationEventListener.terminationOccurred(rte); + } + return; + } + + public void init() + { + + org.apache.ws.resource.example.filesystem.FileSystemPropertiesDocument propsDoc = org.apache.ws.resource.example.filesystem.FileSystemPropertiesDocument.Factory.newInstance(); + m_propSet = new org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySet( propsDoc ); + + // initialize wsrl:CurrentTime property + org.apache.ws.resource.properties.ResourceProperty prop = m_propSet.get( org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_CURRENT_TIME ); + org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.CurrentTimeDocument currTime = org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.CurrentTimeDocument.Factory.newInstance(); + currTime.setCurrentTime( java.util.Calendar.getInstance() ); + prop.add( currTime ); + prop.setCallback( new org.apache.ws.resource.lifetime.callback.CurrentTimeCallback() ); + + // initialize wsrl:TerminationTime property + prop = m_propSet.get( org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME ); + org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.TerminationTimeDocument termTime = org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.TerminationTimeDocument.Factory.newInstance(); + termTime.setNilTerminationTime(); + prop.add( termTime ); + + + + + } + + /** + * Returns the EndpointReference associated with this Resource. + * + * @return The Resource's EndpointReference or null if the EndpointReference has not been set. + * + * Note: It is the responsibility of the Resource creator to set the EndpointReference (i.e. ResourceHome impl) + */ + public EndpointReference getEndpointReference() + { + return m_endpointReference; + } + + /** + * Sets the EndpointReference associated with this Resource. + * + * @param epr The Resource's EndpointReference. + * + * Note: It is the responsibility of the Resource creator to set the EndpointReference (i.e. ResourceHome impl) + */ + public void setEndpointReference(EndpointReference epr) + { + m_endpointReference = epr; + } + + + /** + * DOCUMENT_ME + * + * @param time DOCUMENT_ME + */ + public void setTerminationTime( java.util.Calendar time ) + { + org.apache.ws.resource.properties.XmlBeansResourcePropertyUtils.setDateTimePropertyValue( (org.apache.ws.resource.properties.impl.XmlBeansResourceProperty) getResourcePropertySet().get( org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME ), + time ); + } + + /** + * Returns the current time from the prop set. + * + * @return java.util.Calendar + */ + public java.util.Calendar getCurrentTime() + { + return org.apache.ws.resource.properties.XmlBeansResourcePropertyUtils.getDateTimePropertyValue( (org.apache.ws.resource.properties.impl.XmlBeansResourceProperty) m_propSet.get( org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_CURRENT_TIME ) ); + } + + + /** + * DOCUMENT_ME + * + * @return DOCUMENT_ME + */ + public java.util.Calendar getTerminationTime() + { + return org.apache.ws.resource.properties.XmlBeansResourcePropertyUtils.getDateTimePropertyValue( (org.apache.ws.resource.properties.impl.XmlBeansResourceProperty) m_propSet.get( org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME ) ); + } + /** + * @see org.apache.ws.resource.PropertiesResource#setResourcePropertySet(org.apache.ws.resource.properties.ResourcePropertySet) + */ + public void setResourcePropertySet( org.apache.ws.resource.properties.ResourcePropertySet propSet ) + { + m_propSet = propSet; + } + + /** + * @see org.apache.ws.resource.PropertiesResource#getResourcePropertySet() + */ + public org.apache.ws.resource.properties.ResourcePropertySet getResourcePropertySet() + { + return m_propSet; + } + org.apache.ws.notification.topics.TopicSpaceSet m_topicSpaceSet = new org.apache.ws.notification.topics.impl.TopicSpaceSetImpl(true); + + public org.apache.ws.notification.topics.TopicSpaceSet getTopicSpaceSet() + { + return m_topicSpaceSet; + } + +} Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java Tue Jul 12 16:20:48 2005 @@ -0,0 +1,184 @@ + +package org.apache.ws.resource.example.filesystem; + +import org.apache.ws.resource.ResourceContext; +import org.apache.ws.resource.handler.SoapMethodNameMap; +import org.apache.ws.resource.handler.WsrfService; +import org.apache.ws.resource.AbstractPortType; +import org.apache.ws.resource.handler.ServiceSoapMethodNameMap; +import javax.xml.namespace.QName; + +/** + * **** WARNING: This file will be overwritten during generation **** + * + * This class should be generated on every "generation" against the WSDL. + * This will ensure it is always up-to-date with the WSDL. + * + * NOTE: This class is generated and is NOT meant to be modified. + */ +public abstract class AbstractFilesystemService extends AbstractPortType + implements org.apache.ws.resource.handler.WsrfService, org.apache.ws.resource.properties.v2004_06.porttype.QueryResourcePropertiesPortType, org.apache.ws.resource.properties.v2004_06.porttype.SetResourcePropertiesPortType, org.apache.ws.resource.properties.v2004_06.porttype.GetMultipleResourcePropertiesPortType, org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType, org.apache.ws.resource.properties.v2004_06.porttype.GetResourcePropertyPortType, org.apache.ws.notification.base.v2004_06.porttype.NotificationProducerPortType, org.apache.ws.resource.lifetime.v2004_06.porttype.ImmediateResourceTerminationPortType { + + public static final String TARGET_NSURI = "http://ws.apache.org/resource/example/filesystem"; + public static final String TARGET_NSPREFIX = "filesystem"; + + /** + * DOCUMENT_ME + */ + private ServiceSoapMethodNameMap m_methodNameMap; + + /** + * DOCUMENT_ME + */ + private boolean m_isInitialized; + + public AbstractFilesystemService( ResourceContext resourceContext ) + { + super(resourceContext); + } + + /** + * DOCUMENT_ME + * + * @param requestQname DOCUMENT_ME + * + * @return DOCUMENT_ME + */ + public String getMethodName( QName requestQname ) + { + if ( !m_isInitialized ) + { + init( ); + } + + return m_methodNameMap.getMethodName( requestQname ); + } + + + /** + * DOCUMENT_ME + * + * @return DOCUMENT_ME + */ + public final SoapMethodNameMap getMethodNameMap( ) + { + return m_methodNameMap; + } + + /** + * DOCUMENT_ME + */ + public void init( ) + { + m_methodNameMap = new ServiceSoapMethodNameMap( getResourceContext( ) ); + m_methodNameMap.addMapping( javax.xml.namespace.QName.valueOf("{http://ws.apache.org/resource/example/filesystem}Unmount") , "Unmount" ); + m_methodNameMap.addMapping( javax.xml.namespace.QName.valueOf("{http://ws.apache.org/resource/example/filesystem}Mount") , "Mount" ); + m_isInitialized = true; + } + + + /** + * DOCUMENT_ME + * + * @return DOCUMENT_ME + */ + protected final boolean isInitialized( ) + { + return m_isInitialized; + } + + /** + * DOCUMENT_ME + * + * @param requestDoc DOCUMENT_ME + * + * @return DOCUMENT_ME + */ + public org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.QueryResourcePropertiesResponseDocument queryResourceProperties( org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.QueryResourcePropertiesDocument requestDoc ) + { + return new org.apache.ws.resource.properties.v2004_06.porttype.impl.QueryResourcePropertiesPortTypeImpl( getResourceContext( ) ).queryResourceProperties( requestDoc ); + } + /** + * DOCUMENT_ME + * + * @param requestDoc DOCUMENT_ME + * + * @return DOCUMENT_ME + */ + public org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.SetResourcePropertiesResponseDocument setResourceProperties( org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.SetResourcePropertiesDocument requestDoc ) + { + return new org.apache.ws.resource.properties.v2004_06.porttype.impl.SetResourcePropertiesPortTypeImpl( getResourceContext( ) ).setResourceProperties( requestDoc ); + } + + /** + * DOCUMENT_ME + * + * @param requestDoc DOCUMENT_ME + * + * @return DOCUMENT_ME + */ + public org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetMultipleResourcePropertiesResponseDocument getMultipleResourceProperties( org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetMultipleResourcePropertiesDocument requestDoc ) + { + return new org.apache.ws.resource.properties.v2004_06.porttype.impl.GetMultipleResourcePropertiesPortTypeImpl( getResourceContext( ) ).getMultipleResourceProperties( requestDoc ); + } + + /** + * DOCUMENT_ME + * + * @param requestDoc DOCUMENT_ME + * + * @return DOCUMENT_ME + */ + public org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.SetTerminationTimeResponseDocument setTerminationTime( org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.SetTerminationTimeDocument requestDoc ) + { + return new org.apache.ws.resource.lifetime.v2004_06.porttype.impl.ScheduledResourceTerminationPortTypeImpl( getResourceContext( ) ).setTerminationTime( requestDoc ); + } + /** + * DOCUMENT_ME + * + * @param requestDoc DOCUMENT_ME + * + * @return DOCUMENT_ME + */ + public org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetResourcePropertyResponseDocument getResourceProperty( org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetResourcePropertyDocument requestDoc ) + { + return new org.apache.ws.resource.properties.v2004_06.porttype.impl.GetResourcePropertyPortTypeImpl( getResourceContext( ) ).getResourceProperty( requestDoc ); + } + /** + * DOCUMENT_ME + * + * @param requestDoc DOCUMENT_ME + * + * @return DOCUMENT_ME + */ + public org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscribeResponseDocument subscribe( org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscribeDocument requestDoc ) + { + return new org.apache.ws.notification.base.v2004_06.porttype.impl.NotificationProducerPortTypeImpl( getResourceContext( ) ).subscribe( requestDoc ); + } + + /** + * DOCUMENT_ME + * + * @param requestDoc DOCUMENT_ME + * + * @return DOCUMENT_ME + */ + public org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.GetCurrentMessageResponseDocument getCurrentMessage( org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.GetCurrentMessageDocument requestDoc ) + { + return new org.apache.ws.notification.base.v2004_06.porttype.impl.NotificationProducerPortTypeImpl( getResourceContext( ) ).getCurrentMessage( requestDoc ); + } + + + /** + * DOCUMENT_ME + * + * @param requestDoc DOCUMENT_ME + * + * @return DOCUMENT_ME + */ + public org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.DestroyResponseDocument destroy( org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.DestroyDocument requestDoc ) + { + return new org.apache.ws.resource.lifetime.v2004_06.porttype.impl.ImmediateResourceTerminationPortTypeImpl( getResourceContext( ) ).destroy( requestDoc ); + } + +} Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java Tue Jul 12 16:20:48 2005 @@ -0,0 +1,18 @@ + +package org.apache.ws.resource.example.filesystem; + +/** + * **** WARNING: This file will be overwritten during generation **** + * + * Custom operations portType. + * + * NOTE: This class is generated and is NOT meant to be modified. + * + */ +public interface FilesystemCustomOperationsPortType +{ + + 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 ; + 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 ; + +} Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java Tue Jul 12 16:20:48 2005 @@ -0,0 +1,116 @@ + +package org.apache.ws.resource.example.filesystem; + +import org.apache.ws.resource.Resource; +import org.apache.ws.resource.ResourceContext; +import org.apache.ws.resource.ResourceContextException; +import org.apache.ws.resource.ResourceException; +import org.apache.ws.resource.ResourceKey; +import org.apache.ws.resource.ResourceUnknownException; +import org.apache.ws.resource.impl.AbstractResourceHome; +import org.apache.ws.addressing.EndpointReference; + +import javax.xml.namespace.QName; + +import java.io.Serializable; + +/** + * **** NOTE: This file will not be overwritten during generation **** + * + * Home for Filesystem WS-Resources. + */ +public class FilesystemHome + extends AbstractResourceHome + implements Serializable +{ + + /** The service endpoint name as registered with the SOAP Platform. This is useful for building EPR's. **/ + public static final QName SERVICE_NAME = javax.xml.namespace.QName.valueOf("{http://ws.apache.org/resource/example/filesystem}filesystem"); + + /** The management PortType associated with this resource. This is useful for building EPR's.**/ + public static final QName PORT_TYPE = javax.xml.namespace.QName.valueOf("{http://ws.apache.org/resource/example/filesystem}FileSystemPortType"); + + /** The WSDL Port name associated with the resource. This is useful for building EPR's. **/ + public static final String PORT_NAME = "filesystem"; + + /** The name of the resource key for this resource. **/ + public static final QName RESOURCE_KEY_NAME = javax.xml.namespace.QName.valueOf("{http://ws.apache.org/resource/example/filesystem}ResourceIdentifier"); + + /** + * A NamespaceVerionHolder which maintains the QNames of Spec Wsdls + */ + public static final org.apache.ws.notification.base.v2004_06.impl.WsnNamespaceVersionHolderImpl SPEC_NAMESPACE_SET = new org.apache.ws.notification.base.v2004_06.impl.WsnNamespaceVersionHolderImpl(); + /** A constant for the JNDI Lookup name for this home. **/ + public static final String HOME_LOCATION = + org.apache.ws.resource.JndiConstants.CONTEXT_NAME_SERVICES + "/" + SERVICE_NAME.getLocalPart() + "/" + org.apache.ws.resource.JndiConstants.ATOMIC_NAME_HOME; + + /** + * + * @param resourceContext + * + * @return A Resource + * + * @throws ResourceException + * @throws ResourceContextException + * @throws ResourceUnknownException + */ + public Resource getInstance( ResourceContext resourceContext ) + throws ResourceException, + ResourceContextException, + ResourceUnknownException + { + 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; + } + + public QName getServiceName() + { + return SERVICE_NAME; + } + + public QName getPortType() + { + return PORT_TYPE; + } + + public String getServicePortName() + { + return PORT_NAME; + } + + public QName getResourceKeyNameQName() + { + return RESOURCE_KEY_NAME; + } +} Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemPropertyQNames.java URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemPropertyQNames.java?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemPropertyQNames.java (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemPropertyQNames.java Tue Jul 12 16:20:48 2005 @@ -0,0 +1,41 @@ +package org.apache.ws.resource.example.filesystem; + +import javax.xml.namespace.QName; + +/** + * **** WARNING: This file will be overwritten during generation **** + * + * QNames of the resource properties defined by Filesystem WSDL. + *

+ * NOTE: This class is generated and is NOT meant to be modified. + * + */ +public interface FilesystemPropertyQNames +{ + + QName TYPE = + new QName( "http://ws.apache.org/resource/example/filesystem", "Type", "tns"); + QName OPTIONS = + new QName( "http://ws.apache.org/resource/example/filesystem", "Options", "tns"); + QName DEVICESPECIALFILE = + new QName( "http://ws.apache.org/resource/example/filesystem", "DeviceSpecialFile", "tns"); + QName TOPICEXPRESSIONDIALECTS = + new QName( "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "TopicExpressionDialects", "wsnt"); + QName COMMENT = + new QName( "http://ws.apache.org/resource/example/filesystem", "Comment", "tns"); + QName TERMINATIONTIME = + new QName( "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd", "TerminationTime", "wsrl"); + QName MOUNTPOINTDIRECTORY = + new QName( "http://ws.apache.org/resource/example/filesystem", "MountPointDirectory", "tns"); + QName FSCKPASSNUMBER = + new QName( "http://ws.apache.org/resource/example/filesystem", "FsckPassNumber", "tns"); + QName FIXEDTOPICSET = + new QName( "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "FixedTopicSet", "wsnt"); + QName CURRENTTIME = + new QName( "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd", "CurrentTime", "wsrl"); + QName BACKUPFREQUENCY = + new QName( "http://ws.apache.org/resource/example/filesystem", "BackupFrequency", "tns"); + QName TOPIC = + new QName( "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "Topic", "wsnt"); + +} Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java?rev=216047&view=auto ============================================================================== --- webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java (added) +++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java Tue Jul 12 16:20:48 2005 @@ -0,0 +1,154 @@ + +package org.apache.ws.resource.example.filesystem; + +/** + * **** NOTE: This file will not be overwritten during generation **** + * + * A Filesystem WS-Resource. + *

+ * NOTE: This class is generated but IS meant to be modified. + */ +public class FilesystemResource extends AbstractFilesystemResource + +{ + + /** + * A NamespaceVerionHolder which maintains the QNames of Spec Wsdls + */ + public static final org.apache.ws.notification.base.v2004_06.impl.WsnNamespaceVersionHolderImpl SPEC_NAMESPACE_SET = new org.apache.ws.notification.base.v2004_06.impl.WsnNamespaceVersionHolderImpl(); + + /** + * Initializes this resource's state (properties, etc.). + */ + 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; + + + + /* + * This is where you should associate the backend instance with + * the resource instance for a given id. + */ + example.filesystem.backend.FileSystem m_fileSystem = new example.filesystem.backend.UnixFileSystem( m_id ); + + 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 ) ); + } + 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 + * + *
+ * NOTE this MUST be called last in the Resource.init() method to ensure all topics get registered + *
+ * FixedTopicSet will be set based on the value returned from the {@see TopicSpaceSet#isFixed()} method. + *
+ * Topic will have all root topics in the TopicSpaceSet, set to Simple dialect AND all child topics set ot + * Concrete dialect. + *
+ * + * 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()); + } +}