ws-wsrf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r220182 - /webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java
Date Thu, 21 Jul 2005 20:51:56 GMT
Author: scamp
Date: Thu Jul 21 13:51:54 2005
New Revision: 220182

URL: http://svn.apache.org/viewcvs?rev=220182&view=rev
Log:
synchnozied instead of using the Globus lock since it was deadlocking/hanging

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=220182&r1=220181&r2=220182&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
Thu Jul 21 13:51:54 2005
@@ -63,7 +63,7 @@
 
 /**
  * TODO: update these Javadocs
- * 
+ * <p/>
  * LOG-DONE An implementation of the <code>ResourceHome</code> interface. This
implementation was designed to work with
  * resources that implement the {@link PersistentResource PersistenceCallback} interface
as well as memory resident
  * resources. If the resource class implements the {@link PersistentResource PersistenceCallback}
interface
@@ -110,7 +110,7 @@
 {
 
     private static final int DEFAULT_SWEEPER_DELAY = 60000;
-    private static final Log LOG = LogFactory.getLog( AbstractResourceHome.class );
+    private static final Log LOG = LogFactory.getLog(AbstractResourceHome.class);
     public static final Messages MSG = MessagesImpl.getInstance();
 
     /**
@@ -151,31 +151,31 @@
      */
     public void init() throws Exception
     {
-        synchronized( this )
+        synchronized (this)
         {
-        if ( m_initialized )
-        {
-            return;
-        }
-        LOG.debug( MSG.getMessage( Keys.INIT_HOME ) );
-        Class resourceClass = getResourceClass();
+            if (m_initialized)
+            {
+                return;
+            }
+            LOG.debug(MSG.getMessage(Keys.INIT_HOME));
+            Class resourceClass = getResourceClass();
 
-        //todo sjc is it gone ips??
-        /*     if ( PersistentResource.class.isAssignableFrom( resourceClass ) )
-             {
-                 m_resourceIsPersistent = true;
-             }*/
-        //end todo
+            //todo sjc is it gone ips??
+            /*     if ( PersistentResource.class.isAssignableFrom( resourceClass ) )
+                 {
+                     m_resourceIsPersistent = true;
+                 }*/
+            //end todo
 
-        Context initialContext = new InitialContext();
-        m_resources = getResourceMap( );
-        m_lockManager = new LockManager();
-        if ( ScheduledResourceTerminationResource.class.isAssignableFrom( getResourceClass()
) )
-        {
-            initSweeper( initialContext );
-        }
-        initCachePolicy( new InitialContext() );
-        m_initialized = true;
+            Context initialContext = new InitialContext();
+            m_resources = getResourceMap();
+            m_lockManager = new LockManager();
+            if (ScheduledResourceTerminationResource.class.isAssignableFrom(getResourceClass()))
+            {
+                initSweeper(initialContext);
+            }
+            initCachePolicy(new InitialContext());
+            m_initialized = true;
         }
     }
 
@@ -184,7 +184,7 @@
      *
      * @param jndiLocation DOCUMENT_ME
      */
-    public void setCacheLocation( String jndiLocation )
+    public void setCacheLocation(String jndiLocation)
     {
         m_cacheLocation = jndiLocation;
     }
@@ -204,7 +204,7 @@
      *
      * @param resourceClass DOCUMENT_ME
      */
-    public void setResourceClassName( String resourceClass )
+    public void setResourceClassName(String resourceClass)
     {
         m_resourceClassName = resourceClass;
     }
@@ -224,7 +224,7 @@
      *
      * @param keyClass DOCUMENT_ME
      */
-    public void setResourceKeyClassName( String keyClass )
+    public void setResourceKeyClassName(String keyClass)
     {
         m_resourceKeyClassName = keyClass;
     }
@@ -244,7 +244,7 @@
      *
      * @param keyName DOCUMENT_ME
      */
-    public void setResourceKeyName( String keyName )
+    public void setResourceKeyName(String keyName)
     {
         m_resourceKeyName = keyName;
     }
@@ -264,7 +264,7 @@
      *
      * @param serviceClass DOCUMENT_ME
      */
-    public void setServiceClass( String serviceClass )
+    public void setServiceClass(String serviceClass)
     {
         m_serviceClassName = serviceClass;
     }
@@ -274,7 +274,7 @@
      *
      * @param className DOCUMENT_ME
      */
-    public void setServiceClassName( String className )
+    public void setServiceClassName(String className)
     {
         m_serviceClassName = className;
     }
@@ -294,7 +294,7 @@
      *
      * @param delay DOCUMENT_ME
      */
-    public void setSweeperDelay( long delay )
+    public void setSweeperDelay(long delay)
     {
         m_sweeperDelay = delay;
     }
@@ -314,7 +314,7 @@
      *
      * @param targetNamespace DOCUMENT_ME
      */
-    public void setWsdlTargetNamespace( String targetNamespace )
+    public void setWsdlTargetNamespace(String targetNamespace)
     {
         m_wsdlTargetNamespace = targetNamespace;
     }
@@ -332,60 +332,67 @@
     /**
      * @see ResourceHome#find(Object)
      */
-    public Resource find( Object resourceId )
+    public Resource find(Object resourceId)
             throws
             ResourceUnknownException,
             ResourceException
     {
-        LOG.debug( MSG.getMessage( Keys.FINDING_RESOURCE_WITH_KEY, String.valueOf( resourceId
) ) );
+        LOG.debug(MSG.getMessage(Keys.FINDING_RESOURCE_WITH_KEY, String.valueOf(resourceId)));
         Resource resource = null;
-        Lock lock = acquireLock( resourceId );
-        try
-        {
-            resource = get( resourceId );
-            if ( m_cache != null )
+
+            synchronized (getResourceMap())
             {
-                m_cache.update( resource );
+               // Lock lock = acquireLock(resourceId);
+
+           //     try
+            //    {
+                    resource = get(resourceId);
+                    if (m_cache != null)
+                    {
+                        m_cache.update(resource);
+                    }
+            //    }
+            //    finally
+            //    {
+           //         lock.release();
+            //    }
             }
-        }
-        finally
-        {
-            lock.release();
-        }
+
+
         return resource;
     }
 
     /**
      * @see ResourceHome#remove(Object)
      */
-    public void remove( Object resourceId )
+    public void remove(Object resourceId)
             throws ResourceUnknownException, ResourceException
     {
         Resource resource = null;
-        Lock lock = acquireLock( resourceId );
+        Lock lock = acquireLock(resourceId);
         try
         {
-            resource = get( resourceId );
+            resource = get(resourceId);
 
             try
             {
                 resource.destroy();
             }
-            catch ( RuntimeException re )
+            catch (RuntimeException re)
             {
-                throw new ResourceException( MSG.getMessage( Keys.FAILED_TO_DESTROY_RESOURCE,
resource, re ) );
+                throw new ResourceException(MSG.getMessage(Keys.FAILED_TO_DESTROY_RESOURCE,
resource, re));
             }
 
-            Resource removedResource = (Resource) m_resources.remove( getNonNullKey( resourceId
) );
-            if ( removedResource instanceof PropertiesResource )
+            Resource removedResource = (Resource) m_resources.remove(getNonNullKey(resourceId));
+            if (removedResource instanceof PropertiesResource)
             {
-                notifyResourceDeletedListeners( removedResource );
+                notifyResourceDeletedListeners(removedResource);
             }
-            LOG.debug( MSG.getMessage( Keys.REMOVED_RESOURCE_WITH_KEY, resource.getClass().getName(),
-                    String.valueOf( resourceId ) ) );
-            if ( m_cache != null )
+            LOG.debug(MSG.getMessage(Keys.REMOVED_RESOURCE_WITH_KEY, resource.getClass().getName(),
+                                     String.valueOf(resourceId)));
+            if (m_cache != null)
             {
-                m_cache.remove( resource );
+                m_cache.remove(resource);
             }
         }
         finally
@@ -395,17 +402,17 @@
 
     }
 
-    private Lock acquireLock( Object resourceId )
+    private Lock acquireLock(Object resourceId)
             throws ResourceException
     {
-        Lock lock = m_lockManager.getLock( getNonNullKey( resourceId ) );
+        Lock lock = m_lockManager.getLock(getNonNullKey(resourceId));
         try
         {
             lock.acquire();
         }
-        catch ( InterruptedException ie )
+        catch (InterruptedException ie)
         {
-            throw new ResourceException( ie );
+            throw new ResourceException(ie);
         }
         return lock;
     }
@@ -413,17 +420,17 @@
     /**
      * DOCUMENT_ME
      *
-     * @param id      DOCUMENT_ME
+     * @param id       DOCUMENT_ME
      * @param resource DOCUMENT_ME
      */
-    protected void add( Object id,
-                        Resource resource )
+    protected void add(Object id,
+                       Resource resource)
     {
         // TODO: why do we need add() in addition to addResource()?
-        addResource( id, resource );
-        if ( m_cache != null )
+        addResource(id, resource);
+        if (m_cache != null)
         {
-            m_cache.update( resource );
+            m_cache.update(resource);
         }
     }
 
@@ -435,34 +442,32 @@
      * getEndpointReference and then use a setter on their resource impl.
      *
      * @param id the resource identifier
-     *
      * @return a resource of the type associated with this home
-     *
      * @throws ResourceException
      * @throws IllegalStateException
      */
-    protected Resource createInstance( Object id )
+    protected Resource createInstance(Object id)
             throws ResourceException
     {
-        LOG.debug( MSG.getMessage( Keys.CREATING_INSTANCE_WITH_KEY, String.valueOf( id )
) );
+        LOG.debug(MSG.getMessage(Keys.CREATING_INSTANCE_WITH_KEY, String.valueOf(id)));
         Resource resource;
         try
         {
             resource = (Resource) getResourceClass().newInstance();
         }
-        catch ( Exception e )
+        catch (Exception e)
         {
-            throw new ResourceException( e );
+            throw new ResourceException(e);
         }
-        resource.setID( id );
+        resource.setID(id);
         try
         {
-            LOG.debug( MSG.getMessage( Keys.INIT_RESOURCE_LIFECYCLE_INSTANCE, resource.getClass().getName()
) );
+            LOG.debug(MSG.getMessage(Keys.INIT_RESOURCE_LIFECYCLE_INSTANCE, resource.getClass().getName()));
             resource.init();
         }
-        catch ( RuntimeException re )
+        catch (RuntimeException re)
         {
-            throw new ResourceException( MSG.getMessage( Keys.FAILED_TO_INIT_RESOURCE, resource,
re ), re );
+            throw new ResourceException(MSG.getMessage(Keys.FAILED_TO_INIT_RESOURCE, resource,
re), re);
         }
         return resource;
     }
@@ -471,20 +476,18 @@
      * DOCUMENT_ME
      *
      * @param id DOCUMENT_ME
-     *
      * @return DOCUMENT_ME
-     *
      * @throws ResourceException DOCUMENT_ME
      */
-    protected Resource createNewInstanceAndLoad( Object id )
+    protected Resource createNewInstanceAndLoad(Object id)
             throws ResourceException
     {
-        Resource resource = createInstance( id );
-        LOG.debug( MSG.getMessage( Keys.LOADING_RESOURCE_FROM_PERSISTENCE, String.valueOf(
id ) ) );
+        Resource resource = createInstance(id);
+        LOG.debug(MSG.getMessage(Keys.LOADING_RESOURCE_FROM_PERSISTENCE, String.valueOf(id)));
         //todo sjc is it gone ips?? ( (PersistentResource) resource ).load( id );
-        if ( ResourceSweeper.isExpired( resource ) )
+        if (ResourceSweeper.isExpired(resource))
         {
-            throw new ResourceUnknownException( getNonNullKey( id ), getServicePortName()
);
+            throw new ResourceUnknownException(getNonNullKey(id), getServicePortName());
         }
         return resource;
     }
@@ -492,87 +495,85 @@
     private Class getResourceClass()
             throws ResourceException
     {
-        if ( m_resourceClass == null )
+        if (m_resourceClass == null)
         {
-            if ( m_resourceClassName == null )
+            if (m_resourceClassName == null)
             {
-                throw new IllegalStateException( MSG.getMessage( Keys.RESOURCE_CLASSNAME_NULL
) );
+                throw new IllegalStateException(MSG.getMessage(Keys.RESOURCE_CLASSNAME_NULL));
             }
             try
             {
-                m_resourceClass = Class.forName( m_resourceClassName );
+                m_resourceClass = Class.forName(m_resourceClassName);
             }
-            catch ( ClassNotFoundException cnfe )
+            catch (ClassNotFoundException cnfe)
             {
-                throw new ResourceException( MSG.getMessage( Keys.RESOURCE_CLASS_NOT_FOUND,
m_resourceClassName ) );
+                throw new ResourceException(MSG.getMessage(Keys.RESOURCE_CLASS_NOT_FOUND,
m_resourceClassName));
             }
-            if ( !Resource.class.isAssignableFrom( m_resourceClass ) )
+            if (!Resource.class.isAssignableFrom(m_resourceClass))
             {
-                throw new ResourceException(
-                        "Specified resource class '" + m_resourceClassName + "' does not
implement the " +
-                        Resource.class.getName() +
-                        " interface." );
+                throw new ResourceException("Specified resource class '" + m_resourceClassName
+ "' does not implement the " +
+                                            Resource.class.getName() +
+                                            " interface.");
             }
         }
         return m_resourceClass;
     }
 
-    private void addResource( Object id,
-                              Resource resource )
+    private void addResource(Object id,
+                             Resource resource)
     {
-        LOG.debug( MSG.getMessage( Keys.ADDING_RESOURCE_FOR_KEY, String.valueOf( id ) ) );
-        m_resources.put( getNonNullKey( id ), resource );
+        LOG.debug(MSG.getMessage(Keys.ADDING_RESOURCE_FOR_KEY, String.valueOf(id)));
+        m_resources.put(getNonNullKey(id), resource);
         // schedule sweeper task if needed
-        if ( m_sweeper != null )
+        if (m_sweeper != null)
         {
             m_sweeper.schedule();
         }
-        notifyResourceCreatedListeners( resource );
+        notifyResourceCreatedListeners(resource);
     }
 
-    private Resource get( Object resourceId )
+    private Resource get(Object resourceId)
             throws ResourceException
     {
-        LOG.debug( MSG.getMessage( Keys.GET_RESOURCE_FOR_KEY, String.valueOf( resourceId
) ) );
-        Object key = getNonNullKey( resourceId );
-        Resource resource = (Resource) m_resources.get( key );
-        if ( resource == null )
+        LOG.debug(MSG.getMessage(Keys.GET_RESOURCE_FOR_KEY, String.valueOf(resourceId)));
+        Object key = getNonNullKey(resourceId);
+        Resource resource = (Resource) m_resources.get(key);
+        if (resource == null)
         {
-            if ( !m_resourceIsPersistent )
+            if (!m_resourceIsPersistent)
             {
-                throw new ResourceUnknownException( key, getServicePortName() );
+                throw new ResourceUnknownException(key, getServicePortName());
             }
-            addResource( key, createNewInstanceAndLoad( resourceId ) );
+            addResource(key, createNewInstanceAndLoad(resourceId));
         }
         return resource;
     }
 
-    Object getNonNullKey( Object obj )
+    Object getNonNullKey(Object obj)
     {
         return obj != null ? obj : new Object();
     }
 
-    protected void initCachePolicy( Context initialContext )
+    protected void initCachePolicy(Context initialContext)
             throws NamingException
     {
-        if ( m_cacheLocation != null )
+        if (m_cacheLocation != null)
         {
-            m_cache = (Cache) JNDIUtils.lookup( initialContext, m_cacheLocation, Cache.class
);
+            m_cache = (Cache) JNDIUtils.lookup(initialContext, m_cacheLocation, Cache.class);
         }
     }
 
-    protected abstract Map getResourceMap() throws NamingException;
+    protected abstract Map getResourceMap();
 
 
-
-    private void initSweeper( Context initialContext )
+    private void initSweeper(Context initialContext)
             throws NamingException
     {
-        LOG.debug( MSG.getMessage( Keys.TIMER_LOOKUP_WITH_JNDI_NAME, JndiConstants.KEY_NAME_DEFAULT_TIMER
) );
-        TimerManager timerManager = (TimerManager) initialContext.lookup( JndiConstants.KEY_NAME_DEFAULT_TIMER
);
+        LOG.debug(MSG.getMessage(Keys.TIMER_LOOKUP_WITH_JNDI_NAME, JndiConstants.KEY_NAME_DEFAULT_TIMER));
+        TimerManager timerManager = (TimerManager) initialContext.lookup(JndiConstants.KEY_NAME_DEFAULT_TIMER);
 
         // TimerManager timerManager = new TimerManagerImpl();
-        m_sweeper = new Sweeper( this, m_resources, timerManager, m_sweeperDelay );
+        m_sweeper = new Sweeper(this, m_resources, timerManager, m_sweeperDelay);
     }
 
     /**
@@ -595,12 +596,12 @@
          * @param timerManager DOCUMENT_ME
          * @param delay        DOCUMENT_ME
          */
-        public Sweeper( ResourceHome home,
-                        Map resources,
-                        TimerManager timerManager,
-                        long delay )
+        public Sweeper(ResourceHome home,
+                       Map resources,
+                       TimerManager timerManager,
+                       long delay)
         {
-            super( home, resources );
+            super(home, resources);
             m_timerManager = timerManager;
             m_delay = delay;
         }
@@ -610,11 +611,11 @@
          *
          * @param timer DOCUMENT_ME
          */
-        public void timerExpired( Timer timer )
+        public void timerExpired(Timer timer)
         {
-            super.timerExpired( timer );
+            super.timerExpired(timer);
             cancel();
-            if ( !m_resources.isEmpty() )
+            if (!m_resources.isEmpty())
             {
                 schedule();
             }
@@ -625,10 +626,10 @@
          */
         synchronized void schedule()
         {
-            if ( m_timer == null )
+            if (m_timer == null)
             {
-                LOG.debug( MSG.getMessage( Keys.SCHEDULE_RESOURCE_SWEEPER ) );
-                m_timer = m_timerManager.schedule( this, m_delay );
+                LOG.debug(MSG.getMessage(Keys.SCHEDULE_RESOURCE_SWEEPER));
+                m_timer = m_timerManager.schedule(this, m_delay);
             }
         }
 
@@ -637,9 +638,9 @@
          */
         private synchronized void cancel()
         {
-            if ( m_timer != null )
+            if (m_timer != null)
             {
-                LOG.debug( MSG.getMessage( Keys.CANCEL_RESOURCE_SWEEPER ) );
+                LOG.debug(MSG.getMessage(Keys.CANCEL_RESOURCE_SWEEPER));
                 m_timer = null;
             }
         }
@@ -650,9 +651,9 @@
      *
      * @param listener
      */
-    public void addResourceCreationListener( ResourceCreationListener listener )
+    public void addResourceCreationListener(ResourceCreationListener listener)
     {
-        m_creationListeners.add( listener );
+        m_creationListeners.add(listener);
     }
 
     /**
@@ -660,33 +661,31 @@
      *
      * @param listener
      */
-    public void addResourceDestructionListener( ResourceDestructionListener listener )
+    public void addResourceDestructionListener(ResourceDestructionListener listener)
     {
-        m_destructionListeners.add( listener );
+        m_destructionListeners.add(listener);
     }
 
     /**
      * Removes a listener for ResourceCreationEvents
      *
      * @param listener
-     *
      * @return true if the listener was removed, else false
      */
-    public boolean removeResourceCreationListener( ResourceCreationListener listener )
+    public boolean removeResourceCreationListener(ResourceCreationListener listener)
     {
-        return m_creationListeners.remove( listener );
+        return m_creationListeners.remove(listener);
     }
 
     /**
      * Removes a listener for ResourceDestructionEvents
      *
      * @param listener
-     *
      * @return true if the listener was removed, else false
      */
-    public boolean removeResourceDestructionListener( ResourceDestructionListener listener
)
+    public boolean removeResourceDestructionListener(ResourceDestructionListener listener)
     {
-        return m_destructionListeners.remove( listener );
+        return m_destructionListeners.remove(listener);
     }
 
     /**
@@ -694,12 +693,12 @@
      *
      * @param resource The Resource which was created
      */
-    private void notifyResourceCreatedListeners( Resource resource )
+    private void notifyResourceCreatedListeners(Resource resource)
     {
-        for ( int i = 0; i < m_creationListeners.size(); i++ )
+        for (int i = 0; i < m_creationListeners.size(); i++)
         {
-            ResourceCreationListener resourceCreationListener = (ResourceCreationListener)
m_creationListeners.get( i );
-            resourceCreationListener.creationOccurred( new ResourceCreationEvent( resource
) );
+            ResourceCreationListener resourceCreationListener = (ResourceCreationListener)
m_creationListeners.get(i);
+            resourceCreationListener.creationOccurred(new ResourceCreationEvent(resource));
         }
     }
 
@@ -708,14 +707,13 @@
      *
      * @param resource The EndpointReference for the Resource which was created
      */
-    private void notifyResourceDeletedListeners( Resource resource )
+    private void notifyResourceDeletedListeners(Resource resource)
     {
-        for ( int i = 0; i < m_destructionListeners.size(); i++ )
+        for (int i = 0; i < m_destructionListeners.size(); i++)
         {
-            ResourceDestructionListener resourceDestructionListener = (ResourceDestructionListener)
m_destructionListeners.get(
-                    i );
-            ResourceDestructionEvent event = new ResourceDestructionEvent( resource );
-            resourceDestructionListener.destructionOccurred( event );
+            ResourceDestructionListener resourceDestructionListener = (ResourceDestructionListener)
m_destructionListeners.get(i);
+            ResourceDestructionEvent event = new ResourceDestructionEvent(resource);
+            resourceDestructionListener.destructionOccurred(event);
         }
     }
 
@@ -728,18 +726,17 @@
      * @param endpointAddress the endpoint url for the service
      * @param resourceId      the resource identifier, or null if the resource is a singleton
      * @param wsAddressingURI the namespace URI of the preferred WS-Addressing version
-     *
      * @return an EndpointReference (EPR) for the resource
      */
-    public EndpointReference getEndpointReference( String endpointAddress, Object resourceId,
String wsAddressingURI )
+    public EndpointReference getEndpointReference(String endpointAddress, Object resourceId,
String wsAddressingURI)
     {
-        XmlBeansEndpointReference xmlBeansEndpointReference = new XmlBeansEndpointReference(
endpointAddress,
-                wsAddressingURI );
-        xmlBeansEndpointReference.setResourceIdentifierReferenceParameterName( getResourceIdentifierReferenceParameterQName()
);
-        xmlBeansEndpointReference.setResourceIdentifier( resourceId );
-        xmlBeansEndpointReference.setPortTypeQName( getPortType() );
-        xmlBeansEndpointReference.setServicePortName( getServicePortName() );
-        xmlBeansEndpointReference.setServiceQName( getServiceName() );
+        XmlBeansEndpointReference xmlBeansEndpointReference = new XmlBeansEndpointReference(endpointAddress,
+                                                                                        
   wsAddressingURI);
+        xmlBeansEndpointReference.setResourceIdentifierReferenceParameterName(getResourceIdentifierReferenceParameterQName());
+        xmlBeansEndpointReference.setResourceIdentifier(resourceId);
+        xmlBeansEndpointReference.setPortTypeQName(getPortType());
+        xmlBeansEndpointReference.setServicePortName(getServicePortName());
+        xmlBeansEndpointReference.setServiceQName(getServiceName());
         return xmlBeansEndpointReference;
     }
 
@@ -759,38 +756,37 @@
         return m_resourceIdRefParamName.toString();
     }
 
-    public void setResourceIdentifierReferenceParameterName( String name )
+    public void setResourceIdentifierReferenceParameterName(String name)
     {
-        m_resourceIdRefParamName = QName.valueOf( name );
+        m_resourceIdRefParamName = QName.valueOf(name);
     }
 
-    public Object extractResourceIdentifier( ResourceContext context )
+    public Object extractResourceIdentifier(ResourceContext context)
     {
-        if ( getResourceIdentifierReferenceParameterName() == null )
+        if (getResourceIdentifierReferenceParameterName() == null)
         {
             return null;
         }
         try
         {
             SOAPHeader soapHeader = context.getSOAPMessage().getSOAPHeader();
-            Iterator resourceIdElemsIter = soapHeader.getChildElements(
-                    NameUtils.toName( getResourceIdentifierReferenceParameterQName() ) );
-            if ( !resourceIdElemsIter.hasNext() )
+            Iterator resourceIdElemsIter = soapHeader.getChildElements(NameUtils.toName(getResourceIdentifierReferenceParameterQName()));
+            if (!resourceIdElemsIter.hasNext())
             {
-                throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
-                        "The expected resource identifier reference parameter named " + getResourceIdentifierReferenceParameterName()
+ " was not found in the SOAP header." );
+                throw new FaultException(Soap1_1Constants.FAULT_CLIENT,
+                                         "The expected resource identifier reference parameter
named " + getResourceIdentifierReferenceParameterName() + " was not found in the SOAP header.");
             }
             SOAPHeaderElement resourceIdElem = (SOAPHeaderElement) resourceIdElemsIter.next();
-            if ( resourceIdElemsIter.hasNext() )
+            if (resourceIdElemsIter.hasNext())
             {
-                throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
-                        "More than one resource identifier reference parameter named " +
getResourceIdentifierReferenceParameterName() + " was found in the SOAP header. Exactly one
is expected." );
+                throw new FaultException(Soap1_1Constants.FAULT_CLIENT,
+                                         "More than one resource identifier reference parameter
named " + getResourceIdentifierReferenceParameterName() + " was found in the SOAP header.
Exactly one is expected.");
             }
             return resourceIdElem.getValue();
         }
-        catch ( SOAPException soape )
+        catch (SOAPException soape)
         {
-            throw new JAXRPCException( soape );
+            throw new JAXRPCException(soape);
         }
     }
 
@@ -801,21 +797,20 @@
      * maintaining a static reference to that map.
      *
      * @param isPersistent if the resource is persistent
-     *
      * @return a synschronized map for storing {@link Resource}s
      */
-    protected static Map createResourceMap( boolean isPersistent )
+    protected static Map createResourceMap(boolean isPersistent)
     {
         Map resourceMap;
-        if ( isPersistent )
+        if (isPersistent)
         {
-            resourceMap = new ReferenceMap( ReferenceMap.HARD, ReferenceMap.SOFT, true );
+            resourceMap = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT, true);
         }
         else
         {
             resourceMap = new HashMap();
         }
-        return Collections.synchronizedMap( resourceMap );
+        return Collections.synchronizedMap(resourceMap);
     }
 
 }



Mime
View raw message