You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-dev@ws.apache.org by ip...@apache.org on 2005/07/26 00:54:53 UTC
svn commit: r225200 - in /webservices/muse/trunk/src:
examples/filesystem/src/java/example/filesystem/backend/
examples/filesystem/src/java/example/filesystem/callback/
examples/filesystem/src/java/org/ examples/filesystem/src/java/org/apache/
examples...
Author: ips
Date: Mon Jul 25 15:54:45 2005
New Revision: 225200
URL: http://svn.apache.org/viewcvs?rev=225200&view=rev
Log:
pristine Muse filesystem example
Added:
webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OperationalStatusCallback.java
webservices/muse/trunk/src/examples/filesystem/src/java/org/
webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/
webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/
webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/
webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/
webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/
webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemHome.java
webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java
webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java
webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java
webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java
webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemPropertyQNames.java
webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemService.java
webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_deploy.wsdd
webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_jndi-config.xml
webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/MountDeviceBusyFaultException.java
Modified:
webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java
webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java
webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java
webservices/muse/trunk/src/java/org/apache/ws/muws/MuwsUtils.java
webservices/muse/trunk/src/template/build.xml
Modified: webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java?rev=225200&r1=225199&r2=225200&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java (original)
+++ webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java Mon Jul 25 15:54:45 2005
@@ -30,4 +30,10 @@
int getFsckPassNumber();
void setFsckPassNumber(int fsckPassNumber);
+
+ void mount() throws Exception;
+
+ void unmount() throws Exception;
+
+ boolean isMounted();
}
Modified: webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java?rev=225200&r1=225199&r2=225200&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java (original)
+++ webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java Mon Jul 25 15:54:45 2005
@@ -19,6 +19,7 @@
private List m_options;
private String m_comment="user files";
private String m_deviceSpecialFile = "/dev/vg00/lvol7";
+ private boolean m_isMounted = true;
public UnixFileSystem(String devicePath)
{
@@ -83,5 +84,20 @@
public void setFsckPassNumber(int fsckPassNumber)
{
m_fsckPassNumber = fsckPassNumber;
+ }
+
+ public void mount() throws Exception
+ {
+ m_isMounted = true;
+ }
+
+ public void unmount() throws Exception
+ {
+ m_isMounted = false;
+ }
+
+ public boolean isMounted()
+ {
+ return m_isMounted;
}
}
Modified: webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java?rev=225200&r1=225199&r2=225200&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java (original)
+++ webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java Mon Jul 25 15:54:45 2005
@@ -3,7 +3,6 @@
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;
Added: webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OperationalStatusCallback.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OperationalStatusCallback.java?rev=225200&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OperationalStatusCallback.java (added)
+++ webservices/muse/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OperationalStatusCallback.java Mon Jul 25 15:54:45 2005
@@ -0,0 +1,42 @@
+package example.filesystem.callback;
+
+import example.filesystem.backend.FileSystem;
+import org.apache.ws.resource.properties.ResourceProperty;
+import org.apache.ws.resource.properties.ResourcePropertyCallback;
+import org.apache.ws.resource.properties.impl.CallbackFailedException;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument;
+
+/**
+ * A callback for the MUWS OperationalStatus resource property.
+ */
+public class OperationalStatusCallback implements ResourcePropertyCallback
+{
+
+ private FileSystem m_fileSystem;
+
+ public OperationalStatusCallback(FileSystem fileSystem)
+ {
+ m_fileSystem = fileSystem;
+ }
+
+ public ResourceProperty refreshProperty(ResourceProperty prop) throws CallbackFailedException
+ {
+ if ( prop.isEmpty() )
+ {
+ OperationalStatusDocument statusDoc = OperationalStatusDocument.Factory.newInstance();
+ statusDoc.setOperationalStatus( getBackendStatus() );
+ prop.add( statusDoc );
+ }
+ else
+ {
+ OperationalStatusDocument.OperationalStatus status = (OperationalStatusDocument.OperationalStatus) prop.get( 0 );
+ status.set( getBackendStatus() );
+ }
+ return prop;
+ }
+
+ private OperationalStatusDocument.OperationalStatus.Enum getBackendStatus()
+ {
+ return m_fileSystem.isMounted() ? OperationalStatusDocument.OperationalStatus.AVAILABLE : OperationalStatusDocument.OperationalStatus.UNAVAILABLE;
+ }
+}
Added: webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemHome.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemHome.java?rev=225200&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemHome.java (added)
+++ webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemHome.java Mon Jul 25 15:54:45 2005
@@ -0,0 +1,39 @@
+package org.apache.ws.resource.example.filesystem;
+
+import org.apache.ws.resource.impl.AbstractResourceHome;
+import org.apache.commons.collections.map.ReferenceMap;
+import java.util.Map;
+
+/**
+ * The class acts as an extension of the AbstractResourceHome which
+ * maintains a reference to the STATIC map needed for accessing
+ * resources via JNDI. This ensures the resources will be accessible
+ * when serialized upon lookup from certain JNDI providers.
+ * <p />
+ * ***** WARNING *****
+ * This class is generated by Wsdl2Java and is NOT meant to be modified.
+ * It will be overwritten by subsequent runs of Wsdl2Java.
+ */
+abstract class AbstractFilesystemHome extends AbstractResourceHome
+{
+
+ /**
+ * Map containing all FilesystemResource instances - this map <em>must</em> be static for
+ * compatibility with certain JNDI providers.
+ */
+ private static Map s_resources;
+
+ /**
+ * Returns a map of all FilesystemResource instances. Called by the {@link AbstractResourceHome}
+ * superclass.
+ */
+ protected synchronized final Map getResourceMap()
+ {
+ if ( s_resources == null )
+ {
+ s_resources = AbstractResourceHome.createResourceMap( m_resourceIsPersistent );
+ }
+ return s_resources;
+ }
+
+}
Added: webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java?rev=225200&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java (added)
+++ webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java Mon Jul 25 15:54:45 2005
@@ -0,0 +1,209 @@
+
+package org.apache.ws.resource.example.filesystem;
+
+import org.apache.ws.addressing.EndpointReference;
+
+/**
+ * An abstract base class for the Filesystem resource.
+ * <p />
+ * ***** WARNING *****
+ * This class is generated by Wsdl2Java and is NOT meant to be modified.
+ * It will be overwritten by subsequent runs of Wsdl2Java.
+ */
+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 );
+
+
+
+ /**
+ * Add a specialized version of the Relationship ResourceProperty that will automatically publish
+ * RelationshipCreated/Deleted events when elements are added to or removed from the ResourceProperty.
+ */
+ org.apache.ws.muws.MuwsUtils.updateRelationshipResourceProperty( m_propSet, this );
+ /**
+ * Add the MUWS RelationshipCreated/Deleted topics to our topic set.
+ *
+ * NOTE: IF ADDING additional Topics to the Muws2 TopicSpace AFTER this method call, make sure to use
+ * the returned muws2topics TopicSpace. Anytime a TopicSpace is added to a TopicSpaceSet, the set returns
+ * the active handle to that TopicSpace and INVALIDATES the previous handle.
+ */
+ try {
+ org.apache.ws.notification.topics.TopicSpace muws2topics = org.apache.ws.muws.MuwsUtils.addRelationshipTopics( getTopicSpaceSet() );
+ } catch ( Exception e ) {
+ throw new RuntimeException( "Failed to add the MUWS RelationshipAdded/Removed topics to the topic set.", e );
+ }
+
+
+
+ }
+
+ /**
+ * 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/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java?rev=225200&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java (added)
+++ webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java Mon Jul 25 15:54:45 2005
@@ -0,0 +1,183 @@
+
+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;
+
+/**
+ * An abstract base class for the Filesystem service.
+ * <p />
+ * ***** WARNING *****
+ * This class is generated by Wsdl2Java and is NOT meant to be modified.
+ * It will be overwritten by subsequent runs of Wsdl2Java.
+ */
+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, org.apache.ws.muws.v1_0.capability.RelationshipsCapability {
+
+ 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 );
+ }
+
+ /**
+ * @see org.apache.ws.resource.properties.v2004_06.porttype.GetMultipleResourcePropertiesPortType#getMultipleResourceProperties
+ */
+ 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 );
+ }
+ /**
+ * @see
+ */
+ 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 );
+ }
+
+public org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.QueryRelationshipsByTypeResponseDocument queryRelationshipsByType( org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.QueryRelationshipsByTypeDocument requestDoc )
+{
+ return new org.apache.ws.muws.v1_0.capability.impl.RelationshipsCapabilityImpl( getResourceContext( ) ).queryRelationshipsByType( requestDoc );
+}
+
+
+
+}
Added: webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java?rev=225200&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java (added)
+++ webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java Mon Jul 25 15:54:45 2005
@@ -0,0 +1,18 @@
+
+package org.apache.ws.resource.example.filesystem;
+
+/**
+ * An interface containing all custom operations from the Filesystem service's
+ * most-derived portType.
+ * <p />
+ * ***** WARNING *****
+ * This class is generated by Wsdl2Java and is NOT meant to be modified.
+ * It will be overwritten by subsequent runs of Wsdl2Java.
+ */
+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/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java?rev=225200&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java (added)
+++ webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java Mon Jul 25 15:54:45 2005
@@ -0,0 +1,83 @@
+
+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.ResourceUnknownException;
+import org.apache.ws.resource.impl.AbstractResourceHome;
+import org.apache.ws.addressing.EndpointReference;
+
+import javax.xml.namespace.QName;
+
+import java.io.Serializable;
+
+/**
+ * The home for Filesystem resources.
+ * <p />
+ * NOTE: This file is generated, but is meant to be modified.
+ * It will NOT be overwritten by subsequent runs of Wsdl2Java.
+ */
+public class FilesystemHome
+ extends AbstractFilesystemHome
+ 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.muws.v1_0.impl.WsdmNamespaceVersionHolderImpl SPEC_NAMESPACE_SET = new org.apache.ws.muws.v1_0.impl.WsdmNamespaceVersionHolderImpl();
+ /** 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;
+
+ private static final String LVOL1_ID = "/dev/vg00/lvol1";
+ private static final String LVOL2_ID = "/dev/vg00/lvol2";
+
+ /**
+ * Create and add two resource instances.
+ *
+ * @throws Exception on error
+ */
+ public void init() throws Exception
+ {
+ super.init();
+ FilesystemResource lvol1Resource = (FilesystemResource) createInstance( LVOL1_ID );
+ add( lvol1Resource );
+ FilesystemResource lvol2Resource = (FilesystemResource) createInstance( LVOL1_ID );
+ add( lvol2Resource );
+ }
+
+ 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/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemPropertyQNames.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemPropertyQNames.java?rev=225200&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemPropertyQNames.java (added)
+++ webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemPropertyQNames.java Mon Jul 25 15:54:45 2005
@@ -0,0 +1,48 @@
+package org.apache.ws.resource.example.filesystem;
+
+import javax.xml.namespace.QName;
+
+/**
+ * QNames of the resource properties associated with the Filesystem resource.
+ * <p />
+ * ***** WARNING *****
+ * This class is generated by Wsdl2Java and is NOT meant to be modified.
+ * It will be overwritten by subsequent runs of Wsdl2Java.
+ */
+public interface FilesystemPropertyQNames
+{
+
+ QName TYPE =
+ new QName( "http://ws.apache.org/resource/example/filesystem", "Type", "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 RESOURCEID =
+ new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd", "ResourceId", "muws-p1-xs");
+ QName MOUNTPOINTDIRECTORY =
+ new QName( "http://ws.apache.org/resource/example/filesystem", "MountPointDirectory", "tns");
+ QName MANAGEABILITYCAPABILITY =
+ new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd", "ManageabilityCapability", "muws-p1-xs");
+ QName OPTIONS =
+ new QName( "http://ws.apache.org/resource/example/filesystem", "Options", "tns");
+ 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 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 OPERATIONALSTATUS =
+ new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd", "OperationalStatus", "muws-p2-xs");
+ 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 RELATIONSHIP =
+ new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd", "Relationship", "muws-p2-xs");
+ QName TOPIC =
+ new QName( "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "Topic", "wsnt");
+
+}
Added: webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java?rev=225200&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java (added)
+++ webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java Mon Jul 25 15:54:45 2005
@@ -0,0 +1,294 @@
+package org.apache.ws.resource.example.filesystem;
+
+import example.filesystem.callback.OperationalStatusCallback;
+import org.apache.axis.message.addressing.Constants;
+import org.apache.ws.addressing.XmlBeansEndpointReference;
+import org.apache.ws.muws.MuwsUtils;
+import org.apache.ws.muws.v1_0.MuwsConstants;
+import org.apache.ws.muws.v1_0.capability.IdentityCapability;
+import org.apache.ws.muws.v1_0.capability.ManageabilityCharacteristicsCapability;
+import org.apache.ws.muws.v1_0.capability.OperationalStatusCapability;
+import org.apache.ws.muws.v1_0.capability.RelationshipsCapability;
+import org.apache.ws.muws.v1_0.topics.ManagementEventTopic;
+import org.apache.ws.muws.v1_0.topics.impl.XmlBeansManagementEventTopicImpl;
+import org.apache.ws.notification.topics.TopicSpace;
+import org.apache.ws.notification.topics.impl.TopicSpaceImpl;
+import org.apache.ws.resource.PropertiesResource;
+import org.apache.ws.resource.ResourceHome;
+import org.apache.ws.resource.properties.ResourceProperty;
+import org.apache.ws.util.XmlBeanUtils;
+import org.apache.xmlbeans.XmlAnyURI;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ManageabilityCapabilityDocument;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipParticipantType;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipType;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipTypeType;
+import org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType;
+
+import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
+
+/**
+ * **** NOTE: This file will not be overwritten during generation ****
+ * <p/>
+ * A Filesystem WS-Resource.
+ * <p/>
+ * 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.muws.v1_0.impl.WsdmNamespaceVersionHolderImpl SPEC_NAMESPACE_SET = new org.apache.ws.muws.v1_0.impl.WsdmNamespaceVersionHolderImpl();
+
+ private static final String HOST_HOME_LOCATION =
+ org.apache.ws.resource.JndiConstants.CONTEXT_NAME_SERVICES + "/Host/" + org.apache.ws.resource.JndiConstants.ATOMIC_NAME_HOME;
+
+ private example.filesystem.backend.FileSystem m_filesystem;
+
+ /**
+ * Initializes this resource's state (properties, etc.).
+ */
+ public void init()
+ {
+ super.init();
+
+ m_filesystem = new example.filesystem.backend.UnixFileSystem( m_id );
+
+ /*
+ * Add MUWS "capability topics" to the topic set.
+ */
+ ManagementEventTopic identityCapabilityTopic;
+ ManagementEventTopic manageabilityCharacteristicsCapabilityTopic;
+ ManagementEventTopic operationalStatusCapabilityTopic;
+ ManagementEventTopic relationshipsCapabilityTopic;
+ try
+ {
+ TopicSpace muwsTopicSpace = new TopicSpaceImpl( MuwsConstants.NSURI_MUWS_PART2_TOPICS );
+ getTopicSpaceSet().addTopicSpace( muwsTopicSpace );
+
+ identityCapabilityTopic = new XmlBeansManagementEventTopicImpl( IdentityCapability.TOPIC_NAME );
+ muwsTopicSpace.addTopic( identityCapabilityTopic );
+ manageabilityCharacteristicsCapabilityTopic = new XmlBeansManagementEventTopicImpl(
+ ManageabilityCharacteristicsCapability.TOPIC_NAME );
+ muwsTopicSpace.addTopic( manageabilityCharacteristicsCapabilityTopic );
+ operationalStatusCapabilityTopic = new XmlBeansManagementEventTopicImpl(
+ OperationalStatusCapability.TOPIC_NAME );
+ muwsTopicSpace.addTopic( operationalStatusCapabilityTopic );
+ relationshipsCapabilityTopic = new XmlBeansManagementEventTopicImpl( RelationshipsCapability.TOPIC_NAME );
+ muwsTopicSpace.addTopic( relationshipsCapabilityTopic );
+ }
+ catch ( Exception e )
+ {
+ throw new RuntimeException( "Failed to add MUWS capability topics to topic set.", e );
+ }
+
+ org.apache.ws.resource.properties.ResourcePropertySet resourcePropertySet = getResourcePropertySet();
+ org.apache.ws.resource.properties.ResourceProperty resourceProperty;
+ try
+ {
+ /*
+ * Initialize each of our properties by calling resourceProperty.add(propElem) and/or resourceProperty.setCallback(callback)...
+ */
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.DEVICESPECIALFILE );
+ DeviceSpecialFileDocument deviceDocXBean = DeviceSpecialFileDocument.Factory.newInstance();
+ deviceDocXBean.setDeviceSpecialFile( m_filesystem.getDeviceSpecialFile() );
+ resourceProperty.add( deviceDocXBean );
+
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.TYPE );
+ TypeDocument typeDocXBean = TypeDocument.Factory.newInstance();
+ typeDocXBean.setType( m_filesystem.getType() );
+ resourceProperty.add( typeDocXBean );
+
+ BackupFrequencyDocument backupDocXBean = BackupFrequencyDocument.Factory.newInstance();
+ backupDocXBean.setBackupFrequency( m_filesystem.getBackupFrequency() );
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.BACKUPFREQUENCY );
+ resourceProperty.add( backupDocXBean );
+ resourceProperty.setCallback( new example.filesystem.callback.BackupFrequencyCallback( m_filesystem ) );
+
+ CommentDocument commentDocXBean = CommentDocument.Factory.newInstance();
+ commentDocXBean.setComment( m_filesystem.getComment() );
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.COMMENT );
+ resourceProperty.add( commentDocXBean );
+ resourceProperty.setCallback( new example.filesystem.callback.CommentCallback( m_filesystem ) );
+
+ FsckPassNumberDocument fsckDocXBean = FsckPassNumberDocument.Factory.newInstance();
+ fsckDocXBean.setFsckPassNumber( m_filesystem.getFsckPassNumber() );
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.FSCKPASSNUMBER );
+ resourceProperty.add( fsckDocXBean );
+ resourceProperty.setCallback( new example.filesystem.callback.FsckPassNumberCallback( m_filesystem ) );
+
+ MountPointDirectoryDocument mountPointDocXBean = MountPointDirectoryDocument.Factory.newInstance();
+ mountPointDocXBean.setMountPointDirectory( m_filesystem.getMountPoint() );
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.MOUNTPOINTDIRECTORY );
+ resourceProperty.add( mountPointDocXBean );
+ resourceProperty.setCallback( new example.filesystem.callback.MountPointCallback( m_filesystem ) );
+
+ OptionsDocument optionsDocXBean =
+ OptionsDocument.Factory.newInstance();
+ org.apache.ws.resource.example.filesystem.OptionsDocument.Options options =
+ optionsDocXBean.addNewOptions();
+ java.util.List backendOptions =
+ m_filesystem.getOptions();
+ for ( int i = 0; i < backendOptions.size(); i++ )
+ {
+ options.addOption( (String) backendOptions.get( i ) );
+ }
+
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.OPTIONS );
+ resourceProperty.add( optionsDocXBean );
+ resourceProperty.setCallback( new example.filesystem.callback.OptionsCallback( m_filesystem ) );
+
+ /*
+ * MUWS-defined properties.
+ */
+ // init the {http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd}ResourceId resource property
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.RESOURCEID );
+ org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ResourceIdDocument prop_resourceid = org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ResourceIdDocument.Factory.newInstance();
+ prop_resourceid.setResourceId( MuwsUtils.toURI( getID() ).toString() );
+ resourceProperty.add( prop_resourceid );
+ resourceProperty.addChangeListener( identityCapabilityTopic ); // add for property-value-changed management events
+
+ // init the {http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd}ManageabilityCapability resource property
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.MANAGEABILITYCAPABILITY );
+ // add property element for MUWS Identity capability...
+ ManageabilityCapabilityDocument identityCapabilityPropElem = ManageabilityCapabilityDocument.Factory.newInstance();
+ identityCapabilityPropElem.setManageabilityCapability( IdentityCapability.URI );
+ resourceProperty.add( identityCapabilityPropElem );
+ // add property element for MUWS ManageabilityCharacteristics capability...
+ ManageabilityCapabilityDocument manageabilityCharacteristicsCapabilityPropElem = ManageabilityCapabilityDocument.Factory.newInstance();
+ manageabilityCharacteristicsCapabilityPropElem.setManageabilityCapability(
+ ManageabilityCharacteristicsCapability.URI );
+ resourceProperty.add( manageabilityCharacteristicsCapabilityPropElem );
+ // add property element for MUWS OperationalStatus capability...
+ ManageabilityCapabilityDocument operationalStatusCapabilityPropElem = ManageabilityCapabilityDocument.Factory.newInstance();
+ operationalStatusCapabilityPropElem.setManageabilityCapability( OperationalStatusCapability.URI );
+ resourceProperty.add( operationalStatusCapabilityPropElem );
+ // add property element for MUWS Relationships capability...
+ ManageabilityCapabilityDocument relationshipsCapabilityPropElem = ManageabilityCapabilityDocument.Factory.newInstance();
+ relationshipsCapabilityPropElem.setManageabilityCapability( RelationshipsCapability.URI );
+ resourceProperty.add( relationshipsCapabilityPropElem );
+
+ resourceProperty.addChangeListener( manageabilityCharacteristicsCapabilityTopic ); // add for property-value-changed management events
+
+ // init the {http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd}OperationalStatus resource property
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.OPERATIONALSTATUS );
+ resourceProperty.setCallback( new OperationalStatusCallback( m_filesystem ) );
+ resourceProperty.addChangeListener( operationalStatusCapabilityTopic ); // add for property-value-changed management events
+
+ // init the {http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd}Relationship resource property
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.RELATIONSHIP );
+ org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipDocument prop_relationship = org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipDocument.Factory.newInstance();
+ /*
+ * Create the relationship bean...
+ */
+ RelationshipType relationshipType = null;
+ relationshipType = prop_relationship.addNewRelationship();
+ RelationshipTypeType relationshipTypeType = relationshipType.addNewType();
+ XmlBeanUtils.addChildElement( relationshipTypeType, new QName( "http://myns.com/", "ContainedBy", "myns" ) );
+
+ RelationshipParticipantType relationshipParticipantType = relationshipType.addNewParticipant();
+ ResourceProperty resourceIdProp = resourcePropertySet.get( FilesystemPropertyQNames.RESOURCEID );
+ XmlAnyURI resourceId = (XmlAnyURI) resourceIdProp.get( 0 );
+ relationshipParticipantType.setResourceId( resourceId.getStringValue() );
+ relationshipParticipantType.setRole( "urn:containee" );
+ // NOTE: the below line assumes that the Filesystem resource's EndpointReference field has been initialized
+ EndpointReferenceType filesystemReference = (EndpointReferenceType) ((XmlBeansEndpointReference)getEndpointReference()).getXmlObject( Constants.NS_URI_ADDRESSING_2004_08 );
+ relationshipParticipantType.setManageabilityEndpointReferenceArray( new EndpointReferenceType[] { filesystemReference } );
+
+ RelationshipParticipantType relationshipParticipantType2 = relationshipType.addNewParticipant();
+ ResourceHome hostHome = (ResourceHome) new InitialContext( ).lookup( HOST_HOME_LOCATION );
+ PropertiesResource host = (PropertiesResource) hostHome.find( null ); // host is a singleton resource w/ a null resource identifier
+ resourceIdProp = host.getResourcePropertySet().get( IdentityCapability.PROP_NAME_RESOURCE_ID );
+ resourceId = (XmlAnyURI) resourceIdProp.get( 0 );
+ relationshipParticipantType2.setResourceId( resourceId.getStringValue() );
+ relationshipParticipantType2.setRole( "urn:container" );
+ // NOTE: the below line assumes that the Host resource's EndpointReference field has been initialized
+ EndpointReferenceType hostReference = (EndpointReferenceType) ((XmlBeansEndpointReference)host.getEndpointReference()).getXmlObject( Constants.NS_URI_ADDRESSING_2004_08 );
+ relationshipParticipantType.setManageabilityEndpointReferenceArray( new EndpointReferenceType[] { hostReference } );
+
+ resourceProperty.add( prop_relationship );
+ resourceProperty.addChangeListener( relationshipsCapabilityTopic ); // add for property-value-changed management events
+ }
+ catch ( Exception e )
+ {
+ throw new RuntimeException( "There was a problem in initializing your resource properties. Please check your init() method. Cause: " +
+ e.getLocalizedMessage() );
+ }
+ // Resource Property {http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd}TerminationTime is implemented by the framework.
+ // Resource Property {http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd}CurrentTime is implemented by the framework.
+ // Resource Property {http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}FixedTopicSet is implemented by the framework.
+ // Resource Property {http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}Topic is implemented by the framework.
+ // Resource Property {http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}TopicExpressionDialects is implemented by the framework.
+
+ /**
+ * This method enables the ResourceTermination Topic for notifications
+ * about this resource's termination. If you would not like this
+ * behaviour either comment or remove the line of code.
+ */
+ try
+ {
+ org.apache.ws.notification.topics.util.TopicUtils.addResourceTerminationTopic( getTopicSpaceSet(), this,
+ SPEC_NAMESPACE_SET );
+ }
+ catch ( Exception e )
+ {
+ throw new RuntimeException(
+ "Unable to init the ResourceTermination topic. Cause: " + e.getLocalizedMessage(), e );
+ }
+ /**
+ * This method call will make all resource properties be exposed
+ * as Topics. If you would like to change that behaviour you can
+ * call TopicUtils.addResourcePropertyValueChangeTopic for each
+ * Topic you'd like to expose property change notifications for.
+ */
+ try
+ {
+ org.apache.ws.notification.topics.util.TopicUtils.addResourcePropertyValueChangeTopics(
+ getResourcePropertySet(), getTopicSpaceSet() );
+ }
+ catch ( Exception e )
+ {
+ throw new RuntimeException(
+ "Unable to init the ResourceProperty Changed topics. Cause: " + e.getLocalizedMessage(), e );
+ }
+
+ /**
+ * Initializes the Topic, TopicExpressionDialects and FixedTopicSet resource properties
+ *
+ * </br>
+ * <strong>NOTE this MUST be called last in the Resource.init() method to ensure all topics get registered</strong>
+ * </br>
+ * FixedTopicSet will be set based on the value returned from the {@see TopicSpaceSet#isFixed()} method.
+ * </br>
+ * Topic will have all root topics in the TopicSpaceSet, set to Simple dialect AND all child topics set ot
+ * Concrete dialect.
+ * </br>
+ *
+ * TopicExpressionDialects will be set to the engine's known Topic Dialects acquired from the TopicExpressionEngine
+ *
+ * @param topicSpaceSet
+ * @param propSet
+ */
+ org.apache.ws.notification.topics.util.TopicUtils.initNotificationProducerProperties( getTopicSpaceSet(),
+ getResourcePropertySet() );
+ }
+
+ public void mount() throws Exception
+ {
+ m_filesystem.mount();
+ }
+
+ public void unmount() throws Exception
+ {
+ m_filesystem.unmount();
+ }
+
+ public boolean isMounted()
+ {
+ return m_filesystem.isMounted();
+ }
+
+}
Added: webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemService.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemService.java?rev=225200&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemService.java (added)
+++ webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemService.java Mon Jul 25 15:54:45 2005
@@ -0,0 +1,88 @@
+package org.apache.ws.resource.example.filesystem;
+
+import org.apache.ws.resource.ResourceContext;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlException;
+
+import javax.xml.rpc.JAXRPCException;
+
+/**
+ * **** NOTE: This file will not be overwritten during generation ****
+ *
+ * This class should be generated ONCE (and not overwritten) to maintain user-added code.
+ * If there is a change to the WSDL, then the generated implemented interfaces
+ * (representing the "base" portTypes) will change, thus showing a compile error to the
+ * user.
+ *
+ * NOTE: This class is generated. However, it will not be overwritten by subsequent
+ * calls to the code generator.
+ *
+ */
+public class FilesystemService
+ extends AbstractFilesystemService
+ implements FilesystemCustomOperationsPortType
+{
+
+
+ /**
+ * A NamespaceVerionHolder which maintains the QNames of Spec Wsdls
+ */
+ public static final org.apache.ws.muws.v1_0.impl.WsdmNamespaceVersionHolderImpl SPEC_NAMESPACE_SET = new org.apache.ws.muws.v1_0.impl.WsdmNamespaceVersionHolderImpl();
+
+ /**
+ * Creates a new {@link FilesystemService } object.
+ *
+ * @param resourceContext DOCUMENT_ME
+ */
+ public FilesystemService( ResourceContext resourceContext )
+ {
+ super(resourceContext);
+ init();
+ }
+
+ /**
+ * Returns a collection of Spec Namespaces associated with this Service
+ *
+ * @return A NamespaceVersionHolder impl which represents the collection of spec namespaces
+ * associated with this service.
+ */
+ protected org.apache.ws.resource.properties.NamespaceVersionHolder getNamespaceSet()
+ {
+ return SPEC_NAMESPACE_SET;
+ }
+
+ public org.apache.ws.resource.example.filesystem.UnmountResponseDocument unmount(
+ org.apache.ws.resource.example.filesystem.UnmountDocument requestDoc )
+ throws org.apache.ws.resource.example.filesystem.MountDeviceBusyFaultException
+ {
+ try
+ {
+ ( (FilesystemResource) getResource() ).unmount();
+ }
+ catch ( Exception e )
+ {
+ throw new MountDeviceBusyFaultException( getNamespaceSet(), e.getLocalizedMessage() );
+ }
+ org.apache.ws.resource.example.filesystem.UnmountResponseDocument responseDocument = org.apache.ws.resource.example.filesystem.UnmountResponseDocument.Factory.newInstance();
+ org.apache.ws.resource.example.filesystem.UnmountResponseDocument.UnmountResponse response = responseDocument.addNewUnmountResponse();
+ return responseDocument;
+ }
+
+ public org.apache.ws.resource.example.filesystem.MountResponseDocument mount(
+ org.apache.ws.resource.example.filesystem.MountDocument requestDoc )
+ throws org.apache.ws.resource.example.filesystem.MountDeviceBusyFaultException
+ {
+ try
+ {
+ ( (FilesystemResource) getResource() ).mount();
+ }
+ catch ( Exception e )
+ {
+ throw new MountDeviceBusyFaultException( getNamespaceSet(), e.getLocalizedMessage() );
+ }
+ org.apache.ws.resource.example.filesystem.MountResponseDocument responseDocument = org.apache.ws.resource.example.filesystem.MountResponseDocument.Factory.newInstance();
+ org.apache.ws.resource.example.filesystem.MountResponseDocument.MountResponse response = responseDocument.addNewMountResponse();
+ return responseDocument;
+ }
+
+}
Added: webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_deploy.wsdd
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_deploy.wsdd?rev=225200&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_deploy.wsdd (added)
+++ webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_deploy.wsdd Mon Jul 25 15:54:45 2005
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+
+<!-- ***** WARNING: This file will be overwritten during generation. ***** -->
+
+<deployment xmlns="http://xml.apache.org/axis/wsdd/"
+ xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+
+ <service name="Filesystem" provider="java:WSRF" style="document" use="literal">
+
+ <wsdlFile>/wsdl/FileSystem.wsdl</wsdlFile>
+
+ <requestFlow>
+ <handler type="java:org.apache.axis.handlers.JAXRPCHandler">
+ <parameter name="className" value="org.apache.axis.message.addressing.handler.AxisServerSideAddressingHandler" />
+ <parameter name="referencePropertyNames" value="*" />
+ </handler>
+ </requestFlow>
+
+ <responseFlow>
+ <handler type="java:org.apache.axis.handlers.JAXRPCHandler">
+ <parameter name="className" value="org.apache.axis.message.addressing.handler.AxisServerSideAddressingHandler" />
+ <parameter name="referencePropertyNames" value="*" />
+ </handler>
+ </responseFlow>
+
+ </service>
+
+</deployment>
Added: webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_jndi-config.xml
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_jndi-config.xml?rev=225200&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_jndi-config.xml (added)
+++ webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_jndi-config.xml Mon Jul 25 15:54:45 2005
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+
+<!-- ***** WARNING: This file will be overwritten during generation. ***** -->
+
+<jndiConfig xmlns="http://www.apache.org/wsfx/wsrf/jndi/config">
+
+ <service name="Filesystem">
+ <resource name="home" type="org.apache.ws.resource.example.filesystem.FilesystemHome">
+ <resourceParams>
+ <parameter>
+ <name>serviceClassName</name>
+ <value>org.apache.ws.resource.example.filesystem.FilesystemService</value>
+ </parameter>
+ <parameter>
+ <name>resourceClassName</name>
+ <value>org.apache.ws.resource.example.filesystem.FilesystemResource</value>
+ </parameter>
+ <parameter>
+ <name>wsdlTargetNamespace</name>
+ <value>http://ws.apache.org/resource/example/filesystem</value>
+ </parameter>
+ <parameter>
+ <name>resourceIdentifierReferenceParameterName</name>
+ <value>{http://ws.apache.org/resource/example/filesystem}ResourceIdentifier</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+ </service>
+
+</jndiConfig>
+
Added: webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/MountDeviceBusyFaultException.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/MountDeviceBusyFaultException.java?rev=225200&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/MountDeviceBusyFaultException.java (added)
+++ webservices/muse/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/MountDeviceBusyFaultException.java Mon Jul 25 15:54:45 2005
@@ -0,0 +1,46 @@
+
+package org.apache.ws.resource.example.filesystem;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ws.resource.i18n.MessagesImpl;
+import org.apache.ws.util.i18n.Messages;
+import javax.xml.namespace.QName;
+import org.apache.ws.resource.faults.AbstractBaseFaultException;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
+
+/**
+ * **** WARNING: This file will be overwritten during generation ****
+ */
+public class MountDeviceBusyFaultException
+ extends AbstractBaseFaultException
+{
+
+ private static final Messages MSG = MessagesImpl.getInstance();
+ private static final Log LOG = LogFactory.getLog( MountDeviceBusyFaultException.class );
+
+ private QName m_name;
+
+ /**
+ * Constructs a new MountDeviceBusyFaultException .
+ *
+ * @param namespaces
+ * @param faultString
+ */
+ public MountDeviceBusyFaultException( NamespaceVersionHolder namespaces, String faultString )
+ {
+ super( namespaces, faultString );
+ m_name = new QName( "http://ws.apache.org/resource/example/filesystem", "MountDeviceBusyFaultException");
+ }
+
+ /**
+ * Returns the element name for this base fault.
+ *
+ * @return the element name for this base fault
+ */
+ public QName getBaseFaultName()
+ {
+ return m_name;
+ }
+
+}
Modified: webservices/muse/trunk/src/java/org/apache/ws/muws/MuwsUtils.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/java/org/apache/ws/muws/MuwsUtils.java?rev=225200&r1=225199&r2=225200&view=diff
==============================================================================
--- webservices/muse/trunk/src/java/org/apache/ws/muws/MuwsUtils.java (original)
+++ webservices/muse/trunk/src/java/org/apache/ws/muws/MuwsUtils.java Mon Jul 25 15:54:45 2005
@@ -8,6 +8,11 @@
import org.apache.ws.notification.topics.impl.TopicSpaceImpl;
import org.apache.ws.resource.properties.ResourcePropertySet;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URLEncoder;
+import java.io.UnsupportedEncodingException;
+
/**
* @author Sal Campana
*/
@@ -45,5 +50,43 @@
topic.addTopic( RelationshipsCapability.SUBTOPIC_NAME_RELATIONSHIP_DELETED );
return topicSet.addTopicSpace( topicSpace );
}
-
+
+ /**
+ * Converts the specified resource identifier into a URI that can be used as the value
+ * for the MUWS ResourceId property.
+ *
+ * @param resourceId a resource identifier
+ *
+ * @return URI that can be used as the value for the MUWS ResourceId property
+ */
+ public static URI toURI( Object resourceId )
+ {
+ String idString = null;
+ try
+ {
+ idString = URLEncoder.encode( String.valueOf( resourceId ), "UTF-8" );
+ }
+ catch ( UnsupportedEncodingException uee )
+ {
+ throw new IllegalStateException( uee.getLocalizedMessage() );
+ }
+ URI idURI;
+ try
+ {
+ idURI = new URI( idString );
+ }
+ catch ( URISyntaxException urise )
+ {
+ try
+ {
+ idURI = new URI( "urn:" + idString );
+ }
+ catch ( URISyntaxException urise2 )
+ {
+ throw new IllegalStateException( urise2.getLocalizedMessage() );
+ }
+ }
+ return idURI;
+ }
+
}
Modified: webservices/muse/trunk/src/template/build.xml
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/template/build.xml?rev=225200&r1=225199&r2=225200&view=diff
==============================================================================
--- webservices/muse/trunk/src/template/build.xml (original)
+++ webservices/muse/trunk/src/template/build.xml Mon Jul 25 15:54:45 2005
@@ -62,7 +62,7 @@
</wsdls>
</wsdl2Java>
- <delete dir="${tmp.dir}" />
+ <delete dir="${tmp.dir}" failonerror="false" />
</target>
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org