ws-wsrf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r219227 - in /webservices/wsrf/trunk/src: examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/ java/org/apache/ws/resource/impl/ java/org/apache/ws/resource/tool/ templates/ test/org/apache/ws/resource/properties/
Date Fri, 15 Jul 2005 17:56:13 GMT
Author: scamp
Date: Fri Jul 15 10:56:12 2005
New Revision: 219227

URL: http://svn.apache.org/viewcvs?rev=219227&view=rev
Log:
Updated for the NEW Abstract*Home generated artifact

Added:
    webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemHome.java
    webservices/wsrf/trunk/src/templates/AbstractHome.vm
    webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/AbstractSushiHome.java
Modified:
    webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java
    webservices/wsrf/trunk/src/templates/Home.vm
    webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java

Added: webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemHome.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemHome.java?rev=219227&view=auto
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemHome.java
(added)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemHome.java
Fri Jul 15 10:56:12 2005
@@ -0,0 +1,50 @@
+package org.apache.ws.resource.example.filesystem;
+
+import org.apache.ws.resource.impl.AbstractResourceHome;
+import org.apache.commons.collections.map.ReferenceMap;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collections;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+/**
+ * This class should not be modified.
+ *
+ * The class acts as an extension of the AbstractResourceHome which
+ * maintains a reference to the STATIC map needed for accessing resources via JNDI.
+ *
+ * This ensures the resources will be accessible if serialized via JNDI in certain platforms.
+ */
+abstract class AbstractFilesystemHome extends AbstractResourceHome
+{
+    /**
+     * The static reference which is maintained and used by the AbstractResourceHome.
+     *
+     * Do not modify.
+     */
+    private static Map m_resource;
+
+    /**
+     * Do not modify this method.
+     */
+    protected final Map initResourceMap( )
+                throws NamingException
+    {
+        Context initialContext = new InitialContext();
+    	if ( m_resourceIsPersistent )
+    	{
+		m_resources = new ReferenceMap( ReferenceMap.HARD, ReferenceMap.SOFT, true );
+		initCachePolicy( initialContext );
+    	}
+    	else
+    	{
+		m_resources = new HashMap();
+    	}
+
+    	m_resources = Collections.synchronizedMap( m_resources );
+    	return m_resources;
+    }
+
+}

Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java?rev=219227&r1=219226&r2=219227&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java
(original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java
Fri Jul 15 10:56:12 2005
@@ -20,7 +20,7 @@
  * Home for Filesystem WS-Resources.
  */
 public class FilesystemHome
-        extends AbstractResourceHome
+        extends AbstractFilesystemHome
         implements Serializable
 {
 

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java?rev=219227&r1=219226&r2=219227&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java
(original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java
Fri Jul 15 10:56:12 2005
@@ -114,7 +114,7 @@
      * DOCUMENT_ME
      */
     protected String m_resourceClassName;
-    private boolean m_resourceIsPersistent;
+    protected boolean m_resourceIsPersistent;
     private String m_resourceKeyClassName;
     private String m_resourceKeyName;
     private String m_wsdlTargetNamespace;
@@ -357,7 +357,7 @@
         //end todo
 
         Context initialContext = new InitialContext();
-        initResourceMap( initialContext );
+        m_resources = initResourceMap( );
         m_lockManager = new LockManager();
         if ( ScheduledResourceTerminationResource.class.isAssignableFrom( getResourceClass()
) )
         {
@@ -564,7 +564,7 @@
         return lookupKey;
     }
 
-    private void initCachePolicy( Context initialContext )
+    protected void initCachePolicy( Context initialContext )
             throws NamingException
     {
         if ( m_cacheLocation != null )
@@ -573,20 +573,9 @@
         }
     }
 
-    private void initResourceMap( Context initialContext )
-            throws NamingException
-    {
-        if ( m_resourceIsPersistent )
-        {
-            m_resources = new ReferenceMap( ReferenceMap.HARD, ReferenceMap.SOFT, true );
-            initCachePolicy( initialContext );
-        }
-        else
-        {
-            m_resources = new HashMap();
-        }
-        m_resources = Collections.synchronizedMap( m_resources );
-    }
+    protected abstract Map initResourceMap() throws NamingException;
+
+
 
     private void initSweeper( Context initialContext )
             throws NamingException

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=219227&r1=219226&r2=219227&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 Jul 15
10:56:12 2005
@@ -699,6 +699,9 @@
                 processTemplate(context, "templates/Resource.vm", outputFile);
             }
 
+            outputFile = new File(packageDir, "Abstract" + capitalizedServiceName + "Home.java");
+            processTemplate(context, "templates/AbstractHome.vm", outputFile);
+
             outputFile = new File(packageDir, capitalizedServiceName + "Home.java");
 
             if (!outputFile.exists())

Added: webservices/wsrf/trunk/src/templates/AbstractHome.vm
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/templates/AbstractHome.vm?rev=219227&view=auto
==============================================================================
--- webservices/wsrf/trunk/src/templates/AbstractHome.vm (added)
+++ webservices/wsrf/trunk/src/templates/AbstractHome.vm Fri Jul 15 10:56:12 2005
@@ -0,0 +1,55 @@
+#set( $package = $generated.packageName )
+#set( $capitalServiceName = $generated.ServiceName )
+package $package;
+
+import org.apache.ws.resource.impl.AbstractResourceHome;
+import org.apache.commons.collections.map.ReferenceMap;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collections;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+
+/**
+ * This class should not be modified.
+ *
+ * The class acts as an extension of the AbstractResourceHome which
+ * maintains a reference to the STATIC map needed for accessing resources via JNDI.
+ *
+ * This ensures the resources will be accessible if serialized via JNDI in certain platforms.
+ */
+abstract class Abstract${capitalServiceName}Home extends AbstractResourceHome
+{
+    
+    /**
+     * The static reference which is maintained and used by the AbstractResourceHome.
+     *
+     * Do not modify.
+     */
+    private static Map m_resource;
+	
+	
+    /**
+     * Do not modify this method.
+     */
+    protected final Map initResourceMap( )
+                throws NamingException
+    {
+        Context initialContext = new InitialContext();
+    	if ( m_resourceIsPersistent )
+    	{
+		m_resources = new ReferenceMap( ReferenceMap.HARD, ReferenceMap.SOFT, true );
+		initCachePolicy( initialContext );
+    	}
+    	else
+    	{
+		m_resources = new HashMap();
+    	}
+    	
+    	m_resources = Collections.synchronizedMap( m_resources );
+    	return m_resources;
+    }
+
+}
\ No newline at end of file

Modified: webservices/wsrf/trunk/src/templates/Home.vm
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/templates/Home.vm?rev=219227&r1=219226&r2=219227&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/templates/Home.vm (original)
+++ webservices/wsrf/trunk/src/templates/Home.vm Fri Jul 15 10:56:12 2005
@@ -28,7 +28,7 @@
  * Home for $capitalServiceName WS-Resources.
  */
 public class ${capitalServiceName}Home
-        extends AbstractResourceHome
+        extends Abstract${capitalServiceName}Home
         implements Serializable
 {
 

Added: webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/AbstractSushiHome.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/AbstractSushiHome.java?rev=219227&view=auto
==============================================================================
--- webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/AbstractSushiHome.java
(added)
+++ webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/AbstractSushiHome.java
Fri Jul 15 10:56:12 2005
@@ -0,0 +1,50 @@
+package org.apache.ws.resource.properties;
+
+import org.apache.ws.resource.impl.AbstractResourceHome;
+import org.apache.commons.collections.map.ReferenceMap;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collections;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+/**
+ * This class should not be modified.
+ *
+ * The class acts as an extension of the AbstractResourceHome which
+ * maintains a reference to the STATIC map needed for accessing resources via JNDI.
+ *
+ * This ensures the resources will be accessible if serialized via JNDI in certain platforms.
+ */
+abstract class AbstractSushiHome extends AbstractResourceHome
+{
+    /**
+     * The static reference which is maintained and used by the AbstractResourceHome.
+     *
+     * Do not modify.
+     */
+    private static Map m_resource;
+
+    /**
+     * Do not modify this method.
+     */
+    protected final Map initResourceMap( )
+                throws NamingException
+    {
+        Context initialContext = new InitialContext();
+    	if ( m_resourceIsPersistent )
+    	{
+		m_resources = new ReferenceMap( ReferenceMap.HARD, ReferenceMap.SOFT, true );
+		initCachePolicy( initialContext );
+    	}
+    	else
+    	{
+		m_resources = new HashMap();
+    	}
+
+    	m_resources = Collections.synchronizedMap( m_resources );
+    	return m_resources;
+    }
+
+}

Modified: webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java?rev=219227&r1=219226&r2=219227&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java (original)
+++ webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java Fri Jul
15 10:56:12 2005
@@ -36,7 +36,7 @@
  * @author Sal Campana
  */
 public class SushiHome
-        extends AbstractResourceHome
+        extends AbstractSushiHome
         implements Serializable
 {
 



Mime
View raw message