ws-wsrf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r227033 [6/27] - in /webservices/wsrf/trunk: ./ src/java/org/apache/ws/ src/java/org/apache/ws/addressing/ src/java/org/apache/ws/addressing/v2003_03/ src/java/org/apache/ws/addressing/v2004_08_10/ src/java/org/apache/ws/resource/ src/java/...
Date Tue, 02 Aug 2005 16:30:44 GMT
Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceCapabilityImpl.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceCapabilityImpl.java?rev=227033&r1=227032&r2=227033&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceCapabilityImpl.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceCapabilityImpl.java Tue Aug  2 09:28:49 2005
@@ -1,25 +1,24 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
+/*=============================================================================*
+ *  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
+ *  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.
- */
+ *  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 org.apache.ws.resource.impl;
 
 import org.apache.ws.resource.InvalidWsrfWsdlException;
 import org.apache.ws.resource.ResourceCapability;
 import org.apache.ws.util.WsdlUtils;
 import org.apache.ws.util.WsrfWsdlUtils;
-
 import javax.wsdl.Definition;
 import javax.wsdl.Import;
 import javax.wsdl.Operation;
@@ -27,6 +26,8 @@
 import javax.wsdl.factory.WSDLFactory;
 import javax.wsdl.xml.WSDLReader;
 import javax.xml.namespace.QName;
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -35,8 +36,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.net.URL;
-import java.net.MalformedURLException;
 
 /**
  * A {@link ResourceCapability} implementation.
@@ -44,467 +43,535 @@
  * @author Ian Springer (ian DOT springer AT hp DOT com)
  */
 public class ResourceCapabilityImpl
-        implements ResourceCapability
+   implements ResourceCapability
 {
-
-    private Definition m_def;
-    private PortType m_portType;
-    private Map m_implementedResourceDefs;
-    private QName[] m_propNames;
-    private String[] m_customOpNames;
-    private QName[] m_customPropNames;
-    private QName m_propsDocName;
-    private String m_metadataDescLocation;
-    private QName m_metadataDescName;
-    private URL m_baseUrl;
-
-    /**
-     * Creates a new {@link ResourceCapabilityImpl} based on the specified JWSDL definition and portType.
-     *
-     * @param def a JWSDL definition
-     * @param baseURL
-     */
-    public ResourceCapabilityImpl(Definition def, PortType portType, URL baseURL) throws InvalidWsrfWsdlException
-    {
-        m_def = def;
-        m_portType = portType;
-        m_baseUrl = baseURL;
-        initImplementedPortTypes();
-        initCustomOperations();
-        initPropertyNames();
-        m_metadataDescName = WsrfWsdlUtils.getMetadataDescriptorName( m_portType );
-        m_metadataDescLocation = WsrfWsdlUtils.getMetadataDescriptorLocation( m_portType );
-        if ( !m_def.getTargetNamespace().startsWith( "http://docs.oasis-open.org/" ) )
-        {
-            validateOperations();
-            validateProperties();
-        }
-    }
-
-    protected void validateProperties() throws InvalidWsrfWsdlException
-    {
-        boolean isValid = true;
-        List propNameList;
-        if (m_propNames != null)//avoid a null pointer if m_propNames are null (i.e. no props defined)
-        {
-            propNameList = Arrays.asList( m_propNames );
-        }
-        else
-        {
-            propNameList = new ArrayList();//no properties were defined....
-        }   //continue checking if implemented defs had props that the user didn't implement
-        Iterator defIter = m_implementedResourceDefs.values().iterator();
-        while ( defIter.hasNext() )
-        {
-            ResourceCapability def = (ResourceCapability) defIter.next();
-            if ( def.hasProperties() )
-            {
-                QName[] propNames = def.getPropertyNames();
-                Set missingPropNames = new HashSet();
-                for ( int i = 0; i < propNames.length; i++ )
-                {
-                    if ( !propNameList.contains( propNames[i] ) )
-                    {
-                        missingPropNames.add( propNames[i] );
-                    }
-                }
-                if ( !missingPropNames.isEmpty() )
-                {
-                    System.err.println(
-                            "PortType implements the operations from the " + def.getPortType().getQName() +
-                            " portType but does not define the following required properties: " +
-                            missingPropNames );
-                    isValid = false;
-                }
-            }
-        }
-        if ( !isValid )
-        {
-            throw new InvalidWsrfWsdlException(
-                    "PortType " + m_portType.getQName() +
-                    " does not define one or more properties required by the portTypes it implements." );
-        }
-    }
-
-    protected void validateOperations()
-            throws InvalidWsrfWsdlException
-    {
-        if ( hasProperties() )
-        {
-            if ( !m_implementedResourceDefs.containsKey( org.apache.ws.resource.properties.v2004_11.porttype.GetResourcePropertyPortType.NAME ) && !m_implementedResourceDefs.containsKey( org.apache.ws.resource.properties.v2004_06.porttype.GetResourcePropertyPortType.NAME ) )
-            {
-                throw new InvalidWsrfWsdlException(
-                        "PortType " + m_portType.getQName() +
-                        " defines a wsrp:ResourceProperties attribute but does not implement the WSRF-RP GetResourceProperty portType." );
-            }
-        }
-        else
-        {
-            Iterator resourceDefNames = m_implementedResourceDefs.keySet().iterator();
-            while ( resourceDefNames.hasNext() )
-            {
-                QName resourceDefName = (QName) resourceDefNames.next();
-                if ( resourceDefName.getNamespaceURI().equals( org.apache.ws.resource.properties.v2004_11.ResourcePropertiesConstants.NSURI_WSRP_WSDL ) ||
-                     resourceDefName.getNamespaceURI().equals( org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSURI_WSRP_WSDL ))
-                {
-                    throw new InvalidWsrfWsdlException(
-                        "PortType " + m_portType.getQName() +
-                        " does not define a wsrp:ResourceProperties attribute but implements one or more WSRF-RP portTypes." );
-                }
-            }
-        }
-    }
-
-    public boolean hasProperties()
-    {
-        return m_propNames != null;
-    }
-
-    private void initPropertyNames() throws InvalidWsrfWsdlException
-    {
-        m_propsDocName = WsrfWsdlUtils.getResourcePropertiesDocumentName( m_portType );
-        m_propNames = WsrfWsdlUtils.getResourcePropertyNames( m_propsDocName, m_def, m_baseUrl );
-        Set customPropNames = new HashSet();
-        if ( hasProperties() )
-        {
-            Set inheritedPropNames = getInheritedPropertyNames();
-            for ( int i = 0; i < m_propNames.length; i++ )
-            {
-                if ( !isInheritedProperty( inheritedPropNames, m_propNames[i] ) )
-                {
-                    customPropNames.add( m_propNames[i] );
-                }
-            }
-        }
-        m_customPropNames = (QName[]) customPropNames.toArray( new QName[0] );
-    }
-
-    public Map getImplementedResourceCapabilities()
-    {
-        return m_implementedResourceDefs;
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public String[] getCustomOperationNames()
-    {
-        return m_customOpNames;
-    }
-
-    /**
-     * @return
-     */
-    public QName[] getCustomPropertyNames()
-    {
-        return m_customPropNames;
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public Definition getDefinition()
-    {
-        return m_def;
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public PortType getPortType()
-    {
-        return m_portType;
-    }
-
-    private void initImplementedPortTypes() throws InvalidWsrfWsdlException
-    {
-        m_implementedResourceDefs = new HashMap();
-        ResourceCapability[] importedResourceDefs = getImportedResourceDefinitions();
-        for ( int i = 0; i < importedResourceDefs.length; i++ )
-        {
-            PortType importedPortType = importedResourceDefs[i].getPortType();
-            if ( WsrfWsdlUtils.implementsPortType( m_portType, importedPortType ) )
-            {
-                m_implementedResourceDefs.put( importedPortType.getQName(),
-                        importedResourceDefs[i] );
-            }
-        }
-    }
-
-    private ResourceCapability[] getImportedResourceDefinitions() throws InvalidWsrfWsdlException
-    {
-        List importedResourceDefs = new ArrayList();
-        Import[] imports = getImports( m_def );
-        for ( int i = 0; i < imports.length; i++ )
-        {
-            Definition def = imports[i].getDefinition();
-            Map portTypes = def.getPortTypes();
-            Iterator portTypeIter = portTypes.values().iterator();
-            while ( portTypeIter.hasNext() )
-            {
-                PortType portType = (PortType) portTypeIter.next();
-                URL baseUrl = null;
-                try
-                {
-                    baseUrl = new URL(m_baseUrl, imports[i].getLocationURI());
-                }
-                catch (MalformedURLException e)
-                {
-                    throw new InvalidWsrfWsdlException("Invalid import location " + imports[i].getLocationURI());
-                }
-                importedResourceDefs.add( new ResourceCapabilityImpl( def, portType, baseUrl) );
-            }
-        }
-        return (ResourceCapability[]) importedResourceDefs.toArray( new ResourceCapability[0] );
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public QName[] getPropertyNames()
-    {
-        return m_propNames;
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public String toString()
-    {
-        StringBuffer strBuf = new StringBuffer();
-        strBuf.append( "=== WS-Resource Definition defined via portType " + m_portType.getQName() + " ===\n" );
-        strBuf.append( "Implemented PortTypes:\n" );
-        if ( m_implementedResourceDefs.isEmpty() )
-        {
-            strBuf.append( "\t<NONE>\n" );
-        }
-        else
-        {
-            Iterator implementedPortTypeNameIter = m_implementedResourceDefs.keySet().iterator();
-            while ( implementedPortTypeNameIter.hasNext() )
-            {
-                QName portTypeName = (QName) implementedPortTypeNameIter.next();
-                strBuf.append( "\t" + portTypeName + "\n" );
-            }
-        }
-        strBuf.append( "Custom Operations:\n" );
-        if ( m_customOpNames.length == 0 )
-        {
-            strBuf.append( "\t<NONE>\n" );
-        }
-        else
-        {
-            for ( int i = 0; i < m_customOpNames.length; i++ )
-            {
-                strBuf.append( "\t" + m_customOpNames[i] + "\n" );
-            }
-        }
-        strBuf.append( "Custom Properties:\n" );
-        if ( !hasProperties() )
-        {
-            strBuf.append( "\t<NONE>\n" );
-        }
-        else
-        {
-            for ( int i = 0; i < m_customPropNames.length; i++ )
-            {
-                strBuf.append( "\t" + m_customPropNames[i] + "\n" );
-            }
-        }
-        return strBuf.toString();
-    }
-
-    private Import[] getImports( Definition def )
-    {
-        Set importSet = new HashSet();
-        Map importMap = def.getImports();
-        Iterator iter = importMap.keySet().iterator();
-        while ( iter.hasNext() )
-        {
-            String nsURI = (String) iter.next();
-            Iterator importsIter = ( (List) importMap.get( nsURI ) ).iterator();
-            while ( importsIter.hasNext() )
-            {
-                Import anImport = (Import) importsIter.next();
-                Import[] importDefImports = getImports( anImport.getDefinition() );
-                List imports = new ArrayList();
-                imports.add( anImport );
-                imports.addAll( Arrays.asList( importDefImports ) );
-                for ( int i = 0; i < imports.size(); i++ )
-                {
-                    Import importToCheck = (Import) imports.get( i );
-                    if ( !importIsRedundant( importSet, importToCheck ) )
-                    {
-                        importSet.add( anImport );
-                    }
-                }
-            }
-        }
-        return (Import[]) importSet.toArray( new Import[0] );
-    }
-
-    private boolean importIsRedundant( Set imports, Import anImport )
-    {
-        boolean importIsRedundant = false;
-        Iterator importIter = imports.iterator();
-        while ( importIter.hasNext() )
-        {
-            Import anotherImport = (Import) importIter.next();
-            if ( WsdlUtils.equals( anImport, anotherImport ) )
-            {
-                importIsRedundant = true;
-                break;
-            }
-        }
-        return importIsRedundant;
-    }
-
-    private void initCustomOperations()
-    {
-        Set customOpNames = new HashSet();
-        Set inheritedOps = getInheritedOperations();
-        List ops = m_portType.getOperations();
-        for ( int i = 0; i < ops.size(); i++ )
-        {
-            Operation op = (Operation) ops.get( i );
-            if ( !isInheritedOperation( inheritedOps, op ) )
-            {
-                customOpNames.add( op.getName() );
-            }
-        }
-        m_customOpNames = (String[]) customOpNames.toArray( new String[0] );
-    }
-
-    private boolean isInheritedOperation( Set inheritedOps, Operation op )
-    {
-        boolean isInheritedOp = false;
-        Iterator inheritedOpIter = inheritedOps.iterator();
-        while ( inheritedOpIter.hasNext() )
-        {
-            Operation inheritedOp = (Operation) inheritedOpIter.next();
-            if ( WsdlUtils.equals( op, inheritedOp ) )
-            {
-                isInheritedOp = true;
-                break;
-            }
-        }
-        return isInheritedOp;
-    }
-
-    private boolean isInheritedProperty( Set inheritedPropNames, QName propName )
-    {
-        boolean isInheritedProp = false;
-        Iterator inheritedPropNameIter = inheritedPropNames.iterator();
-        while ( inheritedPropNameIter.hasNext() )
-        {
-            QName inheritedPropName = (QName) inheritedPropNameIter.next();
-            if ( inheritedPropName.equals( propName ) )
-            {
-                isInheritedProp = true;
-                break;
-            }
-        }
-        return isInheritedProp;
-    }
-
-    private Set getInheritedOperations()
-    {
-        Set specOps = new HashSet();
-        Iterator defIter = m_implementedResourceDefs.values().iterator();
-        while ( defIter.hasNext() )
-        {
-            ResourceCapability def = (ResourceCapability) defIter.next();
-            List ops = def.getPortType().getOperations();
-            for ( int i = 0; i < ops.size(); i++ )
-            {
-                specOps.add( (Operation) ops.get( i ) );
-            }
-        }
-        return specOps;
-    }
-
-    private Set getInheritedPropertyNames()
-    {
-        Set inheritedPropNames = new HashSet();
-        Iterator defIter = m_implementedResourceDefs.values().iterator();
-        while ( defIter.hasNext() )
-        {
-            ResourceCapability def = (ResourceCapability) defIter.next();
-            if ( def.hasProperties() )
-            {
-                QName[] propNames = def.getPropertyNames();
-                for ( int i = 0; i < propNames.length; i++ )
-                {
-                    inheritedPropNames.add( propNames[i] );
-                }
-            }
-        }
-        return inheritedPropNames;
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @param args DOCUMENT_ME
-     *
-     * @throws Exception DOCUMENT_ME
-     */
-    public static void main( String[] args ) throws Exception
-    {
-        WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
-        String wsdlPath = "C:\\opt\\pubscribe-1.0-beta1\\webapps\\pubscribe\\wsdl\\FileSystem.wsdl";
-        Definition def = wsdlReader.readWSDL( wsdlPath );
-        PortType portType = (PortType) def.getPortTypes().values().toArray()[0];
-        ResourceCapability wsResourceDef = null;
-        try
-        {
-            wsResourceDef = new ResourceCapabilityImpl( def, portType, null);
-        }
-        catch ( InvalidWsrfWsdlException iwwe )
-        {
-            System.err.println( iwwe );
-            System.exit( 1 );
-        }
-        System.out.println( wsResourceDef );
-
-        Map implementedResourceDefs = wsResourceDef.getImplementedResourceCapabilities();
-        Iterator specDefs = implementedResourceDefs.values().iterator();
-        while ( specDefs.hasNext() )
-        {
-            System.out.println( (ResourceCapability) specDefs.next() );
-        }
-        System.out.println( wsResourceDef.getMetadataDescriptorName() );
-        System.out.println( wsResourceDef.getMetadataDescriptorLocation() );
-    }
-
-    public boolean implementsResourceCapability( QName capabilityName )
-    {
-        return m_implementedResourceDefs.containsKey( capabilityName );
-    }
-
-    public QName getPropertiesDocumentName()
-    {
-        return m_propsDocName;
-    }
-
-    public QName getMetadataDescriptorName()
-    {
-        return m_metadataDescName;
-    }
-
-    public String getMetadataDescriptorLocation()
-    {
-        return m_metadataDescLocation;
-    }
-
-}
+   private Definition m_def;
+   private PortType   m_portType;
+   private Map        m_implementedResourceDefs;
+   private QName[]    m_propNames;
+   private String[]   m_customOpNames;
+   private QName[]    m_customPropNames;
+   private QName      m_propsDocName;
+   private String     m_metadataDescLocation;
+   private QName      m_metadataDescName;
+   private URL        m_baseUrl;
+
+   /**
+    * Creates a new {@link ResourceCapabilityImpl} based on the specified JWSDL definition and portType.
+    *
+    * @param def a JWSDL definition
+    * @param baseURL
+    */
+   public ResourceCapabilityImpl( Definition def,
+                                  PortType   portType,
+                                  URL        baseURL )
+   throws InvalidWsrfWsdlException
+   {
+      m_def         = def;
+      m_portType    = portType;
+      m_baseUrl     = baseURL;
+      initImplementedPortTypes(  );
+      initCustomOperations(  );
+      initPropertyNames(  );
+      m_metadataDescName        = WsrfWsdlUtils.getMetadataDescriptorName( m_portType );
+      m_metadataDescLocation    = WsrfWsdlUtils.getMetadataDescriptorLocation( m_portType );
+      if ( !m_def.getTargetNamespace(  ).startsWith( "http://docs.oasis-open.org/" ) )
+      {
+         validateOperations(  );
+         validateProperties(  );
+      }
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public String[] getCustomOperationNames(  )
+   {
+      return m_customOpNames;
+   }
+
+   /**
+    * @return
+    */
+   public QName[] getCustomPropertyNames(  )
+   {
+      return m_customPropNames;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public Definition getDefinition(  )
+   {
+      return m_def;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public Map getImplementedResourceCapabilities(  )
+   {
+      return m_implementedResourceDefs;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public PortType getPortType(  )
+   {
+      return m_portType;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public QName[] getPropertyNames(  )
+   {
+      return m_propNames;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public boolean hasProperties(  )
+   {
+      return m_propNames != null;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param args DOCUMENT_ME
+    *
+    * @throws Exception DOCUMENT_ME
+    */
+   public static void main( String[] args )
+   throws Exception
+   {
+      WSDLReader         wsdlReader    = WSDLFactory.newInstance(  ).newWSDLReader(  );
+      String             wsdlPath      = "C:\\opt\\pubscribe-1.0-beta1\\webapps\\pubscribe\\wsdl\\FileSystem.wsdl";
+      Definition         def           = wsdlReader.readWSDL( wsdlPath );
+      PortType           portType      = (PortType) def.getPortTypes(  ).values(  ).toArray(  )[0];
+      ResourceCapability wsResourceDef = null;
+      try
+      {
+         wsResourceDef = new ResourceCapabilityImpl( def, portType, null );
+      }
+      catch ( InvalidWsrfWsdlException iwwe )
+      {
+         System.err.println( iwwe );
+         System.exit( 1 );
+      }
+
+      System.out.println( wsResourceDef );
+
+      Map      implementedResourceDefs = wsResourceDef.getImplementedResourceCapabilities(  );
+      Iterator specDefs = implementedResourceDefs.values(  ).iterator(  );
+      while ( specDefs.hasNext(  ) )
+      {
+         System.out.println( (ResourceCapability) specDefs.next(  ) );
+      }
+
+      System.out.println( wsResourceDef.getMetadataDescriptorName(  ) );
+      System.out.println( wsResourceDef.getMetadataDescriptorLocation(  ) );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public String getMetadataDescriptorLocation(  )
+   {
+      return m_metadataDescLocation;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public QName getMetadataDescriptorName(  )
+   {
+      return m_metadataDescName;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public QName getPropertiesDocumentName(  )
+   {
+      return m_propsDocName;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param capabilityName DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public boolean implementsResourceCapability( QName capabilityName )
+   {
+      return m_implementedResourceDefs.containsKey( capabilityName );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public String toString(  )
+   {
+      StringBuffer strBuf = new StringBuffer(  );
+      strBuf.append( "=== WS-Resource Definition defined via portType " + m_portType.getQName(  ) + " ===\n" );
+      strBuf.append( "Implemented PortTypes:\n" );
+      if ( m_implementedResourceDefs.isEmpty(  ) )
+      {
+         strBuf.append( "\t<NONE>\n" );
+      }
+      else
+      {
+         Iterator implementedPortTypeNameIter = m_implementedResourceDefs.keySet(  ).iterator(  );
+         while ( implementedPortTypeNameIter.hasNext(  ) )
+         {
+            QName portTypeName = (QName) implementedPortTypeNameIter.next(  );
+            strBuf.append( "\t" + portTypeName + "\n" );
+         }
+      }
+
+      strBuf.append( "Custom Operations:\n" );
+      if ( m_customOpNames.length == 0 )
+      {
+         strBuf.append( "\t<NONE>\n" );
+      }
+      else
+      {
+         for ( int i = 0; i < m_customOpNames.length; i++ )
+         {
+            strBuf.append( "\t" + m_customOpNames[i] + "\n" );
+         }
+      }
+
+      strBuf.append( "Custom Properties:\n" );
+      if ( !hasProperties(  ) )
+      {
+         strBuf.append( "\t<NONE>\n" );
+      }
+      else
+      {
+         for ( int i = 0; i < m_customPropNames.length; i++ )
+         {
+            strBuf.append( "\t" + m_customPropNames[i] + "\n" );
+         }
+      }
+
+      return strBuf.toString(  );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @throws InvalidWsrfWsdlException DOCUMENT_ME
+    */
+   protected void validateOperations(  )
+   throws InvalidWsrfWsdlException
+   {
+      if ( hasProperties(  ) )
+      {
+         if ( !m_implementedResourceDefs.containsKey( org.apache.ws.resource.properties.v2004_11.porttype.GetResourcePropertyPortType.NAME )
+              && !m_implementedResourceDefs.containsKey( org.apache.ws.resource.properties.v2004_06.porttype.GetResourcePropertyPortType.NAME ) )
+         {
+            throw new InvalidWsrfWsdlException( "PortType " + m_portType.getQName(  )
+                                                + " defines a wsrp:ResourceProperties attribute but does not implement the WSRF-RP GetResourceProperty portType." );
+         }
+      }
+      else
+      {
+         Iterator resourceDefNames = m_implementedResourceDefs.keySet(  ).iterator(  );
+         while ( resourceDefNames.hasNext(  ) )
+         {
+            QName resourceDefName = (QName) resourceDefNames.next(  );
+            if ( resourceDefName.getNamespaceURI(  ).equals( org.apache.ws.resource.properties.v2004_11.ResourcePropertiesConstants.NSURI_WSRP_WSDL )
+                 || resourceDefName.getNamespaceURI(  ).equals( org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSURI_WSRP_WSDL ) )
+            {
+               throw new InvalidWsrfWsdlException( "PortType " + m_portType.getQName(  )
+                                                   + " does not define a wsrp:ResourceProperties attribute but implements one or more WSRF-RP portTypes." );
+            }
+         }
+      }
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @throws InvalidWsrfWsdlException DOCUMENT_ME
+    */
+   protected void validateProperties(  )
+   throws InvalidWsrfWsdlException
+   {
+      boolean isValid      = true;
+      List    propNameList;
+      if ( m_propNames != null ) //avoid a null pointer if m_propNames are null (i.e. no props defined)
+      {
+         propNameList = Arrays.asList( m_propNames );
+      }
+      else
+      {
+         propNameList = new ArrayList(  ); //no properties were defined....
+      } //continue checking if implemented defs had props that the user didn't implement
+
+      Iterator defIter = m_implementedResourceDefs.values(  ).iterator(  );
+      while ( defIter.hasNext(  ) )
+      {
+         ResourceCapability def = (ResourceCapability) defIter.next(  );
+         if ( def.hasProperties(  ) )
+         {
+            QName[] propNames        = def.getPropertyNames(  );
+            Set     missingPropNames = new HashSet(  );
+            for ( int i = 0; i < propNames.length; i++ )
+            {
+               if ( !propNameList.contains( propNames[i] ) )
+               {
+                  missingPropNames.add( propNames[i] );
+               }
+            }
+
+            if ( !missingPropNames.isEmpty(  ) )
+            {
+               System.err.println( "PortType implements the operations from the "
+                                   + def.getPortType(  ).getQName(  )
+                                   + " portType but does not define the following required properties: "
+                                   + missingPropNames );
+               isValid = false;
+            }
+         }
+      }
+
+      if ( !isValid )
+      {
+         throw new InvalidWsrfWsdlException( "PortType " + m_portType.getQName(  )
+                                             + " does not define one or more properties required by the portTypes it implements." );
+      }
+   }
+
+   private ResourceCapability[] getImportedResourceDefinitions(  )
+   throws InvalidWsrfWsdlException
+   {
+      List     importedResourceDefs = new ArrayList(  );
+      Import[] imports = getImports( m_def );
+      for ( int i = 0; i < imports.length; i++ )
+      {
+         Definition def          = imports[i].getDefinition(  );
+         Map        portTypes    = def.getPortTypes(  );
+         Iterator   portTypeIter = portTypes.values(  ).iterator(  );
+         while ( portTypeIter.hasNext(  ) )
+         {
+            PortType portType = (PortType) portTypeIter.next(  );
+            URL      baseUrl = null;
+            try
+            {
+               baseUrl = new URL( m_baseUrl,
+                                  imports[i].getLocationURI(  ) );
+            }
+            catch ( MalformedURLException e )
+            {
+               throw new InvalidWsrfWsdlException( "Invalid import location " + imports[i].getLocationURI(  ) );
+            }
+
+            importedResourceDefs.add( new ResourceCapabilityImpl( def, portType, baseUrl ) );
+         }
+      }
+
+      return (ResourceCapability[]) importedResourceDefs.toArray( new ResourceCapability[0] );
+   }
+
+   private Import[] getImports( Definition def )
+   {
+      Set      importSet = new HashSet(  );
+      Map      importMap = def.getImports(  );
+      Iterator iter      = importMap.keySet(  ).iterator(  );
+      while ( iter.hasNext(  ) )
+      {
+         String   nsURI       = (String) iter.next(  );
+         Iterator importsIter = ( (List) importMap.get( nsURI ) ).iterator(  );
+         while ( importsIter.hasNext(  ) )
+         {
+            Import   anImport         = (Import) importsIter.next(  );
+            Import[] importDefImports = getImports( anImport.getDefinition(  ) );
+            List     imports          = new ArrayList(  );
+            imports.add( anImport );
+            imports.addAll( Arrays.asList( importDefImports ) );
+            for ( int i = 0; i < imports.size(  ); i++ )
+            {
+               Import importToCheck = (Import) imports.get( i );
+               if ( !importIsRedundant( importSet, importToCheck ) )
+               {
+                  importSet.add( anImport );
+               }
+            }
+         }
+      }
+
+      return (Import[]) importSet.toArray( new Import[0] );
+   }
+
+   private boolean isInheritedOperation( Set       inheritedOps,
+                                         Operation op )
+   {
+      boolean  isInheritedOp   = false;
+      Iterator inheritedOpIter = inheritedOps.iterator(  );
+      while ( inheritedOpIter.hasNext(  ) )
+      {
+         Operation inheritedOp = (Operation) inheritedOpIter.next(  );
+         if ( WsdlUtils.equals( op, inheritedOp ) )
+         {
+            isInheritedOp = true;
+            break;
+         }
+      }
+
+      return isInheritedOp;
+   }
+
+   private Set getInheritedOperations(  )
+   {
+      Set      specOps = new HashSet(  );
+      Iterator defIter = m_implementedResourceDefs.values(  ).iterator(  );
+      while ( defIter.hasNext(  ) )
+      {
+         ResourceCapability def = (ResourceCapability) defIter.next(  );
+         List               ops = def.getPortType(  ).getOperations(  );
+         for ( int i = 0; i < ops.size(  ); i++ )
+         {
+            specOps.add( (Operation) ops.get( i ) );
+         }
+      }
+
+      return specOps;
+   }
+
+   private boolean isInheritedProperty( Set   inheritedPropNames,
+                                        QName propName )
+   {
+      boolean  isInheritedProp       = false;
+      Iterator inheritedPropNameIter = inheritedPropNames.iterator(  );
+      while ( inheritedPropNameIter.hasNext(  ) )
+      {
+         QName inheritedPropName = (QName) inheritedPropNameIter.next(  );
+         if ( inheritedPropName.equals( propName ) )
+         {
+            isInheritedProp = true;
+            break;
+         }
+      }
+
+      return isInheritedProp;
+   }
+
+   private Set getInheritedPropertyNames(  )
+   {
+      Set      inheritedPropNames = new HashSet(  );
+      Iterator defIter = m_implementedResourceDefs.values(  ).iterator(  );
+      while ( defIter.hasNext(  ) )
+      {
+         ResourceCapability def = (ResourceCapability) defIter.next(  );
+         if ( def.hasProperties(  ) )
+         {
+            QName[] propNames = def.getPropertyNames(  );
+            for ( int i = 0; i < propNames.length; i++ )
+            {
+               inheritedPropNames.add( propNames[i] );
+            }
+         }
+      }
+
+      return inheritedPropNames;
+   }
+
+   private boolean importIsRedundant( Set    imports,
+                                      Import anImport )
+   {
+      boolean  importIsRedundant = false;
+      Iterator importIter = imports.iterator(  );
+      while ( importIter.hasNext(  ) )
+      {
+         Import anotherImport = (Import) importIter.next(  );
+         if ( WsdlUtils.equals( anImport, anotherImport ) )
+         {
+            importIsRedundant = true;
+            break;
+         }
+      }
+
+      return importIsRedundant;
+   }
+
+   private void initCustomOperations(  )
+   {
+      Set  customOpNames = new HashSet(  );
+      Set  inheritedOps = getInheritedOperations(  );
+      List ops          = m_portType.getOperations(  );
+      for ( int i = 0; i < ops.size(  ); i++ )
+      {
+         Operation op = (Operation) ops.get( i );
+         if ( !isInheritedOperation( inheritedOps, op ) )
+         {
+            customOpNames.add( op.getName(  ) );
+         }
+      }
+
+      m_customOpNames = (String[]) customOpNames.toArray( new String[0] );
+   }
+
+   private void initImplementedPortTypes(  )
+   throws InvalidWsrfWsdlException
+   {
+      m_implementedResourceDefs = new HashMap(  );
+      ResourceCapability[] importedResourceDefs = getImportedResourceDefinitions(  );
+      for ( int i = 0; i < importedResourceDefs.length; i++ )
+      {
+         PortType importedPortType = importedResourceDefs[i].getPortType(  );
+         if ( WsrfWsdlUtils.implementsPortType( m_portType, importedPortType ) )
+         {
+            m_implementedResourceDefs.put( importedPortType.getQName(  ),
+                                           importedResourceDefs[i] );
+         }
+      }
+   }
+
+   private void initPropertyNames(  )
+   throws InvalidWsrfWsdlException
+   {
+      m_propsDocName       = WsrfWsdlUtils.getResourcePropertiesDocumentName( m_portType );
+      m_propNames          = WsrfWsdlUtils.getResourcePropertyNames( m_propsDocName, m_def, m_baseUrl );
+      Set customPropNames  = new HashSet(  );
+      if ( hasProperties(  ) )
+      {
+         Set inheritedPropNames = getInheritedPropertyNames(  );
+         for ( int i = 0; i < m_propNames.length; i++ )
+         {
+            if ( !isInheritedProperty( inheritedPropNames, m_propNames[i] ) )
+            {
+               customPropNames.add( m_propNames[i] );
+            }
+         }
+      }
+
+      m_customPropNames = (QName[]) customPropNames.toArray( new QName[0] );
+   }
+}
\ No newline at end of file

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceDefinitionImpl.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceDefinitionImpl.java?rev=227033&r1=227032&r2=227033&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceDefinitionImpl.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceDefinitionImpl.java Tue Aug  2 09:28:49 2005
@@ -1,108 +1,138 @@
-/*=============================================================================*
- *  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 org.apache.ws.resource.impl;
-
-import org.apache.ws.resource.InvalidWsrfWsdlException;
-import org.apache.ws.resource.ResourceDefinition;
-
-import javax.wsdl.Binding;
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.PortType;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import java.net.URL;
-import java.util.List;
-
-/**
- * A {@link ResourceDefinition} implementation.
- *
- * @author Ian Springer (ian DOT springer AT hp DOT com)
- */
-public class ResourceDefinitionImpl extends ResourceCapabilityImpl implements ResourceDefinition
-{
-
-    private Port m_port;
-    private String m_name;
-    private String m_endpointURL;
-
-    public ResourceDefinitionImpl(Definition def, javax.wsdl.Port port, URL baseUrl)
-            throws InvalidWsrfWsdlException
-    {
-        super( def, getResourcePortType( port ), baseUrl);
-        m_port = port;
-        m_name = port.getName();
-        m_endpointURL = extractEndpointURL( m_port );
-    }
-
-    private static PortType getResourcePortType( Port port ) throws InvalidWsrfWsdlException
-    {
-        Binding binding = port.getBinding();
-        if(binding != null)
-        {
-            PortType portType = binding.getPortType();
-            if(portType == null)
-            {
-               throw new InvalidWsrfWsdlException("The binding has no portType associated with it!");
-            }
-            return portType;
-        }
-        else
-        {
-            throw new InvalidWsrfWsdlException("The port has no binding associated with it!");
-        }
-    }
-
-    public Port getPort()
-    {
-        return m_port;
-    }
-
-    public String getName()
-    {
-        return m_name;
-    }
-
-    public String getEndpointURL()
-    {
-        return m_endpointURL;
-    }
-
-    private String extractEndpointURL(Port port) throws InvalidWsrfWsdlException
-    {
-        String endpointURL = null;
-
-        List extElems = port.getExtensibilityElements();
-        for ( int i = 0; i < extElems.size(); i++ )
-        {
-            ExtensibilityElement extElem = (ExtensibilityElement) extElems.get( i );
-            if ( extElem instanceof SOAPAddress )
-            {
-                SOAPAddress soapAddr = (SOAPAddress) extElem;
-                endpointURL = soapAddr.getLocationURI();
-                break;
-            }
-        }
-        if ( endpointURL == null )
-        {
-            throw new InvalidWsrfWsdlException(
-                    "Failed to obtain service endpoint URL from port " + m_name +
-                    " service's wsdl:port/soap:address/@location attribute" );
-        }
-        return endpointURL;
-    }
-
-}
+/*=============================================================================*
+ *  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 org.apache.ws.resource.impl;
+
+import org.apache.ws.resource.InvalidWsrfWsdlException;
+import org.apache.ws.resource.ResourceDefinition;
+import javax.wsdl.Binding;
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.PortType;
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import java.net.URL;
+import java.util.List;
+
+/**
+ * A {@link ResourceDefinition} implementation.
+ *
+ * @author Ian Springer (ian DOT springer AT hp DOT com)
+ */
+public class ResourceDefinitionImpl
+   extends ResourceCapabilityImpl
+   implements ResourceDefinition
+{
+   private Port   m_port;
+   private String m_name;
+   private String m_endpointURL;
+
+   /**
+    * Creates a new {@link ResourceDefinitionImpl} object.
+    *
+    * @param def DOCUMENT_ME
+    * @param port DOCUMENT_ME
+    * @param baseUrl DOCUMENT_ME
+    *
+    * @throws InvalidWsrfWsdlException DOCUMENT_ME
+    */
+   public ResourceDefinitionImpl( Definition      def,
+                                  javax.wsdl.Port port,
+                                  URL             baseUrl )
+   throws InvalidWsrfWsdlException
+   {
+      super( def,
+             getResourcePortType( port ), baseUrl );
+      m_port           = port;
+      m_name           = port.getName(  );
+      m_endpointURL    = extractEndpointURL( m_port );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public String getEndpointURL(  )
+   {
+      return m_endpointURL;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public String getName(  )
+   {
+      return m_name;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public Port getPort(  )
+   {
+      return m_port;
+   }
+
+   private static PortType getResourcePortType( Port port )
+   throws InvalidWsrfWsdlException
+   {
+      Binding binding = port.getBinding(  );
+      if ( binding != null )
+      {
+         PortType portType = binding.getPortType(  );
+         if ( portType == null )
+         {
+            throw new InvalidWsrfWsdlException( "The binding has no portType associated with it!" );
+         }
+
+         return portType;
+      }
+      else
+      {
+         throw new InvalidWsrfWsdlException( "The port has no binding associated with it!" );
+      }
+   }
+
+   private String extractEndpointURL( Port port )
+   throws InvalidWsrfWsdlException
+   {
+      String endpointURL = null;
+
+      List   extElems = port.getExtensibilityElements(  );
+      for ( int i = 0; i < extElems.size(  ); i++ )
+      {
+         ExtensibilityElement extElem = (ExtensibilityElement) extElems.get( i );
+         if ( extElem instanceof SOAPAddress )
+         {
+            SOAPAddress soapAddr = (SOAPAddress) extElem;
+            endpointURL = soapAddr.getLocationURI(  );
+            break;
+         }
+      }
+
+      if ( endpointURL == null )
+      {
+         throw new InvalidWsrfWsdlException( "Failed to obtain service endpoint URL from port " + m_name
+                                             + " service's wsdl:port/soap:address/@location attribute" );
+      }
+
+      return endpointURL;
+   }
+}
\ No newline at end of file

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceSweeper.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceSweeper.java?rev=227033&r1=227032&r2=227033&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceSweeper.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceSweeper.java Tue Aug  2 09:28:49 2005
@@ -26,7 +26,6 @@
 import org.apache.ws.resource.i18n.MessagesImpl;
 import org.apache.ws.resource.lifetime.ScheduledResourceTerminationResource;
 import org.apache.ws.util.i18n.Messages;
-
 import java.util.Calendar;
 import java.util.Iterator;
 import java.util.LinkedList;
@@ -42,8 +41,11 @@
    /**
     * DOCUMENT_ME
     */
-   private static final Log LOG = LogFactory.getLog( ResourceSweeper.class.getName(  ) );
-   public static final Messages MSG = MessagesImpl.getInstance();
+   private static final Log     LOG = LogFactory.getLog( ResourceSweeper.class.getName(  ) );
+
+   /** DOCUMENT_ME */
+   public static final Messages MSG = MessagesImpl.getInstance(  );
+
    /**
     * DOCUMENT_ME
     */
@@ -104,12 +106,12 @@
     */
    public void timerExpired( Timer timer )
    {
-      LOG.debug( MSG.getMessage( Keys.CLEANING_EXPIRED_RESOURCES) );
+      LOG.debug( MSG.getMessage( Keys.CLEANING_EXPIRED_RESOURCES ) );
 
-      Calendar    currentTime = Calendar.getInstance(  );
-      Object key;
-      Resource    resource;
-      LinkedList  list = new LinkedList(  );
+      Calendar   currentTime = Calendar.getInstance(  );
+      Object     key;
+      Resource   resource;
+      LinkedList list = new LinkedList(  );
 
       synchronized ( m_resources )
       {

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/UnsupportedVersionException.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/UnsupportedVersionException.java?rev=227033&r1=227032&r2=227033&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/UnsupportedVersionException.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/UnsupportedVersionException.java Tue Aug  2 09:28:49 2005
@@ -1,20 +1,39 @@
-package org.apache.ws.resource.impl;
-
-import org.apache.ws.resource.properties.NamespaceVersionHolder;
-
-
-/**
- * An exception to be thrown when a version is unknown...This can be used to help flush out incomplete
- * version upgrades.
- *
- * @author Sal Campana
- */
-public class UnsupportedVersionException extends RuntimeException
-{
-
-
-    public UnsupportedVersionException(NamespaceVersionHolder namespaces)
-    {
-        super("The NamespaceVersionHolder implementation in " + namespaces.getClass().getPackage().getName() + " is unsupported.");
-    }
-}
+/*=============================================================================*
+ *  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 org.apache.ws.resource.impl;
+
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
+
+/**
+ * An exception to be thrown when a version is unknown...This can be used to help flush out incomplete
+ * version upgrades.
+ *
+ * @author Sal Campana
+ */
+public class UnsupportedVersionException
+   extends RuntimeException
+{
+   /**
+    * Creates a new {@link UnsupportedVersionException} object.
+    *
+    * @param namespaces DOCUMENT_ME
+    */
+   public UnsupportedVersionException( NamespaceVersionHolder namespaces )
+   {
+      super( "The NamespaceVersionHolder implementation in " + namespaces.getClass(  ).getPackage(  ).getName(  )
+             + " is unsupported." );
+   }
+}
\ No newline at end of file

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/ResourceNotDestroyedException.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/ResourceNotDestroyedException.java?rev=227033&r1=227032&r2=227033&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/ResourceNotDestroyedException.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/ResourceNotDestroyedException.java Tue Aug  2 09:28:49 2005
@@ -15,48 +15,47 @@
  *=============================================================================*/
 package org.apache.ws.resource.lifetime;
 
+
 /**
  *
  *
  * @author Ian Springer
  */
 public class ResourceNotDestroyedException
-        extends Exception
+   extends Exception
 {
-    
-    private Object m_resourceId;
-    private String m_serviceName;
-
-    /**
-     * @param resourceId
-     * @param serviceName
-     */
-    public ResourceNotDestroyedException( Object resourceId,
-                                          String serviceName )
-    {
-        super( serviceName + " resource with Id " + resourceId + " could not be destroyed." );
-        m_resourceId = resourceId;
-        m_serviceName = serviceName;
-    }
+   private Object m_resourceId;
+   private String m_serviceName;
 
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public Object getResourceId()
-    {
-        return m_resourceId;
-    }
+   /**
+    * @param resourceId
+    * @param serviceName
+    */
+   public ResourceNotDestroyedException( Object resourceId,
+                                         String serviceName )
+   {
+      super( serviceName + " resource with Id " + resourceId + " could not be destroyed." );
+      m_resourceId     = resourceId;
+      m_serviceName    = serviceName;
+   }
 
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public String getServiceName()
-    {
-        return m_serviceName;
-    }
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public Object getResourceId(  )
+   {
+      return m_resourceId;
+   }
 
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public String getServiceName(  )
+   {
+      return m_serviceName;
+   }
 }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/ResourceTerminationEvent.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/ResourceTerminationEvent.java?rev=227033&r1=227032&r2=227033&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/ResourceTerminationEvent.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/ResourceTerminationEvent.java Tue Aug  2 09:28:49 2005
@@ -1,30 +1,44 @@
-package org.apache.ws.resource.lifetime;
-
-import java.util.Calendar;
-
-/**
- * Interface describing a TerminationNotification of a resource.
- *
- * @author Sal Campana
- */
-public interface ResourceTerminationEvent
-{
-    /**
-     * Returns the termination time.
-     *
-     * minOccurs="1" maxOccurs="1" nillable="true"
-     *
-     * @return The termination time represented as a Calendar instance.
-     */
-    Calendar getTerminationTime();
-
-    /**
-     * Returns the reason for temrination.
-     *
-     * minOccurs="0" maxOccurs="1"
-     *
-     * @return The reason for termination.
-     */
-    Object getReason();
-
-}
+/*=============================================================================*
+ *  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 org.apache.ws.resource.lifetime;
+
+import java.util.Calendar;
+
+/**
+ * Interface describing a TerminationNotification of a resource.
+ *
+ * @author Sal Campana
+ */
+public interface ResourceTerminationEvent
+{
+   /**
+    * Returns the reason for temrination.
+    *
+    * minOccurs="0" maxOccurs="1"
+    *
+    * @return The reason for termination.
+    */
+   Object getReason(  );
+
+   /**
+    * Returns the termination time.
+    *
+    * minOccurs="1" maxOccurs="1" nillable="true"
+    *
+    * @return The termination time represented as a Calendar instance.
+    */
+   Calendar getTerminationTime(  );
+}
\ No newline at end of file

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/ResourceTerminationListener.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/ResourceTerminationListener.java?rev=227033&r1=227032&r2=227033&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/ResourceTerminationListener.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/ResourceTerminationListener.java Tue Aug  2 09:28:49 2005
@@ -1,18 +1,32 @@
-package org.apache.ws.resource.lifetime;
-
-
-
-/**
- * An interface defining the
- *
- * @author Sal Campana
- */
-public interface ResourceTerminationListener
-{
-    /**
-     * A method that is called whenever a particular resource is terminated.
-     *
-     * @param resourceTerminationEvent
-     */
-    void terminationOccurred( ResourceTerminationEvent resourceTerminationEvent );
-}
+/*=============================================================================*
+ *  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 org.apache.ws.resource.lifetime;
+
+
+/**
+ * An interface defining the
+ *
+ * @author Sal Campana
+ */
+public interface ResourceTerminationListener
+{
+   /**
+    * A method that is called whenever a particular resource is terminated.
+    *
+    * @param resourceTerminationEvent
+    */
+   void terminationOccurred( ResourceTerminationEvent resourceTerminationEvent );
+}
\ No newline at end of file

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/ScheduledResourceTerminationResource.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/ScheduledResourceTerminationResource.java?rev=227033&r1=227032&r2=227033&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/ScheduledResourceTerminationResource.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/ScheduledResourceTerminationResource.java Tue Aug  2 09:28:49 2005
@@ -16,7 +16,6 @@
 package org.apache.ws.resource.lifetime;
 
 import org.apache.ws.resource.Resource;
-
 import java.util.Calendar;
 
 /**
@@ -26,7 +25,6 @@
 public interface ScheduledResourceTerminationResource
    extends Resource
 {
-    
    /**
     * Get the current time
     *
@@ -47,5 +45,4 @@
     * @return The termination time
     */
    Calendar getTerminationTime(  );
-
 }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/callback/CurrentTimeCallback.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/callback/CurrentTimeCallback.java?rev=227033&r1=227032&r2=227033&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/callback/CurrentTimeCallback.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/callback/CurrentTimeCallback.java Tue Aug  2 09:28:49 2005
@@ -1,41 +1,50 @@
-/*=============================================================================*
- *  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 org.apache.ws.resource.lifetime.callback;
-
-import org.apache.ws.resource.properties.ResourceProperty;
-import org.apache.ws.resource.properties.ResourcePropertyCallback;
-import org.apache.ws.resource.properties.XmlBeansResourcePropertyUtils;
-import org.apache.ws.resource.properties.impl.XmlBeansResourceProperty;
-import org.apache.ws.resource.properties.impl.CallbackFailedException;
-
-import java.util.Calendar;
-
-/**
- * A callback for the WSRF-RL CurrentTime property - assumes the property is implemented
- * as an XMLBean.
- *
- * @author Ian Springer
- */
-public class CurrentTimeCallback implements ResourcePropertyCallback
-{
-
-    public ResourceProperty refreshProperty( ResourceProperty prop )  throws CallbackFailedException
-    {
-        XmlBeansResourcePropertyUtils.setDateTimePropertyValue( (XmlBeansResourceProperty)prop, Calendar.getInstance( ) );
-        return prop;
-    }
-
-}
+/*=============================================================================*
+ *  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 org.apache.ws.resource.lifetime.callback;
+
+import org.apache.ws.resource.properties.ResourceProperty;
+import org.apache.ws.resource.properties.ResourcePropertyCallback;
+import org.apache.ws.resource.properties.XmlBeansResourcePropertyUtils;
+import org.apache.ws.resource.properties.impl.CallbackFailedException;
+import org.apache.ws.resource.properties.impl.XmlBeansResourceProperty;
+import java.util.Calendar;
+
+/**
+ * A callback for the WSRF-RL CurrentTime property - assumes the property is implemented
+ * as an XMLBean.
+ *
+ * @author Ian Springer
+ */
+public class CurrentTimeCallback
+   implements ResourcePropertyCallback
+{
+   /**
+    * DOCUMENT_ME
+    *
+    * @param prop DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    *
+    * @throws CallbackFailedException DOCUMENT_ME
+    */
+   public ResourceProperty refreshProperty( ResourceProperty prop )
+   throws CallbackFailedException
+   {
+      XmlBeansResourcePropertyUtils.setDateTimePropertyValue( (XmlBeansResourceProperty) prop,
+                                                              Calendar.getInstance(  ) );
+      return prop;
+   }
+}
\ No newline at end of file

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/faults/ResourceNotDestroyedFaultException.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/faults/ResourceNotDestroyedFaultException.java?rev=227033&r1=227032&r2=227033&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/faults/ResourceNotDestroyedFaultException.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/faults/ResourceNotDestroyedFaultException.java Tue Aug  2 09:28:49 2005
@@ -21,7 +21,6 @@
 import org.apache.ws.resource.i18n.MessagesImpl;
 import org.apache.ws.resource.properties.NamespaceVersionHolder;
 import org.apache.ws.util.i18n.Messages;
-
 import javax.xml.namespace.QName;
 
 /**
@@ -32,67 +31,71 @@
  * @author Ian Springer
  */
 public class ResourceNotDestroyedFaultException
-        extends AbstractBaseFaultException
+   extends AbstractBaseFaultException
 {
-    private static final Messages MSG = MessagesImpl.getInstance();
-
-    private QName m_name;
-    private Object m_resourceId;
-    private String m_serviceName;
-
-    /**
-     * Constructs a new ResourceNotDestroyedFaultException, specifying the resource id and service name
-     * of the resource.
-     *
-     * @param resourceId
-     * @param serviceName
-     */
-    public ResourceNotDestroyedFaultException( NamespaceVersionHolder namespaces, Object resourceId,
-                                               String serviceName )
-    {
-        super( namespaces, MSG.getMessage( Keys.UNABLE_TO_DESTROY_RESOURCE, serviceName, resourceId ) );
-        m_name = new QName( namespaces.getLifetimeXsdNamespace(), "ResourceUnknownFault",
-                "wsrl" );
-        m_resourceId = resourceId;
-        m_serviceName = serviceName;
-    }
-
-    /**
-     * @param rue
-     */
-    public ResourceNotDestroyedFaultException( NamespaceVersionHolder namespaces, ResourceUnknownException rue )
-    {
-        this( namespaces, rue.getResourceId(), rue.getServiceName() );
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public Object getResourceId()
-    {
-        return m_resourceId;
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public String getServiceName()
-    {
-        return m_serviceName;
-    }
-
-    /**
-     * Returns the element name for this base fault.
-     *
-     * @return the element name for this base fault
-     */
-    public QName getBaseFaultName()
-    {
-        return m_name;
-    }
-
+   private static final Messages MSG = MessagesImpl.getInstance(  );
+   private QName                 m_name;
+   private Object                m_resourceId;
+   private String                m_serviceName;
+
+   /**
+    * Constructs a new ResourceNotDestroyedFaultException, specifying the resource id and service name
+    * of the resource.
+    *
+    * @param resourceId
+    * @param serviceName
+    */
+   public ResourceNotDestroyedFaultException( NamespaceVersionHolder namespaces,
+                                              Object                 resourceId,
+                                              String                 serviceName )
+   {
+      super( namespaces,
+             MSG.getMessage( Keys.UNABLE_TO_DESTROY_RESOURCE, serviceName, resourceId ) );
+      m_name    = new QName( namespaces.getLifetimeXsdNamespace(  ),
+                             "ResourceUnknownFault",
+                             "wsrl" );
+      m_resourceId     = resourceId;
+      m_serviceName    = serviceName;
+   }
+
+   /**
+    * @param rue
+    */
+   public ResourceNotDestroyedFaultException( NamespaceVersionHolder   namespaces,
+                                              ResourceUnknownException rue )
+   {
+      this( namespaces,
+            rue.getResourceId(  ),
+            rue.getServiceName(  ) );
+   }
+
+   /**
+    * Returns the element name for this base fault.
+    *
+    * @return the element name for this base fault
+    */
+   public QName getBaseFaultName(  )
+   {
+      return m_name;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public Object getResourceId(  )
+   {
+      return m_resourceId;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public String getServiceName(  )
+   {
+      return m_serviceName;
+   }
 }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/faults/ResourceUnknownFaultException.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/faults/ResourceUnknownFaultException.java?rev=227033&r1=227032&r2=227033&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/faults/ResourceUnknownFaultException.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/faults/ResourceUnknownFaultException.java Tue Aug  2 09:28:49 2005
@@ -21,7 +21,6 @@
 import org.apache.ws.resource.i18n.MessagesImpl;
 import org.apache.ws.resource.properties.NamespaceVersionHolder;
 import org.apache.ws.util.i18n.Messages;
-
 import javax.xml.namespace.QName;
 
 /**
@@ -30,66 +29,71 @@
  * @author Ian P. Springer
  */
 public class ResourceUnknownFaultException
-        extends AbstractBaseFaultException
+   extends AbstractBaseFaultException
 {
-    private static final Messages MSG = MessagesImpl.getInstance();
-
-    private QName m_name;
-    private Object m_resourceId;
-    private String m_serviceName;
-
-    /**
-     * Constructs a new ResourceUnknownFaultException, specifying the resource id and service name of the unknown
-     * resource.
-     *
-     * @param resourceId
-     * @param serviceName
-     */
-    public ResourceUnknownFaultException( NamespaceVersionHolder namespaces, Object resourceId,
-                                          String serviceName )
-    {
-        super( namespaces, MSG.getMessage( Keys.RESOURCEID_NOT_FOUND_FOR_SERVICE, resourceId, serviceName ) );
-        m_name = new QName( namespaces.getLifetimeXsdNamespace(), "ResourceUnknownFault", "wsrl" );
-        m_resourceId = resourceId;
-        m_serviceName = serviceName;
-    }
-
-    /**
-     * @param rue
-     */
-    public ResourceUnknownFaultException( NamespaceVersionHolder namespaces, ResourceUnknownException rue )
-    {
-        this( namespaces, rue.getResourceId(),
-                rue.getServiceName() );
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public Object getResourceId()
-    {
-        return m_resourceId;
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public String getServiceName()
-    {
-        return m_serviceName;
-    }
-
-    /**
-     * Returns the element name for this base fault.
-     *
-     * @return the element name for this base fault
-     */
-    public QName getBaseFaultName()
-    {
-        return m_name;
-    }
+   private static final Messages MSG = MessagesImpl.getInstance(  );
+   private QName                 m_name;
+   private Object                m_resourceId;
+   private String                m_serviceName;
+
+   /**
+    * Constructs a new ResourceUnknownFaultException, specifying the resource id and service name of the unknown
+    * resource.
+    *
+    * @param resourceId
+    * @param serviceName
+    */
+   public ResourceUnknownFaultException( NamespaceVersionHolder namespaces,
+                                         Object                 resourceId,
+                                         String                 serviceName )
+   {
+      super( namespaces,
+             MSG.getMessage( Keys.RESOURCEID_NOT_FOUND_FOR_SERVICE, resourceId, serviceName ) );
+      m_name           = new QName( namespaces.getLifetimeXsdNamespace(  ),
+                                    "ResourceUnknownFault",
+                                    "wsrl" );
+      m_resourceId     = resourceId;
+      m_serviceName    = serviceName;
+   }
+
+   /**
+    * @param rue
+    */
+   public ResourceUnknownFaultException( NamespaceVersionHolder   namespaces,
+                                         ResourceUnknownException rue )
+   {
+      this( namespaces,
+            rue.getResourceId(  ),
+            rue.getServiceName(  ) );
+   }
+
+   /**
+    * Returns the element name for this base fault.
+    *
+    * @return the element name for this base fault
+    */
+   public QName getBaseFaultName(  )
+   {
+      return m_name;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public Object getResourceId(  )
+   {
+      return m_resourceId;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public String getServiceName(  )
+   {
+      return m_serviceName;
+   }
 }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/faults/TerminationTimeChangeRejectedFaultException.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/faults/TerminationTimeChangeRejectedFaultException.java?rev=227033&r1=227032&r2=227033&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/faults/TerminationTimeChangeRejectedFaultException.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/faults/TerminationTimeChangeRejectedFaultException.java Tue Aug  2 09:28:49 2005
@@ -21,7 +21,6 @@
 import org.apache.ws.resource.i18n.MessagesImpl;
 import org.apache.ws.resource.properties.NamespaceVersionHolder;
 import org.apache.ws.util.i18n.Messages;
-
 import javax.xml.namespace.QName;
 
 /**
@@ -30,68 +29,71 @@
  * @author Ian P. Springer
  */
 public class TerminationTimeChangeRejectedFaultException
-        extends AbstractBaseFaultException
+   extends AbstractBaseFaultException
 {
-
-    private static final Messages MSG = MessagesImpl.getInstance();
-
-    private QName m_name;
-    private Object m_resourceId;
-    private String m_serviceName;
-
-    /**
-     * Constructs a new TerminationTimeChangeRejectedFaultException, specifying the resource id and
-     * service name of the resource.
-     *
-     * @param resourceId
-     * @param serviceName
-     */
-    public TerminationTimeChangeRejectedFaultException( NamespaceVersionHolder namespaces, Object resourceId,
-                                                        String serviceName )
-    {
-        super( namespaces, MSG.getMessage( Keys.UNABLE_TO_SET_TERM_TIME, serviceName, resourceId ) );
-        m_name = new QName( namespaces.getLifetimeXsdNamespace(), "TerminationTimeChangeRejectedFault",
-                "wsrl" );
-        m_resourceId = resourceId;
-        m_serviceName = serviceName;
-    }
-
-    /**
-     * @param rue
-     */
-    public TerminationTimeChangeRejectedFaultException( NamespaceVersionHolder namespaces,
-                                                        ResourceUnknownException rue )
-    {
-        this( namespaces, rue.getResourceId(), rue.getServiceName() );
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public Object getResourceId()
-    {
-        return m_resourceId;
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public String getServiceName()
-    {
-        return m_serviceName;
-    }
-
-    /**
-     * Returns the element name for this base fault.
-     *
-     * @return the element name for this base fault
-     */
-    public QName getBaseFaultName()
-    {
-        return m_name;
-    }
+   private static final Messages MSG = MessagesImpl.getInstance(  );
+   private QName                 m_name;
+   private Object                m_resourceId;
+   private String                m_serviceName;
+
+   /**
+    * Constructs a new TerminationTimeChangeRejectedFaultException, specifying the resource id and
+    * service name of the resource.
+    *
+    * @param resourceId
+    * @param serviceName
+    */
+   public TerminationTimeChangeRejectedFaultException( NamespaceVersionHolder namespaces,
+                                                       Object                 resourceId,
+                                                       String                 serviceName )
+   {
+      super( namespaces,
+             MSG.getMessage( Keys.UNABLE_TO_SET_TERM_TIME, serviceName, resourceId ) );
+      m_name    = new QName( namespaces.getLifetimeXsdNamespace(  ),
+                             "TerminationTimeChangeRejectedFault",
+                             "wsrl" );
+      m_resourceId     = resourceId;
+      m_serviceName    = serviceName;
+   }
+
+   /**
+    * @param rue
+    */
+   public TerminationTimeChangeRejectedFaultException( NamespaceVersionHolder   namespaces,
+                                                       ResourceUnknownException rue )
+   {
+      this( namespaces,
+            rue.getResourceId(  ),
+            rue.getServiceName(  ) );
+   }
+
+   /**
+    * Returns the element name for this base fault.
+    *
+    * @return the element name for this base fault
+    */
+   public QName getBaseFaultName(  )
+   {
+      return m_name;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public Object getResourceId(  )
+   {
+      return m_resourceId;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public String getServiceName(  )
+   {
+      return m_serviceName;
+   }
 }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/faults/UnableToSetTerminationTimeFaultException.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/faults/UnableToSetTerminationTimeFaultException.java?rev=227033&r1=227032&r2=227033&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/faults/UnableToSetTerminationTimeFaultException.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/faults/UnableToSetTerminationTimeFaultException.java Tue Aug  2 09:28:49 2005
@@ -21,7 +21,6 @@
 import org.apache.ws.resource.i18n.MessagesImpl;
 import org.apache.ws.resource.properties.NamespaceVersionHolder;
 import org.apache.ws.util.i18n.Messages;
-
 import javax.xml.namespace.QName;
 
 /**
@@ -32,65 +31,71 @@
  * @author Ian Springer
  */
 public class UnableToSetTerminationTimeFaultException
-        extends AbstractBaseFaultException
+   extends AbstractBaseFaultException
 {
-    private static final Messages MSG = MessagesImpl.getInstance();
-
-    private QName m_name;
-    private Object m_resourceId;
-    private String m_serviceName;
-
-    /**
-     * Constructs a new UnableToSetTerminationTimeFaultException, specifying the resource id and service name of the unknown
-     * resource.
-     *
-     * @param resourceId
-     * @param serviceName
-     */
-    public UnableToSetTerminationTimeFaultException( NamespaceVersionHolder namespaces, Object resourceId,
-                                                     String serviceName )
-    {
-        super( namespaces, MSG.getMessage( Keys.UNABLE_TO_SET_TERM_TIME, serviceName, resourceId ) );
-        m_name = new QName( namespaces.getLifetimeXsdNamespace(), "UnableToSetTerminationTimeFault", "wsrl" );
-        m_resourceId = resourceId;
-        m_serviceName = serviceName;
-    }
-
-    /**
-     * @param rue
-     */
-    public UnableToSetTerminationTimeFaultException( NamespaceVersionHolder namespaces, ResourceUnknownException rue )
-    {
-        this( namespaces, rue.getResourceId(), rue.getServiceName() );
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public Object getResourceId()
-    {
-        return m_resourceId;
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public String getServiceName()
-    {
-        return m_serviceName;
-    }
-
-    /**
-     * Returns the element name for this base fault.
-     *
-     * @return the element name for this base fault
-     */
-    public QName getBaseFaultName()
-    {
-        return m_name;
-    }
+   private static final Messages MSG = MessagesImpl.getInstance(  );
+   private QName                 m_name;
+   private Object                m_resourceId;
+   private String                m_serviceName;
+
+   /**
+    * Constructs a new UnableToSetTerminationTimeFaultException, specifying the resource id and service name of the unknown
+    * resource.
+    *
+    * @param resourceId
+    * @param serviceName
+    */
+   public UnableToSetTerminationTimeFaultException( NamespaceVersionHolder namespaces,
+                                                    Object                 resourceId,
+                                                    String                 serviceName )
+   {
+      super( namespaces,
+             MSG.getMessage( Keys.UNABLE_TO_SET_TERM_TIME, serviceName, resourceId ) );
+      m_name           = new QName( namespaces.getLifetimeXsdNamespace(  ),
+                                    "UnableToSetTerminationTimeFault",
+                                    "wsrl" );
+      m_resourceId     = resourceId;
+      m_serviceName    = serviceName;
+   }
+
+   /**
+    * @param rue
+    */
+   public UnableToSetTerminationTimeFaultException( NamespaceVersionHolder   namespaces,
+                                                    ResourceUnknownException rue )
+   {
+      this( namespaces,
+            rue.getResourceId(  ),
+            rue.getServiceName(  ) );
+   }
+
+   /**
+    * Returns the element name for this base fault.
+    *
+    * @return the element name for this base fault
+    */
+   public QName getBaseFaultName(  )
+   {
+      return m_name;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public Object getResourceId(  )
+   {
+      return m_resourceId;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public String getServiceName(  )
+   {
+      return m_serviceName;
+   }
 }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/impl/AbstractResourceTerminationEvent.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/impl/AbstractResourceTerminationEvent.java?rev=227033&r1=227032&r2=227033&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/impl/AbstractResourceTerminationEvent.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/impl/AbstractResourceTerminationEvent.java Tue Aug  2 09:28:49 2005
@@ -1,85 +1,115 @@
-package org.apache.ws.resource.lifetime.impl;
-
-import org.apache.ws.resource.lifetime.ResourceTerminationEvent;
-import org.apache.ws.resource.properties.NamespaceVersionHolder;
-import org.apache.ws.XmlObjectWrapper;
-import org.apache.xmlbeans.XmlObject;
-
-import java.util.Calendar;
-
-
-/**
- * @author Sal Campana
- */
-public abstract class AbstractResourceTerminationEvent implements ResourceTerminationEvent
-{
-    private Calendar m_terminationTime;
-    private Object m_reason;
-    private Object m_resourceId;
-
-    /**
-     * Sets termination time and reason to passed in params.
-     *
-     * @param resourceId The resource Id of the resource being destroyed.
-     * @param terminationTime
-     * @param reason
-     */
-    public AbstractResourceTerminationEvent(Object resourceId, Calendar terminationTime, Object reason)
-    {
-        m_terminationTime = terminationTime;
-        m_reason = reason;
-        m_resourceId = resourceId;
-    }
-
-    /**
-     * Set the reson to the object specified and termination time is set upon construction.
-     *
-     * @param resourceId The resource Id of the resource being destroyed.
-     * @param reason
-     */
-    public AbstractResourceTerminationEvent(Object resourceId,Object reason)
-    {
-        this(resourceId, Calendar.getInstance(), reason);
-    }
-
-    /**
-     * Constructor creates termination time upon construction.  Reason is null.
-     *
-     * @param resourceId The resource Id of the resource being destroyed.
-     */
-    public AbstractResourceTerminationEvent(Object resourceId)
-    {
-        this(resourceId, Calendar.getInstance(), null);
-    }
-
-    /**
-     * Returns the termination time.
-     * <p/>
-     * minOccurs="1" maxOccurs="1" nillable="true"
-     *
-     * @return The termination time represented as a Calendar instance.
-     */
-    public Calendar getTerminationTime()
-    {
-        return m_terminationTime;
-    }
-
-    /**
-     * Returns the reason for temrination.
-     * <p/>
-     * minOccurs="0" maxOccurs="1"
-     *
-     * @return The reason for termination.
-     */
-    public Object getReason()
-    {
-        return m_reason;
-    }
-
-    public Object getResourceId()
-    {
-        return m_resourceId;
-    }
-
-    protected abstract XmlObject getTerminationNotifDocXmlBean( NamespaceVersionHolder namespaces );
-}
+/*=============================================================================*
+ *  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 org.apache.ws.resource.lifetime.impl;
+
+import org.apache.ws.resource.lifetime.ResourceTerminationEvent;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
+import org.apache.xmlbeans.XmlObject;
+import java.util.Calendar;
+
+/**
+ * @author Sal Campana
+ */
+public abstract class AbstractResourceTerminationEvent
+   implements ResourceTerminationEvent
+{
+   private Calendar m_terminationTime;
+   private Object   m_reason;
+   private Object   m_resourceId;
+
+   /**
+    * Sets termination time and reason to passed in params.
+    *
+    * @param resourceId The resource Id of the resource being destroyed.
+    * @param terminationTime
+    * @param reason
+    */
+   public AbstractResourceTerminationEvent( Object   resourceId,
+                                            Calendar terminationTime,
+                                            Object   reason )
+   {
+      m_terminationTime    = terminationTime;
+      m_reason             = reason;
+      m_resourceId         = resourceId;
+   }
+
+   /**
+    * Set the reson to the object specified and termination time is set upon construction.
+    *
+    * @param resourceId The resource Id of the resource being destroyed.
+    * @param reason
+    */
+   public AbstractResourceTerminationEvent( Object resourceId,
+                                            Object reason )
+   {
+      this( resourceId,
+            Calendar.getInstance(  ), reason );
+   }
+
+   /**
+    * Constructor creates termination time upon construction.  Reason is null.
+    *
+    * @param resourceId The resource Id of the resource being destroyed.
+    */
+   public AbstractResourceTerminationEvent( Object resourceId )
+   {
+      this( resourceId,
+            Calendar.getInstance(  ), null );
+   }
+
+   /**
+    * Returns the reason for temrination.
+    * <p/>
+    * minOccurs="0" maxOccurs="1"
+    *
+    * @return The reason for termination.
+    */
+   public Object getReason(  )
+   {
+      return m_reason;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public Object getResourceId(  )
+   {
+      return m_resourceId;
+   }
+
+   /**
+    * Returns the termination time.
+    * <p/>
+    * minOccurs="1" maxOccurs="1" nillable="true"
+    *
+    * @return The termination time represented as a Calendar instance.
+    */
+   public Calendar getTerminationTime(  )
+   {
+      return m_terminationTime;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param namespaces DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   protected abstract XmlObject getTerminationNotifDocXmlBean( NamespaceVersionHolder namespaces );
+}
\ No newline at end of file



Mime
View raw message