You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrf-dev@ws.apache.org by sc...@apache.org on 2004/12/17 20:25:17 UTC

svn commit: r122667 - in incubator/apollo/trunk/src: java/org/apache/ws/resource java/org/apache/ws/resource/impl java/org/apache/ws/resource/lifetime/porttype/impl java/org/apache/ws/resource/properties/impl java/org/apache/ws/resource/properties/porttype/impl java/org/apache/ws/util/jndi java/org/apache/ws/util/lock site/content/tutorial site/content/tutorial/requests site/content/tutorial/src/example/filesystem site/content/tutorial/src/example/filesystem/backend site/content/tutorial/src/example/filesystem/callback site/content/tutorial/src/example/sysprops site/content/xdocs/tutorial test/org/apache/ws/resource/properties webapp/WEB-INF webapp/WEB-INF/classes

Author: scamp
Date: Fri Dec 17 11:25:16 2004
New Revision: 122667

URL: http://svn.apache.org/viewcvs?view=rev&rev=122667
Log:
added sysprops singleton example
Added:
   incubator/apollo/trunk/src/java/org/apache/ws/resource/PropertiesInterface.java
   incubator/apollo/trunk/src/site/content/tutorial/SysProps.wsdl
   incubator/apollo/trunk/src/site/content/tutorial/requests/Copy of QueryResourceProperties_allProps.soap
   incubator/apollo/trunk/src/site/content/tutorial/src/example/sysprops/
   incubator/apollo/trunk/src/site/content/tutorial/src/example/sysprops/AbstractJavaSysPropsService.java
   incubator/apollo/trunk/src/site/content/tutorial/src/example/sysprops/JavaSysPropsHome.java
   incubator/apollo/trunk/src/site/content/tutorial/src/example/sysprops/JavaSysPropsResource.java
   incubator/apollo/trunk/src/site/content/tutorial/src/example/sysprops/JavaSysPropsService.java
Modified:
   incubator/apollo/trunk/src/java/org/apache/ws/resource/AbstractPortType.java
   incubator/apollo/trunk/src/java/org/apache/ws/resource/Resource.java
   incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceContext.java
   incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java
   incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceKey.java
   incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/porttype/impl/ImmediateResourceTerminationPortTypeImpl.java
   incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/porttype/impl/ScheduledResourceTerminationPortTypeImpl.java
   incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/impl/XmlBeansResourceProperty.java
   incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/porttype/impl/AbstractResourcePropertiesPortType.java
   incubator/apollo/trunk/src/java/org/apache/ws/util/jndi/DefaultParameters.java
   incubator/apollo/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java
   incubator/apollo/trunk/src/java/org/apache/ws/util/lock/LockManager.java
   incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/FileSystemHome.java
   incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/FileSystemResource.java
   incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/backend/UnixFileSystem.java
   incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/OptionsCallback.java
   incubator/apollo/trunk/src/site/content/xdocs/tutorial/callback.xml
   incubator/apollo/trunk/src/site/content/xdocs/tutorial/resource.xml
   incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java
   incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiResource.java
   incubator/apollo/trunk/src/webapp/WEB-INF/classes/jndi-config.xml
   incubator/apollo/trunk/src/webapp/WEB-INF/server-config.wsdd

Modified: incubator/apollo/trunk/src/java/org/apache/ws/resource/AbstractPortType.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/AbstractPortType.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/java/org/apache/ws/resource/AbstractPortType.java&r1=122666&p2=incubator/apollo/trunk/src/java/org/apache/ws/resource/AbstractPortType.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/resource/AbstractPortType.java	(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/AbstractPortType.java	Fri Dec 17 11:25:16 2004
@@ -72,7 +72,7 @@
          throw new JAXRPCException( rce );
       }
 
-      LOG.debug( MSG.getMessage(Keys.PORTTYPE_RECIEVED_REQUEST, m_resourceContext.getServiceName(), m_resourceKey.getValue()) );
+      LOG.debug( MSG.getMessage(Keys.PORTTYPE_RECIEVED_REQUEST, m_resourceContext.getServiceName(), String.valueOf(m_resourceKey)) );
       try
       {
          m_resource = ( (ResourceFactory) m_resourceHome ).getInstance( m_resourceContext );

Added: incubator/apollo/trunk/src/java/org/apache/ws/resource/PropertiesInterface.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/PropertiesInterface.java?view=auto&rev=122667
==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/PropertiesInterface.java	Fri Dec 17 11:25:16 2004
@@ -0,0 +1,23 @@
+package org.apache.ws.resource;
+
+import org.apache.ws.resource.properties.ResourcePropertySet;
+
+/**
+ * @author Sal Campana
+ */
+public interface PropertiesInterface
+{
+    /**
+    * Returns this resource's property set.
+    *
+    * @return this resource's property set
+    */
+   ResourcePropertySet getResourcePropertySet(  );
+
+    /**
+    * Sets this resource's property set.
+    *
+    * @param propSet a resource property set
+    */
+   void setResourcePropertySet( ResourcePropertySet propSet );
+}

Modified: incubator/apollo/trunk/src/java/org/apache/ws/resource/Resource.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/Resource.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/java/org/apache/ws/resource/Resource.java&r1=122666&p2=incubator/apollo/trunk/src/java/org/apache/ws/resource/Resource.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/resource/Resource.java	(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/Resource.java	Fri Dec 17 11:25:16 2004
@@ -24,21 +24,8 @@
  */
 public interface Resource
 {
-    /**
-    * Returns this resource's property set.
-    *
-    * @return this resource's property set
-    */
-   ResourcePropertySet getResourcePropertySet(  );
-
-   /**
-    * Sets this resource's property set.
-    *
-    * @param propSet a resource property set
-    */
-   void setResourcePropertySet( ResourcePropertySet propSet );
 
-      /**
+    /**
     * @param id
     *
     * @throws IllegalArgumentException if the specified ID is not the of the correct type for this resource

Modified: incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceContext.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceContext.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceContext.java&r1=122666&p2=incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceContext.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceContext.java	(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceContext.java	Fri Dec 17 11:25:16 2004
@@ -49,6 +49,7 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.lang.reflect.Constructor;
 
 /**
  * LOG-DONE
@@ -236,9 +237,15 @@
           {
               throw new ResourceContextException(e);
           }
-          m_resourceKey = getResourceKey( QName.valueOf(resourceHome.getResourceKeyName()),resourceKeyClass);
+          String resourceKeyName = resourceHome.getResourceKeyName();
+
+          QName resourceKeyQName = resourceKeyName != null ? QName.valueOf(resourceKeyName) : null;
+          m_resourceKey = getResourceKey( resourceKeyQName,resourceKeyClass);
+
       }
-      LOG.debug(MSG.getMessage( Keys.RESOURCE_KEY, m_resourceKey.getValue()));
+
+      LOG.debug(MSG.getMessage( Keys.RESOURCE_KEY, String.valueOf(m_resourceKey)));
+
       return m_resourceKey;
    }
 
@@ -271,8 +278,8 @@
 
       try
       {
-         // TODO: make resource key class configurable, and use reflection to create it here
-         return new SimpleTypeResourceKey( headerElem );
+          Constructor constructor = keyClass.getConstructor(new Class[]{SOAPHeaderElement.class});
+          return (ResourceKey)constructor.newInstance(new Object[]{headerElem});         
       }
       catch ( Exception e )
       {

Modified: incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java&r1=122666&p2=incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java	(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java	Fri Dec 17 11:25:16 2004
@@ -28,6 +28,7 @@
 import org.apache.ws.resource.ResourceException;
 import org.apache.ws.resource.ResourceHome;
 import org.apache.ws.resource.ResourceKey;
+import org.apache.ws.resource.PropertiesInterface;
 import org.apache.ws.resource.i18n.Keys;
 import org.apache.ws.resource.i18n.MessagesImpl;
 import org.apache.ws.resource.lifetime.ScheduledResourceTerminationResource;
@@ -288,16 +289,12 @@
    public Resource find( ResourceKey key )
    throws ResourceException
    {
-      LOG.debug(MSG.getMessage(Keys.FINDING_RESOURCE_WITH_KEY, key.getValue()));
-      if ( key == null )
-      {
-         throw new InvalidResourceKeyException( MSG.getMessage(Keys.NULL_KEY));
-      }
 
-      Resource resource = null;
+      LOG.debug(MSG.getMessage(Keys.FINDING_RESOURCE_WITH_KEY, String.valueOf(key)));
 
-      Lock     lock = m_lockManager.getLock( key );
-      try
+      Resource resource = null;
+      Lock lock = getLock(key);
+       try
       {
          lock.acquire(  );
       }
@@ -322,7 +319,15 @@
       return resource;
    }
 
-   /**
+    private Lock getLock(ResourceKey key)
+    {
+        Lock lock;
+        Object lockKey = getLookupKey(key);
+        lock = m_lockManager.getLock( lockKey );
+        return lock;
+    }
+
+    /**
     * DOCUMENT_ME
     *
     * @throws Exception DOCUMENT_ME
@@ -341,10 +346,7 @@
             m_resourceKeyClassName = String.class;
          }
        */
-      if ( m_resourceKeyName == null )
-      {
-         throw new Exception( MSG.getMessage( Keys.RESOURCE_KEYNAME_NULL) );
-      }
+
 
       if ( m_resourceClassName == null )
       {
@@ -381,14 +383,10 @@
    public void remove( ResourceKey key )
    throws ResourceException
    {
-      if ( key == null )
-      {
-         throw new InvalidResourceKeyException( MSG.getMessage( Keys.NULL_KEY) );
-      }
 
       Resource resource = null;
-      Lock     lock = m_lockManager.getLock( key );
-      try
+      Lock  lock = getLock(key);
+       try
       {
          lock.acquire(  );
       }
@@ -411,9 +409,9 @@
             }
 
 
-         m_resources.remove( key );
+         m_resources.remove( getLookupKey(key) );
 
-         LOG.debug( MSG.getMessage( Keys.REMOVED_RESOURCE_WITH_KEY, resource.getClass(  ).getName(  ) ,key.getValue(  ) ));
+         LOG.debug( MSG.getMessage( Keys.REMOVED_RESOURCE_WITH_KEY, resource.getClass(  ).getName(  ) ,String.valueOf(key) ));
          if ( m_cache != null )
          {
             m_cache.remove( resource );
@@ -447,18 +445,15 @@
     * DOCUMENT_ME
     *
     * @param key DOCUMENT_ME
-    * @param propSet DOCUMENT_ME
-    *
     * @return DOCUMENT_ME
     *
     * @throws ResourceException DOCUMENT_ME
     * @throws IllegalStateException DOCUMENT_ME
     */
-   protected Resource createInstance( ResourceKey         key,
-                                      ResourcePropertySet propSet )
+   protected Resource createInstance(ResourceKey key)
    throws ResourceException
    {
-      LOG.debug(MSG.getMessage( Keys.CREATING_INSTANCE_WITH_KEY, key.getValue()));
+      LOG.debug(MSG.getMessage( Keys.CREATING_INSTANCE_WITH_KEY, String.valueOf(key)));
       Resource resource;
       try
       {
@@ -469,14 +464,7 @@
          throw new ResourceException( e );
       }
 
-      if ( key != null )
-      {
-         resource.setID( key.getValue(  ) );
-      }
-      if ( propSet != null )
-      {
-         ( (Resource) resource ).setResourcePropertySet( propSet );
-      }
+         resource.setID( key != null ? key.getValue() : null );
 
          try
          {
@@ -503,8 +491,8 @@
    protected Resource createNewInstanceAndLoad( ResourceKey key )
    throws ResourceException
    {
-      Resource resource = createInstance( key, null );
-      LOG.debug(MSG.getMessage( Keys.LOADING_RESORUCE_FROM_PERSISTENCE, key.getValue()));
+      Resource resource = createInstance( key);
+      LOG.debug(MSG.getMessage( Keys.LOADING_RESORUCE_FROM_PERSISTENCE, String.valueOf(key)));
       ( (PersistenceCallback) resource ).load( key );
       return resource;
    }
@@ -529,8 +517,8 @@
    private void addResource( ResourceKey key,
                              Resource    resource )
    {
-      LOG.debug(MSG.getMessage( Keys.ADDING_RESOURCE_FOR_KEY, key.getValue()));
-      m_resources.put( key, resource );
+      LOG.debug(MSG.getMessage( Keys.ADDING_RESOURCE_FOR_KEY, String.valueOf(key)));
+      m_resources.put( getLookupKey(key), resource );
 
       // schedule sweeper task if needed
       if ( m_sweeper != null )
@@ -542,8 +530,9 @@
    private Resource get( ResourceKey key )
    throws ResourceException
    {
-      LOG.debug(MSG.getMessage( Keys.GET_RESOURCE_FOR_KEY,key.getValue()));
-      Resource resource = (Resource) m_resources.get( key );
+      LOG.debug(MSG.getMessage( Keys.GET_RESOURCE_FOR_KEY,String.valueOf(key)));
+       Object lookupKey = getLookupKey(key);
+       Resource resource = (Resource) m_resources.get( lookupKey );
       if ( resource == null )
       {
          if ( m_resourceIsPersistent )
@@ -565,7 +554,13 @@
       return resource;
    }
 
-   private void initCachePolicy( Context initialContext )
+    private Object getLookupKey(ResourceKey key)
+    {
+        Object lookupKey = key != null ? key : (Object)this;
+        return lookupKey;
+    }
+
+    private void initCachePolicy( Context initialContext )
    throws NamingException
    {
       if ( m_cacheLocation != null )

Modified: incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceKey.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceKey.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceKey.java&r1=122666&p2=incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceKey.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceKey.java	(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceKey.java	Fri Dec 17 11:25:16 2004
@@ -32,6 +32,7 @@
    private QName  m_name;
    private Object m_value;
 
+
    /**
     * Creates a new AbstractResourceKey.
     *
@@ -42,6 +43,14 @@
    public AbstractResourceKey( QName  name,
                                Object value )
    {
+      if(name == null)
+      {
+          throw new IllegalArgumentException("Name may not be null!");
+      }
+      if(value == null)
+      {
+          throw new IllegalArgumentException("Value may not be null!");
+      }
       m_name     = name;
       m_value    = value;
    }
@@ -59,10 +68,16 @@
                                Class             type )
    throws InvalidResourceKeyException
    {
-      m_name =
-         new QName( headerElem.getElementName(  ).getURI(  ),
-                    headerElem.getElementName(  ).getLocalName(  ) );
-      m_value = deserializeKey( headerElem, type );
+       if(headerElem == null)
+       {
+           throw new IllegalArgumentException("Header element may not be null!");
+       }
+
+           m_name =
+              new QName( headerElem.getElementName(  ).getURI(  ),
+                         headerElem.getElementName(  ).getLocalName(  ) );
+           m_value = deserializeKey( headerElem, type );
+
    }
 
    /**
@@ -128,6 +143,8 @@
       }
 
       AbstractResourceKey otherKey = (AbstractResourceKey) obj;
+
+       //todo this will throw null pointer for singleton!
       return m_name.equals( otherKey.m_name ) && m_value.equals( otherKey.m_value );
    }
 
@@ -137,7 +154,7 @@
     * @return DOCUMENT_ME
     */
    public int hashCode(  )
-   {
+   {    //todo this will throw null pointer for singleton!
       return m_name.hashCode(  ) + m_value.hashCode(  );
    }
 
@@ -147,7 +164,7 @@
     * @return DOCUMENT_ME
     */
    public String toString(  )
-   {
+   {      //todo this will throw null pointer for singleton!
       return m_name + "=" + m_value + " (type=" + m_value.getClass(  ).getName(  ) + ")";
    }
 

Modified: incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/porttype/impl/ImmediateResourceTerminationPortTypeImpl.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/porttype/impl/ImmediateResourceTerminationPortTypeImpl.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/porttype/impl/ImmediateResourceTerminationPortTypeImpl.java&r1=122666&p2=incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/porttype/impl/ImmediateResourceTerminationPortTypeImpl.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/porttype/impl/ImmediateResourceTerminationPortTypeImpl.java	(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/porttype/impl/ImmediateResourceTerminationPortTypeImpl.java	Fri Dec 17 11:25:16 2004
@@ -63,7 +63,7 @@
    public DestroyResponseDocument destroy( DestroyDocument requestDoc )
    {
       LOG.debug( MSG.getMessage( Keys.DESTROYING_RESOURCE ,getResourceContext(  ).getServiceName(  ) ,
-                 getResourceKey(  ).getValue(  )) );
+                 String.valueOf(getResourceKey(  ))) );
       try
       {
          getResourceHome(  ).remove( getResourceKey(  ) );

Modified: incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/porttype/impl/ScheduledResourceTerminationPortTypeImpl.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/porttype/impl/ScheduledResourceTerminationPortTypeImpl.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/porttype/impl/ScheduledResourceTerminationPortTypeImpl.java&r1=122666&p2=incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/porttype/impl/ScheduledResourceTerminationPortTypeImpl.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/porttype/impl/ScheduledResourceTerminationPortTypeImpl.java	(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/porttype/impl/ScheduledResourceTerminationPortTypeImpl.java	Fri Dec 17 11:25:16 2004
@@ -104,7 +104,7 @@
    private void destroyResource(  )
    {
       LOG.debug( MSG.getMessage( Keys.DESTROYING_RESOURCE,getResourceContext(  ).getServiceName(  ),
-                 getResourceKey(  ).getValue(  )) );
+                 String.valueOf( getResourceKey(  ))) );
       try
       {
          getResourceHome(  ).remove( getResourceKey(  ) );

Modified: incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/impl/XmlBeansResourceProperty.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/impl/XmlBeansResourceProperty.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/impl/XmlBeansResourceProperty.java&r1=122666&p2=incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/impl/XmlBeansResourceProperty.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/impl/XmlBeansResourceProperty.java	(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/impl/XmlBeansResourceProperty.java	Fri Dec 17 11:25:16 2004
@@ -57,7 +57,7 @@
     * @param metaData DOCUMENT_ME
     * @param propSet  DOCUMENT_ME
     */
-   XmlBeansResourceProperty( ResourcePropertyMetaData    metaData,
+   public XmlBeansResourceProperty( ResourcePropertyMetaData    metaData,
                              XmlBeansResourcePropertySet propSet )
    {
       m_metaData    = metaData;

Modified: incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/porttype/impl/AbstractResourcePropertiesPortType.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/porttype/impl/AbstractResourcePropertiesPortType.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/porttype/impl/AbstractResourcePropertiesPortType.java&r1=122666&p2=incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/porttype/impl/AbstractResourcePropertiesPortType.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/porttype/impl/AbstractResourcePropertiesPortType.java	(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/porttype/impl/AbstractResourcePropertiesPortType.java	Fri Dec 17 11:25:16 2004
@@ -18,6 +18,7 @@
 import org.apache.ws.resource.AbstractPortType;
 import org.apache.ws.resource.Resource;
 import org.apache.ws.resource.ResourceContext;
+import org.apache.ws.resource.PropertiesInterface;
 import org.apache.ws.resource.i18n.Keys;
 import org.apache.ws.resource.i18n.MessagesImpl;
 import org.apache.ws.resource.properties.ResourceProperty;
@@ -55,12 +56,12 @@
     */
    protected final ResourcePropertySet getProperties(  )
    {
-      if ( !( getResource(  ) instanceof Resource ) )
+      if ( !( getResource(  ) instanceof PropertiesInterface ) )
       {
          throw new JAXRPCException( MSG.getMessage( Keys.CALL_WSRP_OP_ON_NOPROP) );
       }
 
-      return ( (Resource) getResource(  ) ).getResourcePropertySet(  );
+      return ( (PropertiesInterface) getResource(  ) ).getResourcePropertySet(  );
    }
 
    protected void refreshAllProperties()

Modified: incubator/apollo/trunk/src/java/org/apache/ws/util/jndi/DefaultParameters.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/util/jndi/DefaultParameters.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/java/org/apache/ws/util/jndi/DefaultParameters.java&r1=122666&p2=incubator/apollo/trunk/src/java/org/apache/ws/util/jndi/DefaultParameters.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/util/jndi/DefaultParameters.java	(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/util/jndi/DefaultParameters.java	Fri Dec 17 11:25:16 2004
@@ -11,7 +11,7 @@
 public class DefaultParameters
 {
     private String m_defaultFactory = org.apache.ws.util.jndi.BeanFactory.class.getName();
-    private String m_defaultResourceKeyName = "ResourceId";
+
     private String m_defaultResourceKeyClassName = org.apache.ws.resource.impl.SimpleTypeResourceKey.class.getName();
 
     public String getFactory()
@@ -22,16 +22,6 @@
     public void setFactory(String defaultFactory)
     {
         m_defaultFactory = defaultFactory;
-    }
-
-    public String getResourceKeyName()
-    {
-        return m_defaultResourceKeyName;
-    }
-
-    public void setResourceKeyName(String resourceKeyName)
-    {
-        m_defaultResourceKeyName = resourceKeyName;
     }
 
     public String getResourceKeyClassName()

Modified: incubator/apollo/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java&r1=122666&p2=incubator/apollo/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java	(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java	Fri Dec 17 11:25:16 2004
@@ -349,9 +349,7 @@
 
    private static void validateParameterValues( ResourceParameters params )
    {
-      checkValueIsNonEmpty( params, PROP_FACTORY );
-      checkValueIsNonEmpty( params, PROP_RESOURCE_KEY_CLASS_NAME );
-      checkValueIsNonEmpty( params, PROP_RESOURCE_KEY_NAME );
+      checkValueIsNonEmpty( params, PROP_FACTORY );      
    }
 
    private static void checkValueIsNonEmpty( ResourceParameters params, String paramName )
@@ -373,10 +371,7 @@
       {
          params.addParameter( PROP_RESOURCE_KEY_CLASS_NAME, s_defaultProperties.getResourceKeyClassName() );
       }
-      if ( params.getParameter( PROP_RESOURCE_KEY_NAME ) == null )
-      {
-         params.addParameter( PROP_RESOURCE_KEY_NAME, s_defaultProperties.getResourceKeyName() );
-      }
+
    }
 
    private static Resource[] getResourceArray( ResourceDocument.Resource[] resourceArray )
@@ -595,10 +590,6 @@
                   if ( PROP_FACTORY.equals( name ) )
                   {
                      defaults.setFactory( value );
-                  }
-                  else if ( PROP_RESOURCE_KEY_NAME.equals( name ) )
-                  {
-                     defaults.setResourceKeyName( value );
                   }
                   else if ( PROP_RESOURCE_KEY_CLASS_NAME.equals( name ) )
                   {

Modified: incubator/apollo/trunk/src/java/org/apache/ws/util/lock/LockManager.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/util/lock/LockManager.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/java/org/apache/ws/util/lock/LockManager.java&r1=122666&p2=incubator/apollo/trunk/src/java/org/apache/ws/util/lock/LockManager.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/util/lock/LockManager.java	(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/util/lock/LockManager.java	Fri Dec 17 11:25:16 2004
@@ -51,6 +51,7 @@
     */
    public synchronized Lock getLock( Object key )
    {
+
       LOG.trace(MSG.getMessage( Keys.GET_LOCK_FOR_KEY,key));
       Lock lock = (Lock) m_locks.get( key );
       if ( lock == null )

Added: incubator/apollo/trunk/src/site/content/tutorial/SysProps.wsdl
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/tutorial/SysProps.wsdl?view=auto&rev=122667
==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/src/site/content/tutorial/SysProps.wsdl	Fri Dec 17 11:25:16 2004
@@ -0,0 +1,106 @@
+<?xml version="1.0"?>
+<definitions name="JavaSystemPropertiesResourceDefinition" targetNamespace="http://ws.apache.org/resource/example/sysprops" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://ws.apache.org/resource/example/sysprops" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd" xmlns:wsrpw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl">
+	<import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl" location="../spec/wsrf/WS-ResourceProperties-1_2.wsdl"/>
+	<types>
+		<schema elementFormDefault="qualified" targetNamespace="http://ws.apache.org/resource/example/sysprops" xmlns="http://www.w3.org/2001/XMLSchema">
+			<!-- Resource Properties Document Schema -->
+			<element name="JavaSystemProperties">
+				<complexType>
+        				<sequence>
+						<any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/>
+				      </sequence>
+				</complexType>
+			</element>
+			<!-- ====== Message Types for Custom Operations  ======= -->
+		</schema>
+	</types>
+	<!-- ============= Message Definitions for Custom Operations ============= -->
+	<portType name="JavaSystemPropertiesPortType" wsrp:ResourceProperties="tns:JavaSystemProperties">
+		<!-- wsrp:* operations -->
+		<operation name="GetResourceProperty">
+			<input name="GetResourcePropertyRequest" message="wsrpw:GetResourcePropertyRequest"/>
+			<output name="GetResourcePropertyResponse" message="wsrpw:GetResourcePropertyResponse"/>
+			<fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault"/>
+			<fault name="InvalidResourcePropertyQNameFault" message="wsrpw:InvalidResourcePropertyQNameFault"/>
+		</operation>
+		<operation name="GetMultipleResourceProperties">
+			<input name="GetMultipleResourcePropertiesRequest" message="wsrpw:GetMultipleResourcePropertiesRequest"/>
+			<output name="GetMultipleResourcePropertiesResponse" message="wsrpw:GetMultipleResourcePropertiesResponse"/>
+			<fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault"/>
+			<fault name="InvalidResourcePropertyQNameFault" message="wsrpw:InvalidResourcePropertyQNameFault"/>
+		</operation>
+		<operation name="QueryResourceProperties">
+			<input name="QueryResourcePropertiesRequest" message="wsrpw:QueryResourcePropertiesRequest"/>
+			<output name="QueryResourcePropertiesResponse" message="wsrpw:QueryResourcePropertiesResponse"/>
+			<fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault"/>
+			<fault name="InvalidResourcePropertyQNameFault" message="wsrpw:InvalidResourcePropertyQNameFault"/>
+			<fault name="UnknownQueryExpressionDialectFault" message="wsrpw:UnknownQueryExpressionDialectFault"/>
+			<fault name="InvalidQueryExpressionFault" message="wsrpw:InvalidQueryExpressionFault"/>
+			<fault name="QueryEvaluationErrorFault" message="wsrpw:QueryEvaluationErrorFault"/>
+		</operation>
+	</portType>
+	<binding name="JavaSystemPropertiesSoapHttpBinding" type="tns:JavaSystemPropertiesPortType">
+		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+		<!-- wsrp:* operations -->
+		<operation name="GetResourceProperty">
+			<soap:operation style="document"/>
+			<input>
+				<soap:body use="literal"/>
+			</input>
+			<output>
+				<soap:body use="literal"/>
+			</output>
+			<fault name="ResourceUnknownFault">
+				<soap:fault name="ResourceUnknownFault" use="literal"/>
+			</fault>
+			<fault name="InvalidResourcePropertyQNameFault">
+				<soap:fault name="InvalidResourcePropertyQNameFault" use="literal"/>
+			</fault>
+		</operation>
+		<operation name="GetMultipleResourceProperties">
+			<soap:operation style="document"/>
+			<input>
+				<soap:body use="literal"/>
+			</input>
+			<output>
+				<soap:body use="literal"/>
+			</output>
+			<fault name="ResourceUnknownFault">
+				<soap:fault name="ResourceUnknownFault" use="literal"/>
+			</fault>
+			<fault name="InvalidResourcePropertyQNameFault">
+				<soap:fault name="InvalidResourcePropertyQNameFault" use="literal"/>
+			</fault>
+		</operation>
+		<operation name="QueryResourceProperties">
+			<soap:operation style="document"/>
+			<input>
+				<soap:body use="literal"/>
+			</input>
+			<output>
+				<soap:body use="literal"/>
+			</output>
+			<fault name="ResourceUnknownFault">
+				<soap:fault name="ResourceUnknownFault" use="literal"/>
+			</fault>
+			<fault name="InvalidResourcePropertyQNameFault">
+				<soap:fault name="InvalidResourcePropertyQNameFault" use="literal"/>
+			</fault>
+			<fault name="UnknownQueryExpressionDialectFault">
+				<soap:fault name="UnknownQueryExpressionDialectFault" use="literal"/>
+			</fault>
+			<fault name="InvalidQueryExpressionFault">
+				<soap:fault name="InvalidQueryExpressionFault" use="literal"/>
+			</fault>
+			<fault name="QueryEvaluationErrorFault">
+				<soap:fault name="QueryEvaluationErrorFault" use="literal"/>
+			</fault>
+		</operation>
+	</binding>
+	<service name="JavaSystemPropertiesService">
+		<!-- Note: the port name becomes the service name in the wsdd generated by Axis Wsdl2Java -->
+		<port name="sysprops" binding="tns:JavaSystemPropertiesSoapHttpBinding">
+			<soap:address location="http://localhost:8080/wsrf/services/sysprops"/>
+		</port>
+	</service>
+</definitions>

Added: incubator/apollo/trunk/src/site/content/tutorial/requests/Copy of QueryResourceProperties_allProps.soap
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/tutorial/requests/Copy%20of%20QueryResourceProperties_allProps.soap?view=auto&rev=122667
==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/src/site/content/tutorial/requests/Copy of QueryResourceProperties_allProps.soap	Fri Dec 17 11:25:16 2004
@@ -0,0 +1,15 @@
+<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" 
+          xmlns:fs="http://ws.apache.org/resource/example/sysprops">
+
+   <Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
+      <wsa:To mustUnderstand="1">http://localhost:8080/wsrf/services/sysprops</wsa:To>
+      <wsa:Action mustUnderstand="1">http://ws.apache.org/resource/example/sysprops/FileSystemPortType/yourWsdlRequestName</wsa:Action>
+   </Header>
+
+   <Body>
+      <wsrp:QueryResourceProperties xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd">
+         <wsrp:QueryExpression Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">*</wsrp:QueryExpression>
+      </wsrp:QueryResourceProperties>
+   </Body>
+
+</Envelope>

Modified: incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/FileSystemHome.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/FileSystemHome.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/FileSystemHome.java&r1=122666&p2=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/FileSystemHome.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/FileSystemHome.java	(original)
+++ incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/FileSystemHome.java	Fri Dec 17 11:25:16 2004
@@ -83,13 +83,14 @@
         catch ( ResourceException re )
         {
             Object id = key.getValue();
-            if ( id.equals( "1234" ) || id.equals( "5678" ) )
+            /**
+             * Determine if the passed-in key is, in fact, something we expect.
+             */
+            if ( id.equals( "/dev/vg00/lvol1" ) || id.equals( "/dev/vg00/lvol2" ) )
             {
                 try
                 {
-                    FileSystemPropertiesDocument propDoc = FileSystemPropertiesDocument.Factory.newInstance();
-                    ResourcePropertySet propSet = new XmlBeansResourcePropertySet( propDoc );
-                    resource = createInstance( key, propSet );
+                    resource = createInstance( key);
                 }
                 catch ( Exception e )
                 {

Modified: incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/FileSystemResource.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/FileSystemResource.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/FileSystemResource.java&r1=122666&p2=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/FileSystemResource.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/FileSystemResource.java	(original)
+++ incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/FileSystemResource.java	Fri Dec 17 11:25:16 2004
@@ -15,31 +15,32 @@
  *=============================================================================*/
 package example.filesystem;
 
+import example.filesystem.backend.FileSystem;
+import example.filesystem.backend.UnixFileSystem;
+import example.filesystem.callback.BackupFrequencyCallback;
+import example.filesystem.callback.CommentCallback;
+import example.filesystem.callback.FsckPassNumberCallback;
+import example.filesystem.callback.MountPointCallback;
+import example.filesystem.callback.OptionsCallback;
+import org.apache.ws.resource.PropertiesInterface;
 import org.apache.ws.resource.Resource;
-import org.apache.ws.resource.example.filesystem.DeviceSpecialFileDocument;
-import org.apache.ws.resource.example.filesystem.TypeDocument;
 import org.apache.ws.resource.example.filesystem.BackupFrequencyDocument;
 import org.apache.ws.resource.example.filesystem.CommentDocument;
+import org.apache.ws.resource.example.filesystem.DeviceSpecialFileDocument;
+import org.apache.ws.resource.example.filesystem.FileSystemPropertiesDocument;
 import org.apache.ws.resource.example.filesystem.FsckPassNumberDocument;
 import org.apache.ws.resource.example.filesystem.MountPointDirectoryDocument;
 import org.apache.ws.resource.example.filesystem.OptionsDocument;
+import org.apache.ws.resource.example.filesystem.TypeDocument;
 import org.apache.ws.resource.lifetime.ResourceLifetime1_2Constants;
 import org.apache.ws.resource.lifetime.ScheduledResourceTerminationResource;
+import org.apache.ws.resource.properties.ResourceProperty;
 import org.apache.ws.resource.properties.ResourcePropertySet;
 import org.apache.ws.resource.properties.ResourcePropertyUtils;
-import org.apache.ws.resource.properties.ResourceProperty;
-
+import org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySet;
 import java.util.Calendar;
-import java.util.Map;
 import java.util.List;
-
-import example.filesystem.callback.BackupFrequencyCallback;
-import example.filesystem.callback.CommentCallback;
-import example.filesystem.callback.FsckPassNumberCallback;
-import example.filesystem.callback.MountPointCallback;
-import example.filesystem.callback.OptionsCallback;
-import example.filesystem.backend.FileSystem;
-import example.filesystem.backend.UnixFileSystem;
+import java.util.Map;
 
 /**
  * A filesystem WS-Resource.
@@ -50,13 +51,15 @@
  * @author Sal Campana
  */
 public class FileSystemResource
-      implements Resource,
-      ScheduledResourceTerminationResource
+   implements Resource,
+              PropertiesInterface,
+              ScheduledResourceTerminationResource
 {
    /**
     * This bean represents our "backend" for the resource.
     */
-   private FileSystem m_fileSystem = new UnixFileSystem();
+   private FileSystem m_fileSystem;
+
    /**
     * The resource ID of the instance.
     */
@@ -72,10 +75,10 @@
     *
     * @return Calendar
     */
-   public Calendar getCurrentTime()
+   public Calendar getCurrentTime(  )
    {
-      return ResourcePropertyUtils.getDateTimeProperty( getResourcePropertySet(),
-            ResourceLifetime1_2Constants.PROP_QNAME_CURRENT_TIME );
+      return ResourcePropertyUtils.getDateTimeProperty( getResourcePropertySet(  ),
+                                                        ResourceLifetime1_2Constants.PROP_QNAME_CURRENT_TIME );
    }
 
    /**
@@ -105,81 +108,25 @@
     *
     * @return DOCUMENT_ME
     */
-   public Object getID()
+   public Object getID(  )
    {
       return m_id;
    }
 
-    public void destroy()
-    {
-
-    }
-
-    public void init()
-    {
-        /**
-         * Here we utilize the init() method to setup our callback objects.
-         */
-       ResourceProperty prop = m_propSet.get( FileSystemPropertyQNames.DEVICE_SPECIAL_FILE );
-        DeviceSpecialFileDocument deviceDocXBean = DeviceSpecialFileDocument.Factory.newInstance();
-        deviceDocXBean.setDeviceSpecialFile( m_fileSystem.getDeviceSpecialFile() );
-        prop.add( deviceDocXBean );
-
-        prop = m_propSet.get( FileSystemPropertyQNames.TYPE );
-        TypeDocument typeDocXBean = TypeDocument.Factory.newInstance();
-        typeDocXBean.setType( m_fileSystem.getType() );
-        prop.add( typeDocXBean );
-
-        BackupFrequencyDocument backupDocXBean = BackupFrequencyDocument.Factory.newInstance();
-        backupDocXBean.setBackupFrequency( m_fileSystem.getBackupFrequency() );
-        prop = m_propSet.get( FileSystemPropertyQNames.BACKUP_FREQUENCY );
-        prop.add( backupDocXBean );
-        prop.setCallback( new BackupFrequencyCallback( m_fileSystem ) );
-
-        CommentDocument commentDocXBean = CommentDocument.Factory.newInstance();
-        commentDocXBean.setComment( m_fileSystem.getComment() );
-        prop = m_propSet.get( FileSystemPropertyQNames.COMMENT );
-        prop.add( commentDocXBean );
-        prop.setCallback( new CommentCallback( m_fileSystem ) );
-
-        FsckPassNumberDocument fsckDocXBean = FsckPassNumberDocument.Factory.newInstance();
-        fsckDocXBean.setFsckPassNumber( m_fileSystem.getFsckPassNumber() );
-        prop = m_propSet.get( FileSystemPropertyQNames.FSCK_PASS_NUMBER );
-        prop.add( fsckDocXBean );
-        prop.setCallback( new FsckPassNumberCallback( m_fileSystem ) );
-
-        MountPointDirectoryDocument mountPointDocXBean = MountPointDirectoryDocument.Factory.newInstance();
-        mountPointDocXBean.setMountPointDirectory( m_fileSystem.getMountPoint() );
-        prop = m_propSet.get( FileSystemPropertyQNames.MOUNT_POINT_DIR );
-        prop.add( mountPointDocXBean );
-        prop.setCallback( new MountPointCallback( m_fileSystem ) );
-
-        OptionsDocument optionsDocXBean = OptionsDocument.Factory.newInstance();
-        org.apache.ws.resource.example.filesystem.OptionsDocument.Options options = optionsDocXBean.addNewOptions();
-        List backendOptions = m_fileSystem.getOptions();
-        for ( int i = 0; i < backendOptions.size(); i++ )
-        {
-            options.addOption( (String) backendOptions.get( i ) );
-        }
-        prop = m_propSet.get( FileSystemPropertyQNames.OPTIONS );
-        prop.add( optionsDocXBean );
-        prop.setCallback( new OptionsCallback( m_fileSystem ) );
-    }
-
-    /**
-    * @see org.apache.ws.resource.Resource#getResourcePropertySet()
+   /**
+    * @see PropertiesInterface#setResourcePropertySet(org.apache.ws.resource.properties.ResourcePropertySet)
     */
-   public ResourcePropertySet getResourcePropertySet()
+   public void setResourcePropertySet( ResourcePropertySet propSet )
    {
-      return m_propSet;
+      m_propSet = propSet;
    }
 
    /**
-    * @see Resource#setResourcePropertySet(org.apache.ws.resource.properties.ResourcePropertySet)
+    * @see org.apache.ws.resource.PropertiesInterface#getResourcePropertySet()
     */
-   public void setResourcePropertySet( ResourcePropertySet propSet )
+   public ResourcePropertySet getResourcePropertySet(  )
    {
-      m_propSet = propSet;
+      return m_propSet;
    }
 
    /**
@@ -189,9 +136,9 @@
     */
    public void setTerminationTime( Calendar time )
    {
-      ResourcePropertyUtils.setDateTimeProperty( getResourcePropertySet(),
-            ResourceLifetime1_2Constants.PROP_QNAME_TERMINATION_TIME,
-            time );
+      ResourcePropertyUtils.setDateTimeProperty( getResourcePropertySet(  ),
+                                                 ResourceLifetime1_2Constants.PROP_QNAME_TERMINATION_TIME,
+                                                 time );
    }
 
    /**
@@ -199,20 +146,93 @@
     *
     * @return DOCUMENT_ME
     */
-   public Calendar getTerminationTime()
+   public Calendar getTerminationTime(  )
+   {
+      return ResourcePropertyUtils.getDateTimeProperty( getResourcePropertySet(  ),
+                                                        ResourceLifetime1_2Constants.PROP_QNAME_TERMINATION_TIME );
+   }
+
+   /**
+    * DOCUMENT_ME
+    */
+   public void destroy(  )
    {
-      return ResourcePropertyUtils.getDateTimeProperty( getResourcePropertySet(),
-            ResourceLifetime1_2Constants.PROP_QNAME_TERMINATION_TIME );
    }
 
    /**
     * DOCUMENT_ME
     */
-   public void refreshCurrentTime()
+   public void init(  )
    {
-      ResourcePropertyUtils.setDateTimeProperty( getResourcePropertySet(),
-            ResourceLifetime1_2Constants.PROP_QNAME_CURRENT_TIME,
-            Calendar.getInstance() );
+      /**
+       * This is where you should associate the backend instance with
+       * the resource instance for a given id.
+       */
+      m_fileSystem = new UnixFileSystem( m_id );
+
+      FileSystemPropertiesDocument propDoc = FileSystemPropertiesDocument.Factory.newInstance(  );
+      m_propSet = new XmlBeansResourcePropertySet( propDoc );
+
+      /**
+       * Here we utilize the init() method to setup our callback objects.
+       */
+      ResourceProperty          prop           = m_propSet.get( FileSystemPropertyQNames.DEVICE_SPECIAL_FILE );
+      DeviceSpecialFileDocument deviceDocXBean = DeviceSpecialFileDocument.Factory.newInstance(  );
+      deviceDocXBean.setDeviceSpecialFile( m_fileSystem.getDeviceSpecialFile(  ) );
+      prop.add( deviceDocXBean );
+
+      prop = m_propSet.get( FileSystemPropertyQNames.TYPE );
+      TypeDocument typeDocXBean = TypeDocument.Factory.newInstance(  );
+      typeDocXBean.setType( m_fileSystem.getType(  ) );
+      prop.add( typeDocXBean );
+
+      BackupFrequencyDocument backupDocXBean = BackupFrequencyDocument.Factory.newInstance(  );
+      backupDocXBean.setBackupFrequency( m_fileSystem.getBackupFrequency(  ) );
+      prop = m_propSet.get( FileSystemPropertyQNames.BACKUP_FREQUENCY );
+      prop.add( backupDocXBean );
+      prop.setCallback( new BackupFrequencyCallback( m_fileSystem ) );
+
+      CommentDocument commentDocXBean = CommentDocument.Factory.newInstance(  );
+      commentDocXBean.setComment( m_fileSystem.getComment(  ) );
+      prop = m_propSet.get( FileSystemPropertyQNames.COMMENT );
+      prop.add( commentDocXBean );
+      prop.setCallback( new CommentCallback( m_fileSystem ) );
+
+      FsckPassNumberDocument fsckDocXBean = FsckPassNumberDocument.Factory.newInstance(  );
+      fsckDocXBean.setFsckPassNumber( m_fileSystem.getFsckPassNumber(  ) );
+      prop = m_propSet.get( FileSystemPropertyQNames.FSCK_PASS_NUMBER );
+      prop.add( fsckDocXBean );
+      prop.setCallback( new FsckPassNumberCallback( m_fileSystem ) );
+
+      MountPointDirectoryDocument mountPointDocXBean = MountPointDirectoryDocument.Factory.newInstance(  );
+      mountPointDocXBean.setMountPointDirectory( m_fileSystem.getMountPoint(  ) );
+      prop = m_propSet.get( FileSystemPropertyQNames.MOUNT_POINT_DIR );
+      prop.add( mountPointDocXBean );
+      prop.setCallback( new MountPointCallback( m_fileSystem ) );
+
+      OptionsDocument                                                   optionsDocXBean =
+         OptionsDocument.Factory.newInstance(  );
+      org.apache.ws.resource.example.filesystem.OptionsDocument.Options options        =
+         optionsDocXBean.addNewOptions(  );
+      List                                                              backendOptions =
+         m_fileSystem.getOptions(  );
+      for ( int i = 0; i < backendOptions.size(  ); i++ )
+      {
+         options.addOption( (String) backendOptions.get( i ) );
+      }
+
+      prop = m_propSet.get( FileSystemPropertyQNames.OPTIONS );
+      prop.add( optionsDocXBean );
+      prop.setCallback( new OptionsCallback( m_fileSystem ) );
    }
 
+   /**
+    * DOCUMENT_ME
+    */
+   public void refreshCurrentTime(  )
+   {
+      ResourcePropertyUtils.setDateTimeProperty( getResourcePropertySet(  ),
+                                                 ResourceLifetime1_2Constants.PROP_QNAME_CURRENT_TIME,
+                                                 Calendar.getInstance(  ) );
+   }
 }

Modified: incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/backend/UnixFileSystem.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/backend/UnixFileSystem.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/backend/UnixFileSystem.java&r1=122666&p2=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/backend/UnixFileSystem.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/backend/UnixFileSystem.java	(original)
+++ incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/backend/UnixFileSystem.java	Fri Dec 17 11:25:16 2004
@@ -20,8 +20,9 @@
     private String m_comment="user files";
     private String m_deviceSpecialFile = "/dev/vg00/lvol7";
 
-    public UnixFileSystem()
+    public UnixFileSystem(String devicePath)
     {
+        m_deviceSpecialFile = devicePath;
         m_options = new ArrayList();
         m_options.add("delaylog");
         m_options.add("quota");

Modified: incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/OptionsCallback.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/OptionsCallback.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/OptionsCallback.java&r1=122666&p2=incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/OptionsCallback.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/OptionsCallback.java	(original)
+++ incubator/apollo/trunk/src/site/content/tutorial/src/example/filesystem/callback/OptionsCallback.java	Fri Dec 17 11:25:16 2004
@@ -73,9 +73,8 @@
    {
       Iterator iterator = prop.iterator(  );
       while ( iterator.hasNext(  ) )
-      { //todo not sure if this will return an array of strings or options....
+      {
          OptionsDocument.Options o = (OptionsDocument.Options) iterator.next(  );
-
          clearOptionsFromProperty( o );
 
          //add current options...

Added: incubator/apollo/trunk/src/site/content/tutorial/src/example/sysprops/AbstractJavaSysPropsService.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/tutorial/src/example/sysprops/AbstractJavaSysPropsService.java?view=auto&rev=122667
==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/src/site/content/tutorial/src/example/sysprops/AbstractJavaSysPropsService.java	Fri Dec 17 11:25:16 2004
@@ -0,0 +1,88 @@
+package example.sysprops;
+
+import org.apache.ws.resource.properties.porttype.QueryResourcePropertiesPortType;
+import org.apache.ws.resource.properties.porttype.GetMultipleResourcePropertiesPortType;
+import org.apache.ws.resource.properties.porttype.GetResourcePropertyPortType;
+import org.apache.ws.resource.properties.porttype.impl.GetResourcePropertyProvider;
+import org.apache.ws.resource.properties.porttype.impl.QueryResourcePropertiesProvider;
+import org.apache.ws.resource.properties.porttype.impl.GetMultipleResourcePropertiesProvider;
+import org.apache.ws.resource.handler.WsrfService;
+import org.apache.ws.resource.handler.SoapMethodNameMap;
+import org.apache.ws.resource.handler.ServiceSoapMethodNameMap;
+import org.apache.ws.resource.ResourceContext;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetResourcePropertyResponseDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetResourcePropertyDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetMultipleResourcePropertiesResponseDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetMultipleResourcePropertiesDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.QueryResourcePropertiesResponseDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.QueryResourcePropertiesDocument;
+
+
+/**
+ * @author Sal Campana
+ */
+public abstract class AbstractJavaSysPropsService  implements WsrfService,
+                                                     GetResourcePropertyPortType,
+                                                     GetMultipleResourcePropertiesPortType,
+                                                     QueryResourcePropertiesPortType
+{
+
+    public static final String TARGET_NSURI = "http://ws.apache.org/resource/example/sysprops";
+    public static final String TARGET_NSPREFIX = "sp";
+
+       /**
+        * DOCUMENT_ME
+        */
+    private ServiceSoapMethodNameMap m_methodNameMap;
+
+    public SoapMethodNameMap getMethodNameMap()
+    {
+        return m_methodNameMap;
+    }
+
+    public abstract ResourceContext getResourceContext();
+
+    public void init()
+    {
+        m_methodNameMap = new ServiceSoapMethodNameMap(getResourceContext());
+    }
+
+    /**
+       * DOCUMENT_ME
+       *
+       * @param requestDoc DOCUMENT_ME
+       *
+       * @return DOCUMENT_ME
+       */
+      public GetMultipleResourcePropertiesResponseDocument getMultipleResourceProperties( GetMultipleResourcePropertiesDocument requestDoc )
+      {
+         return new GetMultipleResourcePropertiesProvider( getResourceContext(  ) ).getMultipleResourceProperties( requestDoc );
+      }
+
+
+      /**
+       * DOCUMENT_ME
+       *
+       * @param requestDoc DOCUMENT_ME
+       *
+       * @return DOCUMENT_ME
+       */
+      public GetResourcePropertyResponseDocument getResourceProperty( GetResourcePropertyDocument requestDoc )
+      {
+         return new GetResourcePropertyProvider( getResourceContext(  ) ).getResourceProperty( requestDoc );
+      }
+
+
+      /**
+       * DOCUMENT_ME
+       *
+       * @param requestDoc DOCUMENT_ME
+       *
+       * @return DOCUMENT_ME
+       */
+      public QueryResourcePropertiesResponseDocument queryResourceProperties( QueryResourcePropertiesDocument requestDoc )
+      {
+         return new QueryResourcePropertiesProvider( getResourceContext(  ) ).queryResourceProperties( requestDoc );
+      }
+
+}

Added: incubator/apollo/trunk/src/site/content/tutorial/src/example/sysprops/JavaSysPropsHome.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/tutorial/src/example/sysprops/JavaSysPropsHome.java?view=auto&rev=122667
==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/src/site/content/tutorial/src/example/sysprops/JavaSysPropsHome.java	Fri Dec 17 11:25:16 2004
@@ -0,0 +1,79 @@
+/*=============================================================================*
+ *  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.sysprops;
+
+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.resource.impl.ResourceFactory;
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+
+/**
+ * @author Sal Campana
+ */
+public class JavaSysPropsHome
+   extends AbstractResourceHome
+   implements ResourceFactory,
+              Serializable
+{
+   /**
+    * DOCUMENT_ME
+    *
+    * @param resourceContext DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    *
+    * @throws ResourceException DOCUMENT_ME
+    * @throws ResourceContextException DOCUMENT_ME
+    * @throws ResourceUnknownException DOCUMENT_ME
+    */
+   public Resource getInstance( ResourceContext resourceContext )
+   throws ResourceException, 
+          ResourceContextException, 
+          ResourceUnknownException
+   { //todo not sure what should happen in here yet....for singleton
+      ResourceKey key      = resourceContext.getResourceKey(  );
+      Resource    resource = null;
+      try
+      {
+         resource = find( key );
+      }
+      catch ( ResourceException re )
+      {
+      }
+
+      if ( resource == null )
+      {
+         try
+         {
+            resource = createInstance( key );
+         }
+         catch ( Exception e )
+         {
+            throw new ResourceException( e );
+         }
+
+         add( key, resource );
+      }
+
+      return resource;
+   }
+}
\ No newline at end of file

Added: incubator/apollo/trunk/src/site/content/tutorial/src/example/sysprops/JavaSysPropsResource.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/tutorial/src/example/sysprops/JavaSysPropsResource.java?view=auto&rev=122667
==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/src/site/content/tutorial/src/example/sysprops/JavaSysPropsResource.java	Fri Dec 17 11:25:16 2004
@@ -0,0 +1,98 @@
+package example.sysprops;
+
+import org.apache.ws.resource.PropertiesInterface;
+import org.apache.ws.resource.Resource;
+import org.apache.ws.resource.example.sysprops.JavaSystemPropertiesDocument;
+import org.apache.ws.resource.properties.ResourceProperty;
+import org.apache.ws.resource.properties.ResourcePropertyMetaData;
+import org.apache.ws.resource.properties.ResourcePropertySet;
+import org.apache.ws.resource.properties.impl.AnyResourcePropertyMetaData;
+import org.apache.ws.resource.properties.impl.XmlBeansResourceProperty;
+import org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySet;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+
+import javax.xml.namespace.QName;
+import java.util.Iterator;
+import java.util.Properties;
+
+
+/**
+ * @author Sal Campana
+ */
+public class JavaSysPropsResource implements Resource,
+                                             PropertiesInterface
+{
+    /**
+     * The resource ID of the instance.
+     */
+    Object m_id;
+
+    /**
+     * The ResourceProperty Set containing the resource props.
+     */
+    ResourcePropertySet m_propSet;
+    private static final String ELEM_PROPERTY = "property";
+
+    public void setID(Object id)
+    {
+        m_id = id;
+    }
+
+    public Object getID()
+    {
+        return m_id;
+    }
+
+    public void destroy()
+    {
+        m_propSet = null;
+        m_id = null;
+    }
+
+    public void init()
+    {
+        JavaSystemPropertiesDocument propDoc = JavaSystemPropertiesDocument.Factory.newInstance();
+        m_propSet = new XmlBeansResourcePropertySet(propDoc);
+        //create a resource metadata and resource property
+        ResourcePropertyMetaData propMetaData = new AnyResourcePropertyMetaData(new QName(JavaSysPropsService.TARGET_NSURI, ELEM_PROPERTY));
+        ResourceProperty prop = new XmlBeansResourceProperty(propMetaData, (XmlBeansResourcePropertySet) m_propSet);
+        //add the property to the prop set
+        m_propSet.add(prop);
+
+        //get the current sys properties
+        Properties properties = System.getProperties();
+        Iterator iterator = properties.keySet().iterator();
+        //iterate the sysprops and add to property set
+        while (iterator.hasNext())
+        {
+            XmlObject xmlObject = null;
+            //get each key/value pair
+            String key = (String) iterator.next();
+            String value = properties.getProperty(key);
+            try
+            {
+                //build an arbitrary XmlObject out of the sysprop data
+                xmlObject = XmlObject.Factory.parse("<" + JavaSysPropsService.TARGET_NSPREFIX + ":" + ELEM_PROPERTY + " name=\"" + key + "\" value=\"" + value + "\" xmlns:" + JavaSysPropsService.TARGET_NSPREFIX + "=\"" + JavaSysPropsService.TARGET_NSURI + "\"/>");
+            }
+            catch (XmlException e)
+            {
+                e.printStackTrace();
+            }
+
+            //add the XmlObject to the property
+            prop.add(xmlObject);
+        }
+
+    }
+
+    public ResourcePropertySet getResourcePropertySet()
+    {
+        return m_propSet;
+    }
+
+    public void setResourcePropertySet(ResourcePropertySet propSet)
+    {
+        m_propSet = propSet;
+    }
+}

Added: incubator/apollo/trunk/src/site/content/tutorial/src/example/sysprops/JavaSysPropsService.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/tutorial/src/example/sysprops/JavaSysPropsService.java?view=auto&rev=122667
==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/src/site/content/tutorial/src/example/sysprops/JavaSysPropsService.java	Fri Dec 17 11:25:16 2004
@@ -0,0 +1,48 @@
+/*=============================================================================*
+ *  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.sysprops;
+
+import org.apache.ws.resource.ResourceContext;
+
+/**
+ * @author Sal Campana
+ */
+public class JavaSysPropsService
+   extends AbstractJavaSysPropsService
+{
+   private ResourceContext m_resourceContext;
+
+   /**
+    * Creates a new {@link JavaSysPropsService} object.
+    *
+    * @param ctx DOCUMENT_ME
+    */
+   public JavaSysPropsService( ResourceContext ctx )
+   {
+      m_resourceContext = ctx;
+      init(  );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public ResourceContext getResourceContext(  )
+   {
+      return m_resourceContext;
+   }
+}
\ No newline at end of file

Modified: incubator/apollo/trunk/src/site/content/xdocs/tutorial/callback.xml
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/xdocs/tutorial/callback.xml?view=diff&rev=122667&p1=incubator/apollo/trunk/src/site/content/xdocs/tutorial/callback.xml&r1=122666&p2=incubator/apollo/trunk/src/site/content/xdocs/tutorial/callback.xml&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/site/content/xdocs/tutorial/callback.xml	(original)
+++ incubator/apollo/trunk/src/site/content/xdocs/tutorial/callback.xml	Fri Dec 17 11:25:16 2004
@@ -1,17 +1,77 @@
 <?xml version="1.0"?>
-
 <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+<document>
+	<header>
+		<title>Writing Callback Objects.</title>
+	</header>
+	<body>
+		<section id="callbacks">
+			<title>Writing Callback Objects.</title>
+			<p>Callback objects are how you keep the front-end resource properties in synch with your backend.  You write callback objects and register them with your non-static resource properties.  The registration is typically done upon initialization of the Resource class, in the init method.  An example of this can be seen in the FileSystemResource.</p>
+			<p>There are two interfaces which can be implemented when writing a Callback object.  Which one you choose will depend on how you would like each ResourceProperty to behave:</p>
+<ol>
+	<li>.org.apache.ws.resource.properties.ResourcePropertyCallback - Implement this interface if the resource property will change (not static i.e. "name"), but is not modifiable externally.  It provides the ability to refresh the front-end with the current state of your backend.</li>
+	<li>org.apache.ws.resource.properties.SetResourcePropertyCallback - Implement this interface if the resource property is modifiable, thus methods like insert, update and delete <em>may</em> be appropriate.  This interface extends the ResourcePropertyCallback. </li>
+</ol>
+		</section>
+		<section id="refresh">
+			<title>Implementing the ResourcePropertyCallback</title>
+			<p>The ResourcePropertyCallback is a way for you to synchronize the front-end resource properties with the backend.  The interface defines one method:</p>
+			<source>ResourceProperty refreshProperty( ResourceProperty prop );</source>
+			<p>Notice the operation is passed a ResourceProperty.  The ResourceProperty contains methods for pulling the values out of the property.  You can get an iterator, in the case of a list, or can retrieve via an index: ResourceProperty.get(i)</p>
+			<p>The returned property will be an XmlBean type.  What "type" will depend on your method description in your wsdl.  If the type is a schema-defined type (string, int etc.), XmlBeans provides objects specific to those types.  In the BackupFrequencyCallback we see that BackupFrequency was an xsd:int and so the XmlBean type is XmlInt:</p>
+<source>public ResourceProperty refreshProperty(ResourceProperty prop)
+    {
+        XmlInt xInt = (XmlInt) prop.get( 0 );
+        xInt.setIntValue( m_fileSystem.getBackupFrequency() );
+        return prop;
+    }</source>
+    <p>In the case of complex types, XmlBeans will generate a type and that is what will be passed to the operation.  We can see an example of this in OptionsCallback:</p>
+<source>   public ResourceProperty refreshProperty( ResourceProperty prop )
+   {
+      Iterator iterator = prop.iterator(  );
+      while ( iterator.hasNext(  ) )
+      { 
+         OptionsDocument.Options o = (OptionsDocument.Options) iterator.next(  );
+         clearOptionsFromProperty( o );
+
+         //add current options...
+         List options = m_fileSystem.getOptions(  );
+         for ( int i = 0; i <![CDATA[<]]> options.size(  ); i++ )
+         {
+            o.addOption( options.get( i ).toString(  ) );
+         }
+      }
+
+      return prop;
+   }</source>
+   <p>In both cases the objects (XmlInt and Options) all extend XmlObject as a common class, however it is useful to utilize the defined class' operations directly.</p>
+<p>Once you have a handle on the passed-in object, you will need to set the equivalent value, from the current state of your backend, on the passed-in object.</p><p>The refreshProperty method is called before GetResourceProperty, GetMultipleResourceProperties and QueryResourceProperties requests.</p>
+		</section>
+		<section id="setresource">
+			<title>Implementing the SetResourcePropertyCallback</title>
+			<p>The SetResourcePropertyCallback is a way for the backend to be changed via requests to the front-end resource properties.  The SetResourcePropertyCallback interface defines three methods:</p><source>void deleteProperty( QName propQName );
+void insertProperty( Object[] prop );
+void updateProperty( Object[] prop );</source>
+   <p>The operations will follow the same semantics as are defined in the specification and will be restricted to the bounds of you schema.  If you define an element with a maxOccurs="1", and attempt to add (insertProperty) another item to it, Apollo will generate a fault.</p>
+<p>The CommentCallback illustrates how these methods <em>may</em> be implemented:</p>
+<source>    public void deleteProperty( QName propQName )
+    {
+        return; // no need to implement - Apollo will never call delete for a prop whose minOccurs != 0
+    }
+
+    public void insertProperty( Object[] propElems )
+    {
+        XmlString xString = (XmlString) propElems[0];
+        m_fileSystem.setComment( xString.getStringValue() );
+    }
 
-<document> 
-  <header> 
-    <title> </title> 
-  </header> 
-  <body> 
-    <section>
-      <title> </title>
-      <p>
-        TODO
-      </p>
-    </section>
-  </body>
+    public void updateProperty( Object[] prop )
+    {
+        insertProperty( prop );
+    }
+</source>
+<p>Notice that the deleteProperty method does nothing since the implementor knew that the method would never be called since the schema forbids it.  The updateProperty simply hands-off to the insertProperty since the implementor knew that an update on the backend is the same as an insert.  The insertProperty is the workhorse method and takes the Object[], obtains the value from it and sets it on the backend.</p>
+		</section>
+	</body>
 </document>

Modified: incubator/apollo/trunk/src/site/content/xdocs/tutorial/resource.xml
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/xdocs/tutorial/resource.xml?view=diff&rev=122667&p1=incubator/apollo/trunk/src/site/content/xdocs/tutorial/resource.xml&r1=122666&p2=incubator/apollo/trunk/src/site/content/xdocs/tutorial/resource.xml&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/site/content/xdocs/tutorial/resource.xml	(original)
+++ incubator/apollo/trunk/src/site/content/xdocs/tutorial/resource.xml	Fri Dec 17 11:25:16 2004
@@ -29,7 +29,7 @@
 				</section>
 		<section id="ops">
 					<title>Operations</title>
-					<p>The operations are defined by the interfaces you implement and are mainly setters and getters for the ResourcePropertySet and the resource id.  There are also operations which allow you to initialize your resource or destroy your resource (init(..) and destroy()).  The operations allow you to do setup, like adding callback objects, and cleanup in your resource class.  The exception, seen in the FileSystemResource, are the operations for ScheduledResourceTerminationResource in which we've provided a utility class (ResourcePropertyUtils) to help you implement these methods.</p><note>The use of ResourcePropertyUtils is purely optional and is meant to help the implementor.</note>
+					<p>The operations are defined by the interfaces you implement and are mainly setters and getters for the ResourcePropertySet and the resource id.  There are also operations which allow you to initialize your resource or destroy your resource (init(..) and destroy()).  The operations allow you to do setup, initializing your resource properties, adding callback objects, and cleanup in your resource class.  The exception, seen in the FileSystemResource, are the operations for ScheduledResourceTerminationResource in which we've provided a utility class (ResourcePropertyUtils) to help you implement these methods.</p><note>The use of ResourcePropertyUtils is purely optional and is meant to help the implementor.</note>
   		</section>
 	</body>
 </document>

Modified: incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java&r1=122666&p2=incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java	(original)
+++ incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java	Fri Dec 17 11:25:16 2004
@@ -21,6 +21,7 @@
 import org.apache.ws.resource.ResourceException;
 import org.apache.ws.resource.ResourceKey;
 import org.apache.ws.resource.ResourceUnknownException;
+import org.apache.ws.resource.PropertiesInterface;
 import org.apache.ws.resource.impl.AbstractResourceHome;
 import org.apache.ws.resource.impl.ResourceFactory;
 import org.apache.ws.resource.impl.SimpleTypeResourceKey;
@@ -103,8 +104,8 @@
                 XmlObject propsDocXBean = XmlObject.Factory.parse( in, parseOpts );
                 in.close();
                 ResourcePropertySet propSet = new XmlBeansResourcePropertySet( propsDocXBean );
-                resource = createInstance( key, propSet );
-                ( (Resource) resource ).setResourcePropertySet( propSet );
+                resource = createInstance( key);
+                ( (PropertiesInterface) resource ).setResourcePropertySet( propSet );
             }
         }
         catch ( Exception e )

Modified: incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiResource.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiResource.java?view=diff&rev=122667&p1=incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiResource.java&r1=122666&p2=incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiResource.java&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiResource.java	(original)
+++ incubator/apollo/trunk/src/test/org/apache/ws/resource/properties/SushiResource.java	Fri Dec 17 11:25:16 2004
@@ -16,6 +16,7 @@
 package org.apache.ws.resource.properties;
 
 import org.apache.ws.resource.Resource;
+import org.apache.ws.resource.PropertiesInterface;
 
 import java.util.Map;
 
@@ -23,7 +24,7 @@
  * @author Sal Campana
  */
 public class SushiResource
-   implements Resource
+   implements Resource, PropertiesInterface
 {
    /**
     * The resource ID of the instance.

Modified: incubator/apollo/trunk/src/webapp/WEB-INF/classes/jndi-config.xml
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/webapp/WEB-INF/classes/jndi-config.xml?view=diff&rev=122667&p1=incubator/apollo/trunk/src/webapp/WEB-INF/classes/jndi-config.xml&r1=122666&p2=incubator/apollo/trunk/src/webapp/WEB-INF/classes/jndi-config.xml&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/webapp/WEB-INF/classes/jndi-config.xml	(original)
+++ incubator/apollo/trunk/src/webapp/WEB-INF/classes/jndi-config.xml	Fri Dec 17 11:25:16 2004
@@ -16,11 +16,7 @@
             <parameter>
                <name>factory</name>
                <value>org.apache.ws.util.jndi.BeanFactory</value>
-            </parameter>
-            <parameter>
-               <name>resourceKeyName</name>
-               <value>ResourceId</value>
-            </parameter>
+            </parameter>           
             <parameter>
                <name>resourceKeyClassName</name>
                <value>org.apache.ws.resource.impl.SimpleTypeResourceKey</value>
@@ -55,6 +51,23 @@
          </resourceParams>
       </resource>
    </service>
-
+   <service name="sysprops">
+      <resource name="home" type="example.sysprops.JavaSysPropsHome">
+         <resourceParams>
+            <parameter>
+               <name>resourceClassName</name>
+               <value>example.sysprops.JavaSysPropsResource</value>
+            </parameter>
+            <parameter>
+               <name>serviceClassName</name>
+               <value>example.sysprops.JavaSysPropsService</value>
+            </parameter>
+            <parameter>
+               <name>wsdlTargetNamespace</name>
+               <value>http://ws.apache.org/resource/example/sysprops</value>
+            </parameter>            
+         </resourceParams>
+      </resource>
+   </service>
 </jndiConfig>
     

Modified: incubator/apollo/trunk/src/webapp/WEB-INF/server-config.wsdd
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/webapp/WEB-INF/server-config.wsdd?view=diff&rev=122667&p1=incubator/apollo/trunk/src/webapp/WEB-INF/server-config.wsdd&r1=122666&p2=incubator/apollo/trunk/src/webapp/WEB-INF/server-config.wsdd&r2=122667
==============================================================================
--- incubator/apollo/trunk/src/webapp/WEB-INF/server-config.wsdd	(original)
+++ incubator/apollo/trunk/src/webapp/WEB-INF/server-config.wsdd	Fri Dec 17 11:25:16 2004
@@ -64,5 +64,14 @@
          </handler>
       </requestFlow>      
    </service>
-
+   <!-- style="message" -->
+   <service name="sysprops" provider="java:WSRF" style="document" use="literal">
+      <wsdlFile>/wsdl/SysProps.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>      
+   </service>
 </deployment>

---------------------------------------------------------------------
To unsubscribe, e-mail: apollo-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: apollo-dev-help@ws.apache.org