You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrf-commits@ws.apache.org by ip...@apache.org on 2005/09/30 20:29:52 UTC
svn commit: r292834 - in /webservices/wsrf/trunk/src:
examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/
java/org/apache/ws/resource/ java/org/apache/ws/resource/tool/
java/org/apache/ws/resource/tool/velocity/ templates/ test/org/...
Author: ips
Date: Fri Sep 30 11:29:44 2005
New Revision: 292834
URL: http://svn.apache.org/viewcvs?rev=292834&view=rev
Log:
added getNamespaceSet() method to Resource interface
Modified:
webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java
webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
webservices/wsrf/trunk/src/java/org/apache/ws/resource/Resource.java
webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceContext.java
webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java
webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/velocity/ServiceProperties.java
webservices/wsrf/trunk/src/templates/AbstractResource.vm
webservices/wsrf/trunk/src/templates/Resource.vm
webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiResource.java
Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java?rev=292834&r1=292833&r2=292834&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java (original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java Fri Sep 30 11:29:44 2005
@@ -1,6 +1,7 @@
package org.apache.ws.resource.example.filesystem;
import org.apache.ws.addressing.EndpointReference;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
/**
* **** WARNING: This file will be overwritten during generation ****
@@ -15,6 +16,11 @@
{
/**
+ * A NamespaceVerionHolder which maintains the XML namespaces for all specifications supported by this resource.
+ */
+ private static final org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl SPEC_NAMESPACE_SET = new org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl();
+
+ /**
* The unique identifier for this resource.
*/
private String m_id;
@@ -188,6 +194,14 @@
public org.apache.ws.resource.properties.ResourcePropertySet getResourcePropertySet()
{
return m_propSet;
+ }
+
+ /**
+ * @see org.apache.ws.resource.Resource#getNamespaceSet()
+ */
+ public NamespaceVersionHolder getNamespaceSet()
+ {
+ return SPEC_NAMESPACE_SET;
}
}
Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java?rev=292834&r1=292833&r2=292834&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java (original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java Fri Sep 30 11:29:44 2005
@@ -11,11 +11,6 @@
{
- /**
- * A NamespaceVerionHolder which maintains the XML namespaces for all specifications supported by this resource.
- */
- public static final org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl SPEC_NAMESPACE_SET = new org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl();
-
/*
* An mock object representing the filesystem being exposed as a WS-Resource.
*/
Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/Resource.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/Resource.java?rev=292834&r1=292833&r2=292834&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/Resource.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/Resource.java Fri Sep 30 11:29:44 2005
@@ -17,59 +17,67 @@
import org.apache.ws.addressing.EndpointReference;
import org.apache.ws.resource.lifetime.ResourceTerminationListener;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
/**
- * A marker interface for a resource. All resource objects must implement this interface.
+ * A WS-Resource.
*/
public interface Resource
{
- /**
- * Sets the EndpointReference associated with this Resource.
- *
- * @param epr The EndpointReference for the Resource.
- */
- void setEndpointReference( EndpointReference epr );
-
- /**
- * Returns the EndpointReference associated with this Resource.
- *
- * @return The Resource's EndpointReference
- */
- EndpointReference getEndpointReference( );
-
- /**
- * @param id
- *
- * @throws IllegalArgumentException if the specified ID is not the of the correct type for this resource
- * @throws IllegalStateException if this resource's ID has already been set
- */
- void setID( Object id );
-
- /**
- * Returns the unique id of the resource. In most cases, this value should match value returned by {@link
- * ResourceKey#getValue}.
- *
- * @return the id of the resource.
- */
- Object getID( );
-
- /**
- * Adds a listener to be invoked when the resource has been terminated.
- *
- * @param listener
- */
- void addTerminationListener( ResourceTerminationListener listener );
-
- /**
- * Called by the resource home to indicate to a resource that the resource is
- * being taken out of service.
- */
- void destroy( );
-
- /**
- * Called by the resource home to indicate to a resource that the resource is
- * being placed into service. A resource can use this method to initialize
- * its properties or any other state.
- */
- void init( );
+
+ /**
+ * Called by the resource home to indicate to a resource that the resource is being placed into service. A resource
+ * can use this method to initialize its properties or any other state.
+ */
+ void init();
+
+ /**
+ * Called by the resource home to indicate to a resource that the resource is being taken out of service.
+ */
+ void destroy();
+
+ /**
+ * Sets the EndpointReference associated with this Resource.
+ *
+ * @param epr The EndpointReference for the Resource.
+ */
+ void setEndpointReference( EndpointReference epr );
+
+ /**
+ * Returns the EndpointReference associated with this Resource.
+ *
+ * @return The Resource's EndpointReference
+ */
+ EndpointReference getEndpointReference();
+
+ /**
+ * @param id
+ *
+ * @throws IllegalArgumentException if the specified ID is not the of the correct type for this resource
+ * @throws IllegalStateException if this resource's ID has already been set
+ */
+ void setID( Object id );
+
+ /**
+ * Returns the unique id of the resource. In most cases, this value should match value returned by {@link
+ * ResourceKey#getValue}.
+ *
+ * @return the id of the resource.
+ */
+ Object getID();
+
+ /**
+ * Adds a listener to be invoked when the resource has been terminated.
+ *
+ * @param listener
+ */
+ void addTerminationListener( ResourceTerminationListener listener );
+
+ /**
+ * Returns the set of specification namespaces that this resource implements.
+ *
+ * @return the set of specification namespaces that this resource implements
+ */
+ NamespaceVersionHolder getNamespaceSet();
+
}
Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceContext.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceContext.java?rev=292834&r1=292833&r2=292834&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceContext.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceContext.java Fri Sep 30 11:29:44 2005
@@ -29,17 +29,17 @@
public interface ResourceContext
{
/**
- * @see SOAPMessageContext#getProperty(String)
+ * @see javax.xml.rpc.handler.MessageContext#getProperty(String)
*/
public abstract Object getProperty( String name );
/**
- * @see SOAPMessageContext#getPropertyNames()
+ * @see javax.xml.rpc.handler.MessageContext#getPropertyNames()
*/
public abstract Iterator getPropertyNames( );
/**
- * @see SOAPMessageContext#setProperty(String, Object)
+ * @see javax.xml.rpc.handler.MessageContext#setProperty(String, Object)
*/
void setProperty( String name,
Object value );
@@ -100,12 +100,12 @@
URL getServiceURL( );
/**
- * @see SOAPMessageContext#containsProperty(String)
+ * @see javax.xml.rpc.handler.MessageContext#containsProperty(String)
*/
boolean containsProperty( String name );
/**
- * @see SOAPMessageContext#removeProperty(String)
+ * @see javax.xml.rpc.handler.MessageContext#removeProperty(String)
*/
void removeProperty( String name );
}
Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java?rev=292834&r1=292833&r2=292834&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java Fri Sep 30 11:29:44 2005
@@ -75,6 +75,7 @@
*/
public class Wsdl2Java
{
+
private static final Messages MSG = MessagesImpl.getInstance( );
/**
@@ -733,7 +734,7 @@
private void initPortTypeInfoMap( )
{
- //draft 01
+ // WSRF 2004/06
addPortType2JavaInfo( new org.apache.ws.resource.tool.porttype.v2004_06.GetResourcePropertyPortType2JavaInfo( ) );
addPortType2JavaInfo( new org.apache.ws.resource.tool.porttype.v2004_06.GetMultipleResourcePropertiesPortType2JavaInfo( ) );
addPortType2JavaInfo( new org.apache.ws.resource.tool.porttype.v2004_06.SetResourcePropertiesPortType2JavaInfo( ) );
@@ -741,7 +742,7 @@
addPortType2JavaInfo( new org.apache.ws.resource.tool.porttype.v2004_06.ImmediateResourceTerminationPortType2JavaInfo( ) );
addPortType2JavaInfo( new org.apache.ws.resource.tool.porttype.v2004_06.ScheduledResourceTerminationPortType2JavaInfo( ) );
- //draft 05
+ // WSRF 2004/11
addPortType2JavaInfo( new org.apache.ws.resource.tool.porttype.v2004_11.GetResourcePropertyPortType2JavaInfo( ) );
addPortType2JavaInfo( new org.apache.ws.resource.tool.porttype.v2004_11.GetMultipleResourcePropertiesPortType2JavaInfo( ) );
addPortType2JavaInfo( new org.apache.ws.resource.tool.porttype.v2004_11.SetResourcePropertiesPortType2JavaInfo( ) );
@@ -754,7 +755,7 @@
addPortType2JavaInfo( new org.apache.ws.resource.tool.porttype.v2004_11.DeleteResourcePropertiesPortType2JavaInfo( ) );
addPortType2JavaInfo( new org.apache.ws.resource.tool.porttype.v2004_11.GetResourcePropertyDocumentPortType2JavaInfo( ) );
- //metadataexchange 2004/09
+ // WSMEX 2004/09
addPortType2JavaInfo( new org.apache.ws.resource.tool.porttype.v2004_09.MetadataExchangePortType2JavaInfo( ) );
}
Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/velocity/ServiceProperties.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/velocity/ServiceProperties.java?rev=292834&r1=292833&r2=292834&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/velocity/ServiceProperties.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/velocity/ServiceProperties.java Fri Sep 30 11:29:44 2005
@@ -30,8 +30,8 @@
*/
public class ServiceProperties
{
- /** DOCUMENT_ME */
- public static final String SPEC_NAMESPACE_MEMBER_NAME = "SPEC_NAMESPACE_SET";
+
+ private static final String NAMESPACE_SET_CONSTANT_NAME = "SPEC_NAMESPACE_SET";
/** DOCUMENT_ME */
String m_packageName;
@@ -347,9 +347,14 @@
setNamespaceVersionHolderClassName( namespaceValueHolder );
String className = namespaceValueHolder.getName( );
m_namespaceVersionHolder =
- "public static final " + className + " " + SPEC_NAMESPACE_MEMBER_NAME + " = new " + className + "();";
+ "private static final " + className + " " + NAMESPACE_SET_CONSTANT_NAME + " = new " + className + "();";
}
}
+
+ public static String getNamespaceSetConstantName()
+ {
+ return NAMESPACE_SET_CONSTANT_NAME;
+ }
/**
* DOCUMENT_ME
Modified: webservices/wsrf/trunk/src/templates/AbstractResource.vm
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/templates/AbstractResource.vm?rev=292834&r1=292833&r2=292834&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/templates/AbstractResource.vm (original)
+++ webservices/wsrf/trunk/src/templates/AbstractResource.vm Fri Sep 30 11:29:44 2005
@@ -16,7 +16,11 @@
*/
public abstract class Abstract${serviceName}Resource #if($implements) implements ${implements} #end
{
-
+
+ #if($namespaceVersionHolder)
+ $namespaceVersionHolder
+ #end
+
/**
* The resource ID of the instance.
*/
@@ -129,7 +133,14 @@
{
m_endpointReference = epr;
}
-
+
+ /**
+ * @see org.apache.ws.resource.Resource#getNamespaceSet()
+ */
+ public NamespaceVersionHolder getNamespaceSet()
+ {
+ return $namespaceSetConstantName;
+ }
#foreach( $includeFile in $generated.ResourceIncludeFiles )
#include( $includeFile )
Modified: webservices/wsrf/trunk/src/templates/Resource.vm
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/templates/Resource.vm?rev=292834&r1=292833&r2=292834&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/templates/Resource.vm (original)
+++ webservices/wsrf/trunk/src/templates/Resource.vm Fri Sep 30 11:29:44 2005
@@ -14,13 +14,6 @@
{
- #if($namespaceVersionHolder)
- /**
- * A NamespaceVerionHolder which maintains the QNames of Spec Wsdls
- */
- $namespaceVersionHolder
- #end
-
/**
* Initializes this resource's state (properties, etc.).
*/
Modified: webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiResource.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiResource.java?rev=292834&r1=292833&r2=292834&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiResource.java (original)
+++ webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiResource.java Fri Sep 30 11:29:44 2005
@@ -18,6 +18,7 @@
import org.apache.ws.addressing.EndpointReference;
import org.apache.ws.resource.PropertiesResource;
import org.apache.ws.resource.Resource;
+import org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl;
import org.apache.ws.resource.lifetime.ResourceTerminationEvent;
import org.apache.ws.resource.lifetime.ResourceTerminationListener;
import org.apache.ws.resource.lifetime.impl.ResourceTerminationEventImpl;
@@ -154,4 +155,9 @@
public void init( )
{
}
+
+ public NamespaceVersionHolder getNamespaceSet()
+ {
+ return new NamespaceVersionHolderImpl();
+ }
}