ws-wsrf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject svn commit: r291770 - /webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java
Date Mon, 26 Sep 2005 22:27:03 GMT
Author: ips
Date: Mon Sep 26 15:26:59 2005
New Revision: 291770

URL: http://svn.apache.org/viewcvs?rev=291770&view=rev
Log:
fixed bug in add()

Modified:
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java

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=291770&r1=291769&r2=291770&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
Mon Sep 26 15:26:59 2005
@@ -492,12 +492,8 @@
 
         synchronized ( m_resources )
         {
-            Object key = getNonNullKey( resource.getID() );
-            if ( resource.getEndpointReference() == null )
-            {
-                resource.setEndpointReference( getEndpointReference( key ) );
-            }
-
+            setEndpointReference( resource );
+            Object key = getNonNullKey( resource.getID() );            
             if ( !m_resources.containsKey( key ) )
             {
                 LOG.debug( MSG.getMessage( Keys.ADDING_RESOURCE_WITH_ID,
@@ -514,6 +510,14 @@
         return resourceWasAdded;
     }
 
+    private void setEndpointReference( Resource resource )
+    {
+        if ( resource.getEndpointReference() == null )
+        {
+            resource.setEndpointReference( getEndpointReference( resource.getID() ) );
+        }
+    }
+
     /**
      * Adds a listener for ResourceCreationEvents
      *
@@ -756,20 +760,14 @@
         resource.setID( id );
         try
         {
-            LOG.debug( MSG.getMessage( Keys.INIT_RESOURCE_LIFECYCLE_INSTANCE,
-                    resource.getClass().getName() ) );
-            if ( resource.getEndpointReference() == null ) //also checked in add(..) in case
they sidestep this
-            {
-                resource.setEndpointReference( getEndpointReference( id ) );
-            }
-
+            LOG.debug( MSG.getMessage( Keys.INIT_RESOURCE_LIFECYCLE_INSTANCE, resource.getClass().getName()
) );
+            setEndpointReference( resource );
             resource.init();
         }
         catch ( RuntimeException re )
         {
             throw new ResourceException( MSG.getMessage( Keys.FAILED_TO_INIT_RESOURCE, resource,
re ), re );
         }
-
         return resource;
     }
 



Mime
View raw message