Author: scamp
Date: Fri Jun 10 09:59:50 2005
New Revision: 189988

URL: http://svn.apache.org/viewcvs?rev=189988&view=rev
Log:
fixed bad logic where someone has a resourceprop contained from a porttype we 
handle..but they don't implement the porttype...I was not generating the rp

Modified:
    incubator/apollo/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java

Modified: 
incubator/apollo/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java?rev=189988&r1=189987&r2=189988&view=diff
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java 
(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java 
Fri Jun 10 09:59:50 2005
@@ -31,29 +31,30 @@
 import org.apache.ws.resource.impl.ResourceDefinitionImpl;
 import org.apache.ws.resource.tool.velocity.ImplementsListBuilder;
 import org.apache.ws.resource.tool.velocity.ServiceProperties;
-import org.apache.ws.util.XmlBeanNameUtils;
 import org.apache.ws.util.OperationInfo;
+import org.apache.ws.util.XmlBeanNameUtils;
 import org.apache.ws.util.i18n.Messages;
 import org.apache.ws.util.velocity.CommonsLogLogSystem;
 import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.impl.common.XmlErrorPrinter;
 import org.apache.xmlbeans.impl.common.NameUtil;
+import org.apache.xmlbeans.impl.common.XmlErrorPrinter;
 import org.apache.xmlbeans.impl.tool.SchemaCompiler;
 
-
 import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
 import javax.wsdl.Fault;
 import javax.wsdl.Message;
 import javax.wsdl.Part;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
 import javax.wsdl.factory.WSDLFactory;
 import javax.wsdl.xml.WSDLReader;
 import javax.xml.namespace.QName;
 import java.io.File;
 import java.io.FileWriter;
-import java.io.IOException;
 import java.io.FilenameFilter;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
@@ -64,8 +65,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.StringTokenizer;
-import java.lang.reflect.Method;
-import java.lang.reflect.InvocationTargetException;
 
 /**
  * Generates Java Web service types and skeletons from a WSRF WSDL.
@@ -98,35 +97,35 @@
     /**
      * Creates a new [EMAIL PROTECTED] Wsdl2Java} object.
      *
-     * @param wsdlFiles DOCUMENT_ME
-     * @param outputDir DOCUMENT_ME
+     * @param wsdlFiles      DOCUMENT_ME
+     * @param outputDir      DOCUMENT_ME
      * @param classpathFiles
-     * @param options   DOCUMENT_ME
+     * @param options        DOCUMENT_ME
      */
-    public Wsdl2Java( File[] wsdlFiles,
-                      File outputDir,
-                      File[] classpathFiles,
-                      Wsdl2JavaOptions options ) throws Exception
+    public Wsdl2Java(File[] wsdlFiles,
+                     File outputDir,
+                     File[] classpathFiles,
+                     Wsdl2JavaOptions options) throws Exception
     {
         m_wsdlFiles = wsdlFiles;
-        if ( m_wsdlFiles.length == 0 )
+        if (m_wsdlFiles.length == 0)
         {
-            System.out.println( MSG.getMessage( Keys.WARN_EMPTY_WSDLS ) );
+            System.out.println(MSG.getMessage(Keys.WARN_EMPTY_WSDLS));
         }
         for (int i = 0; i < wsdlFiles.length; i++)
         {
             File wsdlFile = wsdlFiles[i];
-            if(!wsdlFile.getName().endsWith(".wsdl"))
+            if (!wsdlFile.getName().endsWith(".wsdl"))
             {
-                System.out.println(MSG.getMessage( Keys.ERROR_ONLY_WSDLS , 
wsdlFile.getName()));
+                System.out.println(MSG.getMessage(Keys.ERROR_ONLY_WSDLS, 
wsdlFile.getName()));
                 System.exit(0);
             }
         }
         m_outputDir = outputDir;
-        m_xmlbeansDir = new File( m_outputDir, ".xmlbeans" );
+        m_xmlbeansDir = new File(m_outputDir, ".xmlbeans");
         m_classpath = classpathFiles;
         validateClasspath();
-        m_options = ( options != null ) ? options : new Wsdl2JavaOptions();
+        m_options = (options != null) ? options : new Wsdl2JavaOptions();
         m_wsdlReader = WSDLFactory.newInstance().newWSDLReader();
         initVelocity();
         initPortTypeInfoMap();
@@ -135,29 +134,29 @@
     private void validateClasspath()
             throws MalformedURLException
     {
-        URLClassLoader cpClassLoader = new URLClassLoader( toURLs( m_classpath 
), null );
+        URLClassLoader cpClassLoader = new URLClassLoader(toURLs(m_classpath), 
null);
         try
         {
-            cpClassLoader.loadClass( XmlObject.class.getName() );
+            cpClassLoader.loadClass(XmlObject.class.getName());
         }
-        catch ( ClassNotFoundException cnfe )
+        catch (ClassNotFoundException cnfe)
         {
-            throw new IllegalStateException( "Specified classpath must contain 
the XMLBeans runtime jar (e.g. xbean-v1HEAD-SNAPSHOT-20041129.jar)" );
+            throw new IllegalStateException("Specified classpath must contain 
the XMLBeans runtime jar (e.g. xbean-v1HEAD-SNAPSHOT-20041129.jar)");
         }
         try
         {
-            cpClassLoader.loadClass( 
org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetResourcePropertyDocument.class.getName()
 );
+            
cpClassLoader.loadClass(org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetResourcePropertyDocument.class.getName());
         }
-        catch ( ClassNotFoundException cnfe )
+        catch (ClassNotFoundException cnfe)
         {
-            throw new IllegalStateException( "Specified classpath must contain 
the WSRF generated XMLBeans jar (e.g. wsrf-xbeans-SNAPSHOT.jar)" );
+            throw new IllegalStateException("Specified classpath must contain 
the WSRF generated XMLBeans jar (e.g. wsrf-xbeans-SNAPSHOT.jar)");
         }
     }
 
-    private URL[] toURLs( File[] files ) throws MalformedURLException
+    private URL[] toURLs(File[] files) throws MalformedURLException
     {
         URL[] urls = new URL[files.length];
-        for ( int i = 0; i < files.length; i++ )
+        for (int i = 0; i < files.length; i++)
         {
             urls[i] = files[i].toURL();
         }
@@ -202,31 +201,31 @@
     public void generate()
             throws Exception
     {
-        for ( int i = 0; i < m_wsdlFiles.length; i++ )
+        for (int i = 0; i < m_wsdlFiles.length; i++)
         {
-            processWsdlFile( m_wsdlFiles[i] );
+            processWsdlFile(m_wsdlFiles[i]);
         }
     }
 
-    private void processWsdlFile( File wsdlFile )
+    private void processWsdlFile(File wsdlFile)
             throws Exception
     {
-        System.out.println( "Processing WSDL file \"" + wsdlFile + "\"..." );
-        Definition def = m_wsdlReader.readWSDL( wsdlFile.getPath() );
-        generateXmlBeans( wsdlFile );
+        System.out.println("Processing WSDL file \"" + wsdlFile + "\"...");
+        Definition def = m_wsdlReader.readWSDL(wsdlFile.getPath());
+        generateXmlBeans(wsdlFile);
         Iterator serviceIter = def.getServices().values().iterator();
-        while ( serviceIter.hasNext() )
+        while (serviceIter.hasNext())
         {
             Service service = (Service) serviceIter.next();
             Iterator iterator = service.getPorts().values().iterator();
             while (iterator.hasNext())
             {
                 Port port = (Port) iterator.next();
-                ResourceDefinition resourceDef = new ResourceDefinitionImpl( 
def, port, wsdlFile.toURL());
-                File serviceDir = new File( m_outputDir, resourceDef.getName() 
);
-                System.out.println( "Processing WSRF WSDL port \"" + 
resourceDef.getName() + "\"..." );
-                processTemplates( resourceDef, wsdlFile, serviceDir );
-                copyWsdlFile( wsdlFile, serviceDir );
+                ResourceDefinition resourceDef = new 
ResourceDefinitionImpl(def, port, wsdlFile.toURL());
+                File serviceDir = new File(m_outputDir, resourceDef.getName());
+                System.out.println("Processing WSRF WSDL port \"" + 
resourceDef.getName() + "\"...");
+                processTemplates(resourceDef, wsdlFile, serviceDir);
+                copyWsdlFile(wsdlFile, serviceDir);
             }
         }
 
@@ -236,42 +235,41 @@
      * DOCUMENT_ME
      *
      * @param args DOCUMENT_ME
-     *
      * @throws ParseException DOCUMENT_ME
      */
-    public static void main( String[] args )
+    public static void main(String[] args)
             throws ParseException
     {
-        CommandLine cmdLine = new PosixParser().parse( CMD_LINE_OPTIONS, args, 
true );
-        checkForRequiredOption( cmdLine, Opts.OUTPUT_DIR );
-        checkForRequiredOption( cmdLine, Opts.CLASSPATH );
-        File outputDir = new File( cmdLine.getOptionValue( Opts.OUTPUT_DIR ) );
-        File[] classpathFiles = toFileArray( cmdLine.getOptionValue( 
Opts.CLASSPATH ) );
+        CommandLine cmdLine = new PosixParser().parse(CMD_LINE_OPTIONS, args, 
true);
+        checkForRequiredOption(cmdLine, Opts.OUTPUT_DIR);
+        checkForRequiredOption(cmdLine, Opts.CLASSPATH);
+        File outputDir = new File(cmdLine.getOptionValue(Opts.OUTPUT_DIR));
+        File[] classpathFiles = 
toFileArray(cmdLine.getOptionValue(Opts.CLASSPATH));
 
         Wsdl2JavaOptions options = new Wsdl2Java.Wsdl2JavaOptions();
 
-        if ( cmdLine.hasOption( Opts.VERBOSE ) )
+        if (cmdLine.hasOption(Opts.VERBOSE))
         {
-            options.setVerbose( Boolean.valueOf( cmdLine.getOptionValue( 
Opts.VERBOSE ) ).booleanValue() );
+            
options.setVerbose(Boolean.valueOf(cmdLine.getOptionValue(Opts.VERBOSE)).booleanValue());
         }
 
         File[] wsdlFiles = new File[cmdLine.getArgs().length];
-        for ( int i = 0; i < cmdLine.getArgs().length; i++ )
+        for (int i = 0; i < cmdLine.getArgs().length; i++)
         {
-            wsdlFiles[i] = new File( cmdLine.getArgs()[i] );
+            wsdlFiles[i] = new File(cmdLine.getArgs()[i]);
         }
 
         try
         {
-            System.out.println( MSG.getMessage( Keys.WSDL4J_PASSED_ARGUMENTS,
-                    Integer.toString( wsdlFiles.length ),
-                    outputDir ) );
-            new Wsdl2Java( wsdlFiles, outputDir, classpathFiles, options 
).generate();
+            System.out.println(MSG.getMessage(Keys.WSDL4J_PASSED_ARGUMENTS,
+                                              
Integer.toString(wsdlFiles.length),
+                                              outputDir));
+            new Wsdl2Java(wsdlFiles, outputDir, classpathFiles, 
options).generate();
         }
-        catch ( Exception e )
+        catch (Exception e)
         {
             e.printStackTrace();
-            System.exit( 1 );
+            System.exit(1);
         }
     }
 
@@ -279,12 +277,11 @@
      * DOCUMENT_ME
      *
      * @param ptName DOCUMENT_ME
-     *
      * @return DOCUMENT_ME
      */
-    protected PortType2JavaInfo getPortType2JavaInfo( QName ptName )
+    protected PortType2JavaInfo getPortType2JavaInfo(QName ptName)
     {
-        return (PortType2JavaInfo) m_portTypeInfoMap.get( ptName );
+        return (PortType2JavaInfo) m_portTypeInfoMap.get(ptName);
     }
 
     /**
@@ -292,136 +289,136 @@
      *
      * @param ptInfo DOCUMENT_ME
      */
-    protected void addPortType2JavaInfo( PortType2JavaInfo ptInfo )
+    protected void addPortType2JavaInfo(PortType2JavaInfo ptInfo)
     {
-        m_portTypeInfoMap.put( ptInfo.getName(), ptInfo );
+        m_portTypeInfoMap.put(ptInfo.getName(), ptInfo);
     }
 
-    private static void checkForRequiredOption( CommandLine cmdLine,
-                                                String opt )
+    private static void checkForRequiredOption(CommandLine cmdLine,
+                                               String opt)
     {
-        if ( !cmdLine.hasOption( opt ) )
+        if (!cmdLine.hasOption(opt))
         {
-            System.err.println( MSG.getMessage( Keys.OPT_REQUIRED, opt ) );
-            System.exit( 1 );
+            System.err.println(MSG.getMessage(Keys.OPT_REQUIRED, opt));
+            System.exit(1);
         }
     }
 
     private static void initCmdLineOptions()
     {
-        CMD_LINE_OPTIONS.addOption( Opts.OUTPUT_DIR,
-                LongOpts.OUTPUT_DIR,
-                true,
-                MSG.getMessage( Keys.OPT_OUTPUT_DIR_FOR_GEN_SRC ) );
-        CMD_LINE_OPTIONS.addOption( Opts.CLASSPATH,
-                LongOpts.CLASSPATH,
-                true,
-                MSG.getMessage( Keys.OPT_CLASSPATH_SENT_TO_XMLBEANS ) );
-        CMD_LINE_OPTIONS.addOption( Opts.VERBOSE,
-                LongOpts.VERBOSE,
-                false,
-                MSG.getMessage( Keys.OPT_ENABLE_VERBOSE ) );
+        CMD_LINE_OPTIONS.addOption(Opts.OUTPUT_DIR,
+                                   LongOpts.OUTPUT_DIR,
+                                   true,
+                                   
MSG.getMessage(Keys.OPT_OUTPUT_DIR_FOR_GEN_SRC));
+        CMD_LINE_OPTIONS.addOption(Opts.CLASSPATH,
+                                   LongOpts.CLASSPATH,
+                                   true,
+                                   
MSG.getMessage(Keys.OPT_CLASSPATH_SENT_TO_XMLBEANS));
+        CMD_LINE_OPTIONS.addOption(Opts.VERBOSE,
+                                   LongOpts.VERBOSE,
+                                   false,
+                                   MSG.getMessage(Keys.OPT_ENABLE_VERBOSE));
     }
 
-    private String getJarFileName( File wsdlFile )
+    private String getJarFileName(File wsdlFile)
     {
         String wsdlFileName = wsdlFile.getName();
-        String baseName = wsdlFileName.substring( 0, wsdlFileName.lastIndexOf( 
"." ) );
+        String baseName = wsdlFileName.substring(0, 
wsdlFileName.lastIndexOf("."));
         return baseName + "-xbeans.jar";
     }
 
-    private File getPackageDir( String targetNamespace, File serviceDir )
+    private File getPackageDir(String targetNamespace, File serviceDir)
     {
-        String javaPackageName = GenerationUtils.getJavaPackageName( 
targetNamespace );
-        File javaDir = new File( serviceDir, "src/java" );
-        return new File( javaDir,
-                javaPackageName.replace( '.', '/' ) );
+        String javaPackageName = 
GenerationUtils.getJavaPackageName(targetNamespace);
+        File javaDir = new File(serviceDir, "src/java");
+        return new File(javaDir,
+                        javaPackageName.replace('.', '/'));
     }
 
     private File getTempDir()
     {
-        String userTempDir = System.getProperty( "java.io.tmpdir" );
-        File userDir = new File( userTempDir );
+        String userTempDir = System.getProperty("java.io.tmpdir");
+        File userDir = new File(userTempDir);
         userDir.mkdirs();
-        File tempClassesDir = new File( userDir, "tmp" + new Date().getTime() 
);
+        File tempClassesDir = new File(userDir, "tmp" + new Date().getTime());
         tempClassesDir.mkdir();
         return tempClassesDir;
     }
 
-    protected ServiceProperties buildServiceProperties( ResourceDefinition 
resourceDef,
-                                                      File wsdlFile,
-                                                      File serviceDir )
+    protected ServiceProperties buildServiceProperties(ResourceDefinition 
resourceDef,
+                                                       File wsdlFile,
+                                                       File serviceDir)
     {
-        ServiceProperties props = new ServiceProperties(resourceDef);        
+        ServiceProperties props = new ServiceProperties(resourceDef);
         String targetNamespace = 
resourceDef.getDefinition().getTargetNamespace();
-        props.setPackageName( GenerationUtils.getJavaPackageName( 
targetNamespace ) );
+        
props.setPackageName(GenerationUtils.getJavaPackageName(targetNamespace));
         String serviceName = resourceDef.getName();
-        String capitalizedServiceName = StringUtils.capitalize( serviceName );
-        props.setServiceName( capitalizedServiceName );
-        props.setSrcDir( new File( serviceDir, "src/java" ).getAbsolutePath() 
);
-        props.setJarDir( new File(m_xmlbeansDir,"lib").getAbsolutePath() );
-        props.setJarFileName( getJarFileName( wsdlFile ) );
-        props.setClassesDir( new File( serviceDir, "classes" 
).getAbsolutePath() );
-        props.setEndpointURL( resourceDef.getEndpointURL() );
-        props.setEndpointServiceName( serviceName );
-        props.setServiceImplements( 
ImplementsListBuilder.getServiceImplementsList( resourceDef, m_portTypeInfoMap 
) );
-        props.setNamespace( targetNamespace );
-        props.setPrefix( GenerationUtils.getPrefix( targetNamespace ) );
-        props.setCustomMappings( GenerationUtils.getOperationInfoMap( 
resourceDef ) );
-        props.setHasProperties( resourceDef.hasProperties() );
+        String capitalizedServiceName = StringUtils.capitalize(serviceName);
+        props.setServiceName(capitalizedServiceName);
+        props.setSrcDir(new File(serviceDir, "src/java").getAbsolutePath());
+        props.setJarDir(new File(m_xmlbeansDir, "lib").getAbsolutePath());
+        props.setJarFileName(getJarFileName(wsdlFile));
+        props.setClassesDir(new File(serviceDir, "classes").getAbsolutePath());
+        props.setEndpointURL(resourceDef.getEndpointURL());
+        props.setEndpointServiceName(serviceName);
+        
props.setServiceImplements(ImplementsListBuilder.getServiceImplementsList(resourceDef,
 m_portTypeInfoMap));
+        props.setNamespace(targetNamespace);
+        props.setPrefix(GenerationUtils.getPrefix(targetNamespace));
+        
props.setCustomMappings(GenerationUtils.getOperationInfoMap(resourceDef));
+        props.setHasProperties(resourceDef.hasProperties());
         props.setWebappName(getWebbappName());
 
         if (resourceDef.hasProperties())
         {
             QName[] propertyNames = resourceDef.getPropertyNames();
             Map propMap = new HashMap();
-            for ( int i = 0; i < propertyNames.length; i++ )
+            for (int i = 0; i < propertyNames.length; i++)
             {
                 QName propertyName = propertyNames[i];
-                String propName = getJavaConstantName( propertyName, propMap );
-                propMap.put( propName, propertyName );
+                String propName = getJavaConstantName(propertyName, propMap);
+                propMap.put(propName, propertyName);
             }
-            props.setPropertyMap( propMap );
+            props.setPropertyMap(propMap);
         }
 
         // define the names of the resource props that we initialize for the 
user...
-        
props.addImplementedProperty(org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME);
-        
props.addImplementedProperty(org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_CURRENT_TIME);
-        
props.addImplementedProperty(org.apache.ws.resource.lifetime.v2004_11.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME);
-        
props.addImplementedProperty(org.apache.ws.resource.lifetime.v2004_11.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_CURRENT_TIME);
-
-        props.setResourceImplements( 
ImplementsListBuilder.getResourceImplementsList( resourceDef, m_portTypeInfoMap 
) );
+        if (hasScheduledResourceTerminationPortType(resourceDef))
+        {
+            
props.addImplementedProperty(org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME);
+            
props.addImplementedProperty(org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_CURRENT_TIME);
+            
props.addImplementedProperty(org.apache.ws.resource.lifetime.v2004_11.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME);
+            
props.addImplementedProperty(org.apache.ws.resource.lifetime.v2004_11.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_CURRENT_TIME);
+        }
+        
props.setResourceImplements(ImplementsListBuilder.getResourceImplementsList(resourceDef,
 m_portTypeInfoMap));
         QName propertiesDocumentName = resourceDef.getPropertiesDocumentName();
-        if( propertiesDocumentName != null)
+        if (propertiesDocumentName != null)
         {
-        props.setPropertyDocumentName(
-                XmlBeanNameUtils.getDocumentElementXmlBeanClassName(
-                  propertiesDocumentName       ) );
+            
props.setPropertyDocumentName(XmlBeanNameUtils.getDocumentElementXmlBeanClassName(propertiesDocumentName));
         }
-        props.setWsdlName( wsdlFile.getName() );
-        props.setResourcekey( new QName( targetNamespace, "ResourceIdentifier" 
) );
+        props.setWsdlName(wsdlFile.getName());
+        props.setResourcekey(new QName(targetNamespace, "ResourceIdentifier"));
         Iterator ptNameIter = 
resourceDef.getImplementedResourceCapabilities().keySet().iterator();
-        while ( ptNameIter.hasNext() )
+        while (ptNameIter.hasNext())
         {
             QName ptName = (QName) ptNameIter.next();
-            PortType2JavaInfo ptInfo = (PortType2JavaInfo) 
m_portTypeInfoMap.get( ptName );
-            if ( ptInfo != null )
+            PortType2JavaInfo ptInfo = (PortType2JavaInfo) 
m_portTypeInfoMap.get(ptName);
+            if (ptInfo != null)
             {
-                if ( ptInfo.getResourceTemplateFileName() != null )
+                if (ptInfo.getResourceTemplateFileName() != null)
                 {
-                    props.addResourceIncludeFile( 
ptInfo.getResourceTemplateFileName() );
+                    
props.addResourceIncludeFile(ptInfo.getResourceTemplateFileName());
                 }
-                if ( ptInfo.getResourceInitMethodIncludeLocation() != null )
+                if (ptInfo.getResourceInitMethodIncludeLocation() != null)
                 {
-                    props.addResourceInitIncludeLocation( 
ptInfo.getResourceInitMethodIncludeLocation() );
+                    
props.addResourceInitIncludeLocation(ptInfo.getResourceInitMethodIncludeLocation());
                 }
-                if ( ptInfo.getAbstractResourceInitMethodIncludeLocation() != 
null )
+                if (ptInfo.getAbstractResourceInitMethodIncludeLocation() != 
null)
                 {
-                    props.addAbstractResourceInitIncludeLocation( 
ptInfo.getAbstractResourceInitMethodIncludeLocation() );
+                    
props.addAbstractResourceInitIncludeLocation(ptInfo.getAbstractResourceInitMethodIncludeLocation());
                 }
-                if ( ptInfo.getServiceTemplateFileName() != null )
+                if (ptInfo.getServiceTemplateFileName() != null)
                 {
-                    props.addServiceIncludeFile( 
ptInfo.getServiceTemplateFileName() );
+                    
props.addServiceIncludeFile(ptInfo.getServiceTemplateFileName());
                 }
             }
             else
@@ -430,11 +427,11 @@
             }
         }
 
-        if(isDraft01Specific(resourceDef))
+        if (isDraft01Specific(resourceDef))
         {
             
props.setNamespaceVersionHolder(org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl.class);
         }
-        else if(isDraft05Specific(resourceDef))
+        else if (isDraft05Specific(resourceDef))
         {
             
props.setNamespaceVersionHolder(org.apache.ws.resource.properties.v2004_11.impl.NamespaceVersionHolderImpl.class);
         }
@@ -448,15 +445,21 @@
         props.setPortName(portName);
         QName portTypeQName = resourceDef.getPortType().getQName();
         props.setPortTypeQName(portTypeQName);
-        QName serviceQname = new QName(targetNamespace,serviceName);
+        QName serviceQname = new QName(targetNamespace, serviceName);
         props.setServiceQName(serviceQname);
         return props;
     }
 
-    private String getJavaConstantName( QName propertyName, Map propMap )
+    private boolean hasScheduledResourceTerminationPortType(ResourceDefinition 
resourceDef)
+    {
+        return 
resourceDef.implementsResourceCapability(org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.NAME)
+               || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.lifetime.v2004_11.porttype.ScheduledResourceTerminationPortType.NAME);
+    }
+
+    private String getJavaConstantName(QName propertyName, Map propMap)
     {
         String constName = propertyName.getLocalPart().toUpperCase();
-        for ( int count = 2; propMap.containsKey( constName ); count++ )
+        for (int count = 2; propMap.containsKey(constName); count++)
         {
             constName += count;
         }
@@ -471,60 +474,60 @@
     private boolean isDraft05Specific(ResourceDefinition resourceDef)
     {
         return 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_11.porttype.GetMultipleResourcePropertiesPortType.NAME)
-        || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_11.porttype.GetResourcePropertyDocumentPortType.NAME)
-        || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_11.porttype.DeleteResourcePropertiesPortType.NAME)
-        || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_11.porttype.GetResourcePropertyPortType.NAME)
-        || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_11.porttype.InsertResourcePropertiesPortType.NAME)
-        || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_11.porttype.QueryResourcePropertiesPortType.NAME)
-        || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_11.porttype.SetResourcePropertiesPortType.NAME)
-        || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_11.porttype.UpdateResourcePropertiesPortType.NAME);
+               || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_11.porttype.GetResourcePropertyDocumentPortType.NAME)
+               || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_11.porttype.DeleteResourcePropertiesPortType.NAME)
+               || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_11.porttype.GetResourcePropertyPortType.NAME)
+               || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_11.porttype.InsertResourcePropertiesPortType.NAME)
+               || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_11.porttype.QueryResourcePropertiesPortType.NAME)
+               || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_11.porttype.SetResourcePropertiesPortType.NAME)
+               || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_11.porttype.UpdateResourcePropertiesPortType.NAME);
     }
 
     private boolean isDraft01Specific(ResourceDefinition resourceDef)
     {
         return 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_06.porttype.GetMultipleResourcePropertiesPortType.NAME)
-           || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_06.porttype.GetResourcePropertyPortType.NAME)
-           || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_06.porttype.QueryResourcePropertiesPortType.NAME)
-           || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_06.porttype.SetResourcePropertiesPortType.NAME);
+               || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_06.porttype.GetResourcePropertyPortType.NAME)
+               || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_06.porttype.QueryResourcePropertiesPortType.NAME)
+               || 
resourceDef.implementsResourceCapability(org.apache.ws.resource.properties.v2004_06.porttype.SetResourcePropertiesPortType.NAME);
     }
 
-    private void generateXmlBeans( File wsdlFile )
+    private void generateXmlBeans(File wsdlFile)
             throws Exception
     {
-        System.out.println( "Generating XMLBeans for WSDL file \"" + wsdlFile 
+ "\"..." );
+        System.out.println("Generating XMLBeans for WSDL file \"" + wsdlFile + 
"\"...");
         SchemaCompiler.Parameters scompParams = new 
SchemaCompiler.Parameters();
-        scompParams.setSrcDir( new File( m_xmlbeansDir, "src" ) );
+        scompParams.setSrcDir(new File(m_xmlbeansDir, "src"));
         File tempClassesDir = getTempDir();
-        scompParams.setClassesDir( tempClassesDir );
-        scompParams.setWsdlFiles( new File[]
+        scompParams.setClassesDir(tempClassesDir);
+        scompParams.setWsdlFiles(new File[]
         {
             wsdlFile
-        } );
+        });
 
-        String xmlbeansJarFileName = getJarFileName( wsdlFile );
+        String xmlbeansJarFileName = getJarFileName(wsdlFile);
         File[] classpath = removeJarFromClasspathArray(xmlbeansJarFileName, 
m_classpath);
-        scompParams.setClasspath( classpath );
-        scompParams.setDownload( true );  // download remote xsd inputs/imports
-        scompParams.setDebug( true );     // compile w/ debug symbols
-        scompParams.setVerbose( m_options.isVerbose() );
-        scompParams.setQuiet( ! m_options.isVerbose() );
+        scompParams.setClasspath(classpath);
+        scompParams.setDownload(true);  // download remote xsd inputs/imports
+        scompParams.setDebug(true);     // compile w/ debug symbols
+        scompParams.setVerbose(m_options.isVerbose());
+        scompParams.setQuiet(!m_options.isVerbose());
         final boolean beNoisy = true;
-        XmlErrorPrinter xErrorListener = new XmlErrorPrinter( beNoisy, null );
-        scompParams.setErrorListener( xErrorListener );
-        File jarDir = new File( m_xmlbeansDir, "lib" );
+        XmlErrorPrinter xErrorListener = new XmlErrorPrinter(beNoisy, null);
+        scompParams.setErrorListener(xErrorListener);
+        File jarDir = new File(m_xmlbeansDir, "lib");
         jarDir.mkdirs();
-        scompParams.setOutputJar( new File( jarDir, xmlbeansJarFileName ) );
+        scompParams.setOutputJar(new File(jarDir, xmlbeansJarFileName));
         try
         {
-            if ( !SchemaCompiler.compile( scompParams ) )
+            if (!SchemaCompiler.compile(scompParams))
             {
-                throw new Exception( xErrorListener.toString() );
+                throw new Exception(xErrorListener.toString());
             }
         }
         finally
         {
             //delete the temp directory
-            FileUtils.deleteDirectory( tempClassesDir );
+            FileUtils.deleteDirectory(tempClassesDir);
         }
     }
 
@@ -532,7 +535,7 @@
      * This method is used to remove an existing xmlbeans jar of the same name 
from the
      * array of files passed to scomp.  This will avoid the potential deletion 
of the
      * previously generated jar file and scomps lack of regenerating classes 
for existing jars.
-     *
+     * <p/>
      * This will ensure scomp generates the jar for the given xbeans jar name.
      *
      * @param xmlbeansJarFileName
@@ -544,7 +547,7 @@
         for (int i = 0; i < classpath.length; i++)
         {
             File file = classpath[i];
-            if( ! xmlbeansJarFileName.equals(file.getName()))
+            if (!xmlbeansJarFileName.equals(file.getName()))
             {
                 fileList.add(file);
             }
@@ -556,66 +559,66 @@
             }
         }
 
-        return (File[])fileList.toArray(new File[0]);
+        return (File[]) fileList.toArray(new File[0]);
     }
 
-    private void copyWsdlFile( File wsdlFile, File serviceDir )
+    private void copyWsdlFile(File wsdlFile, File serviceDir)
             throws IOException
     {
-        File javaDir = new File( serviceDir, "src" );
-        File wsdlDir = new File( javaDir, "wsdl" );
+        File javaDir = new File(serviceDir, "src");
+        File wsdlDir = new File(javaDir, "wsdl");
         wsdlDir.mkdirs();
-        FileUtils.copyFile( wsdlFile, new File( wsdlDir, wsdlFile.getName() ) 
);
+        FileUtils.copyFile(wsdlFile, new File(wsdlDir, wsdlFile.getName()));
     }
 
     private void initPortTypeInfoMap()
     {
         //draft 01
-        addPortType2JavaInfo( new 
org.apache.ws.resource.tool.porttype.v2004_06.GetResourcePropertyPortType2JavaInfo()
 );
-        addPortType2JavaInfo( new 
org.apache.ws.resource.tool.porttype.v2004_06.GetMultipleResourcePropertiesPortType2JavaInfo()
 );
-        addPortType2JavaInfo( new 
org.apache.ws.resource.tool.porttype.v2004_06.SetResourcePropertiesPortType2JavaInfo()
 );
-        addPortType2JavaInfo( new 
org.apache.ws.resource.tool.porttype.v2004_06.QueryResourcePropertiesPortType2JavaInfo()
 );
-        addPortType2JavaInfo( new 
org.apache.ws.resource.tool.porttype.v2004_06.ImmediateResourceTerminationPortType2JavaInfo()
 );
-        addPortType2JavaInfo( new 
org.apache.ws.resource.tool.porttype.v2004_06.ScheduledResourceTerminationPortType2JavaInfo()
 );
+        addPortType2JavaInfo(new 
org.apache.ws.resource.tool.porttype.v2004_06.GetResourcePropertyPortType2JavaInfo());
+        addPortType2JavaInfo(new 
org.apache.ws.resource.tool.porttype.v2004_06.GetMultipleResourcePropertiesPortType2JavaInfo());
+        addPortType2JavaInfo(new 
org.apache.ws.resource.tool.porttype.v2004_06.SetResourcePropertiesPortType2JavaInfo());
+        addPortType2JavaInfo(new 
org.apache.ws.resource.tool.porttype.v2004_06.QueryResourcePropertiesPortType2JavaInfo());
+        addPortType2JavaInfo(new 
org.apache.ws.resource.tool.porttype.v2004_06.ImmediateResourceTerminationPortType2JavaInfo());
+        addPortType2JavaInfo(new 
org.apache.ws.resource.tool.porttype.v2004_06.ScheduledResourceTerminationPortType2JavaInfo());
 
         //draft 05
-        addPortType2JavaInfo( new 
org.apache.ws.resource.tool.porttype.v2004_11.GetResourcePropertyPortType2JavaInfo()
 );
-        addPortType2JavaInfo( new 
org.apache.ws.resource.tool.porttype.v2004_11.GetMultipleResourcePropertiesPortType2JavaInfo()
 );
-        addPortType2JavaInfo( new 
org.apache.ws.resource.tool.porttype.v2004_11.SetResourcePropertiesPortType2JavaInfo()
 );
-        addPortType2JavaInfo( new 
org.apache.ws.resource.tool.porttype.v2004_11.QueryResourcePropertiesPortType2JavaInfo()
 );
-        addPortType2JavaInfo( new 
org.apache.ws.resource.tool.porttype.v2004_11.ImmediateResourceTerminationPortType2JavaInfo()
 );
-        addPortType2JavaInfo( new 
org.apache.ws.resource.tool.porttype.v2004_11.ScheduledResourceTerminationPortType2JavaInfo()
 );
-
-        addPortType2JavaInfo( new 
org.apache.ws.resource.tool.porttype.v2004_11.InsertResourcePropertiesPortType2JavaInfo()
 );
-        addPortType2JavaInfo( new 
org.apache.ws.resource.tool.porttype.v2004_11.UpdateResourcePropertiesPortType2JavaInfo()
 );
-        addPortType2JavaInfo( new 
org.apache.ws.resource.tool.porttype.v2004_11.DeleteResourcePropertiesPortType2JavaInfo()
 );
-        addPortType2JavaInfo( new 
org.apache.ws.resource.tool.porttype.v2004_11.GetResourcePropertyDocumentPortType2JavaInfo()
 );
+        addPortType2JavaInfo(new 
org.apache.ws.resource.tool.porttype.v2004_11.GetResourcePropertyPortType2JavaInfo());
+        addPortType2JavaInfo(new 
org.apache.ws.resource.tool.porttype.v2004_11.GetMultipleResourcePropertiesPortType2JavaInfo());
+        addPortType2JavaInfo(new 
org.apache.ws.resource.tool.porttype.v2004_11.SetResourcePropertiesPortType2JavaInfo());
+        addPortType2JavaInfo(new 
org.apache.ws.resource.tool.porttype.v2004_11.QueryResourcePropertiesPortType2JavaInfo());
+        addPortType2JavaInfo(new 
org.apache.ws.resource.tool.porttype.v2004_11.ImmediateResourceTerminationPortType2JavaInfo());
+        addPortType2JavaInfo(new 
org.apache.ws.resource.tool.porttype.v2004_11.ScheduledResourceTerminationPortType2JavaInfo());
+
+        addPortType2JavaInfo(new 
org.apache.ws.resource.tool.porttype.v2004_11.InsertResourcePropertiesPortType2JavaInfo());
+        addPortType2JavaInfo(new 
org.apache.ws.resource.tool.porttype.v2004_11.UpdateResourcePropertiesPortType2JavaInfo());
+        addPortType2JavaInfo(new 
org.apache.ws.resource.tool.porttype.v2004_11.DeleteResourcePropertiesPortType2JavaInfo());
+        addPortType2JavaInfo(new 
org.apache.ws.resource.tool.porttype.v2004_11.GetResourcePropertyDocumentPortType2JavaInfo());
 
         //metadataexchange 2004/09
-        addPortType2JavaInfo( new 
org.apache.ws.resource.tool.porttype.v2004_09.MetadataExchangePortType2JavaInfo()
 );        
+        addPortType2JavaInfo(new 
org.apache.ws.resource.tool.porttype.v2004_09.MetadataExchangePortType2JavaInfo());
     }
 
     private void initVelocity()
             throws Exception
     {
         // configure to use Commons Logging for logging
-        Velocity.setProperty( RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, 
CommonsLogLogSystem.class.getName() );
+        Velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, 
CommonsLogLogSystem.class.getName());
         // don't log warnings for invalid variable references
-        Velocity.setProperty( 
RuntimeConstants.RUNTIME_LOG_REFERENCE_LOG_INVALID, "false" );
+        
Velocity.setProperty(RuntimeConstants.RUNTIME_LOG_REFERENCE_LOG_INVALID, 
"false");
         // don't load any global macro libraries (override default of 
"VM_global_library.vm")
-        Velocity.setProperty( RuntimeConstants.VM_LIBRARY, "" );
+        Velocity.setProperty(RuntimeConstants.VM_LIBRARY, "");
         // configure to use classpath-based resource loader
-        Velocity.addProperty( RuntimeConstants.RESOURCE_LOADER, "classpath" );
+        Velocity.addProperty(RuntimeConstants.RESOURCE_LOADER, "classpath");
         String resourceLoaderBaseKey = "classpath." + 
RuntimeConstants.RESOURCE_LOADER + ".";
-        Velocity.setProperty( resourceLoaderBaseKey + "class", 
"org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader" );
-        Velocity.setProperty( resourceLoaderBaseKey + "cache", "false" );
-        Velocity.setProperty( resourceLoaderBaseKey + 
"modificationCheckInterval", "2" );
+        Velocity.setProperty(resourceLoaderBaseKey + "class", 
"org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
+        Velocity.setProperty(resourceLoaderBaseKey + "cache", "false");
+        Velocity.setProperty(resourceLoaderBaseKey + 
"modificationCheckInterval", "2");
         Velocity.init();
     }
 
-    private void processTemplate( VelocityContext context,
-                                  String templateLocation,
-                                  File outputFile )
+    private void processTemplate(VelocityContext context,
+                                 String templateLocation,
+                                 File outputFile)
             throws Exception
     {
         /*
@@ -628,22 +631,22 @@
          */
         try
         {
-            Template template = Velocity.getTemplate( templateLocation );
+            Template template = Velocity.getTemplate(templateLocation);
             /*
              *  Now have the template engine process your template using the
              *  data placed into the context. Think of it as a  'merge'
              *  of the template and the data to produce the output stream.
              */
-            FileWriter writer = new FileWriter( outputFile );
-            if ( template != null )
+            FileWriter writer = new FileWriter(outputFile);
+            if (template != null)
             {
-                template.merge( context, writer );
+                template.merge(context, writer);
             }
             writer.close();
         }
-        catch ( Exception e )
+        catch (Exception e)
         {
-            System.err.println( "Error processing template " + 
templateLocation );
+            System.err.println("Error processing template " + 
templateLocation);
             e.printStackTrace();
         }
     }
@@ -652,88 +655,88 @@
      * Provides a hook for adding to the Velocity Context.
      *
      * @param context
-     * @return  VelocityContext
+     * @return VelocityContext
      */
-    protected VelocityContext updateVelocityContext(VelocityContext 
context,ResourceDefinition resourceDef)
+    protected VelocityContext updateVelocityContext(VelocityContext context, 
ResourceDefinition resourceDef)
     {
         return context;
     }
 
-    private void processTemplates( ResourceDefinition resourceDef,
-                                   File wsdlFile, File serviceDir )
+    private void processTemplates(ResourceDefinition resourceDef,
+                                  File wsdlFile, File serviceDir)
             throws Exception
     {
-        String capitalizedServiceName = StringUtils.capitalize( 
resourceDef.getName() );
+        String capitalizedServiceName = 
StringUtils.capitalize(resourceDef.getName());
         try
         {
             VelocityContext context = new VelocityContext();
-            ServiceProperties props = buildServiceProperties( resourceDef, 
wsdlFile, serviceDir );
-            context.put( "generated", props );
-            updateVelocityContext(context,resourceDef);
+            ServiceProperties props = buildServiceProperties(resourceDef, 
wsdlFile, serviceDir);
+            context.put("generated", props);
+            updateVelocityContext(context, resourceDef);
 
             //generate files
-            File packageDir = getPackageDir( 
resourceDef.getDefinition().getTargetNamespace(), serviceDir );
+            File packageDir = 
getPackageDir(resourceDef.getDefinition().getTargetNamespace(), serviceDir);
             packageDir.mkdirs();
-            File outputFile = new File( packageDir, "Abstract" + 
capitalizedServiceName + "Service.java" );
-            processTemplate( context, "templates/AbstractService.vm", 
outputFile );
+            File outputFile = new File(packageDir, "Abstract" + 
capitalizedServiceName + "Service.java");
+            processTemplate(context, "templates/AbstractService.vm", 
outputFile);
 
-            outputFile = new File( packageDir, capitalizedServiceName + 
"Service.java" );
+            outputFile = new File(packageDir, capitalizedServiceName + 
"Service.java");
 
-            if ( !outputFile.exists() )
+            if (!outputFile.exists())
             {
-                processTemplate( context, "templates/Service.vm", outputFile );
+                processTemplate(context, "templates/Service.vm", outputFile);
             }
 
-            generateFaultClasses( context, props, packageDir );
+            generateFaultClasses(context, props, packageDir);
 
-            outputFile = new File( packageDir, "Abstract" + 
capitalizedServiceName + "Resource.java" );
-            processTemplate( context, "templates/AbstractResource.vm", 
outputFile );
+            outputFile = new File(packageDir, "Abstract" + 
capitalizedServiceName + "Resource.java");
+            processTemplate(context, "templates/AbstractResource.vm", 
outputFile);
 
-            outputFile = new File( packageDir, capitalizedServiceName + 
"Resource.java" );
+            outputFile = new File(packageDir, capitalizedServiceName + 
"Resource.java");
 
-            if ( !outputFile.exists() )
+            if (!outputFile.exists())
             {
-                processTemplate( context, "templates/Resource.vm", outputFile 
);
+                processTemplate(context, "templates/Resource.vm", outputFile);
             }
 
-            outputFile = new File( packageDir, capitalizedServiceName + 
"Home.java" );
+            outputFile = new File(packageDir, capitalizedServiceName + 
"Home.java");
 
-            if ( !outputFile.exists() )
+            if (!outputFile.exists())
             {
-                processTemplate( context, "templates/Home.vm", outputFile );
+                processTemplate(context, "templates/Home.vm", outputFile);
             }
 
-            if ( resourceDef.hasProperties() )
+            if (resourceDef.hasProperties())
             {
-                outputFile = new File( packageDir, capitalizedServiceName + 
"PropertyQNames.java" );
-                processTemplate( context, "templates/PropertyQNames.vm", 
outputFile );
+                outputFile = new File(packageDir, capitalizedServiceName + 
"PropertyQNames.java");
+                processTemplate(context, "templates/PropertyQNames.vm", 
outputFile);
             }
 
-            outputFile = new File( packageDir, capitalizedServiceName + 
"_deploy.wsdd" );
-            processTemplate( context, "templates/deploy.vm", outputFile );
+            outputFile = new File(packageDir, capitalizedServiceName + 
"_deploy.wsdd");
+            processTemplate(context, "templates/deploy.vm", outputFile);
 
-            outputFile = new File( packageDir, capitalizedServiceName + 
"_jndi-config.xml" );
-            processTemplate( context, "templates/jndi.vm", outputFile );
+            outputFile = new File(packageDir, capitalizedServiceName + 
"_jndi-config.xml");
+            processTemplate(context, "templates/jndi.vm", outputFile);
 
-            outputFile = new File( packageDir, capitalizedServiceName + 
"CustomOperationsPortType.java" );
-            processTemplate( context, "templates/CustomOperationsPortType.vm", 
outputFile );
+            outputFile = new File(packageDir, capitalizedServiceName + 
"CustomOperationsPortType.java");
+            processTemplate(context, "templates/CustomOperationsPortType.vm", 
outputFile);
 
-            outputFile = new File( serviceDir, "build.xml" );
-            processTemplate( context, "templates/build.xml.vm", outputFile );
+            outputFile = new File(serviceDir, "build.xml");
+            processTemplate(context, "templates/build.xml.vm", outputFile);
 
-            outputFile = new File( serviceDir, "build.properties" );
-            if ( !outputFile.exists() )
+            outputFile = new File(serviceDir, "build.properties");
+            if (!outputFile.exists())
             {
-            processTemplate( context, "templates/build.properties.vm", 
outputFile );
+                processTemplate(context, "templates/build.properties.vm", 
outputFile);
             }
         }
-        catch ( Exception e )
+        catch (Exception e)
         {
             e.printStackTrace();
         }
     }
 
-    private void generateFaultClasses( VelocityContext context, 
ServiceProperties props, File packageDir )
+    private void generateFaultClasses(VelocityContext context, 
ServiceProperties props, File packageDir)
             throws Exception
     {
         File outputFile;
@@ -750,12 +753,12 @@
                 Map parts = message.getParts();
                 if (parts.size() != 1)
                 {
-                    throw new Exception( "WSDL fault message should have 
exactly one part." );
+                    throw new Exception("WSDL fault message should have 
exactly one part.");
                 }
                 Part part = (Part) parts.values().iterator().next();
 
                 QName faultName = part.getTypeName();
-                boolean isType=true;
+                boolean isType = true;
                 if (faultName == null)
                 {
                     faultName = part.getElementName();
@@ -763,7 +766,7 @@
                 }
                 if (faultName == null)
                 {
-                   throw new Exception( "WSDL fault message part should have 
either an element or a type." );
+                    throw new Exception("WSDL fault message part should have 
either an element or a type.");
                 }
 
                 String exceptionFaultName = 
StringUtils.capitalize(faultName.getLocalPart()) + "Exception";
@@ -786,7 +789,7 @@
                     }
                     catch (Exception e)
                     {
-                        throw new Exception( "Unable to generate WSDL fault. 
Cause: " + e, e );
+                        throw new Exception("Unable to generate WSDL fault. 
Cause: " + e, e);
                     }
                 }
             }
@@ -806,7 +809,7 @@
         String xmlbeanFaultClassName = null;
         Class faultClass = null;
         URLClassLoader generatedXmlBeanClassloader = 
getGeneratedXmlBeanClassloader();
-        if(type)
+        if (type)
         {
             xmlbeanFaultClassName = NameUtil.getClassNameFromQName(faultName);
             //type to get an instance of the class
@@ -820,18 +823,18 @@
             Class xmlbeanGeneratedClass = 
generatedXmlBeanClassloader.loadClass(xmlbeanFaultClassName);
             //invoke newInstance in the Xmlbean's Factory class
             Method method = xmlbeanGeneratedClass.getMethod("newInstance", 
null);
-            Object o = method.invoke(xmlbeanGeneratedClass,null);
+            Object o = method.invoke(xmlbeanGeneratedClass, null);
 
             //invoke the addNew... method on the object to get its type
             xmlbeanGeneratedClass = o.getClass();
             method = xmlbeanGeneratedClass.getMethod("addNew" + 
faultName.getLocalPart(), null);
             //get the types's Class
-            faultClass = method.invoke(o,null).getClass();
+            faultClass = method.invoke(o, null).getClass();
         }
 
         //determine if the class is assignable from any known versions of 
BaseType
         return 
(org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSBaseFaults12Draft01.BaseFaultType.class.isAssignableFrom(faultClass)
 ||
-        
org.oasisOpen.docs.wsrf.x2004.x11.wsrfWSBaseFaults12Draft03.BaseFaultType.class.isAssignableFrom(faultClass));
+                
org.oasisOpen.docs.wsrf.x2004.x11.wsrfWSBaseFaults12Draft03.BaseFaultType.class.isAssignableFrom(faultClass));
     }
 
     /**
@@ -897,7 +900,7 @@
          *
          * @param verbose option indicating whether or not to enable verbose 
output
          */
-        public void setVerbose( boolean verbose )
+        public void setVerbose(boolean verbose)
         {
             m_verbose = verbose;
         }
@@ -913,21 +916,22 @@
         }
     }
 
-    static File[] toFileArray( String classpath )
+    static File[] toFileArray(String classpath)
     {
         List classpathItems = new ArrayList();
-        for ( StringTokenizer tokenizer = new StringTokenizer( classpath, 
File.pathSeparator );
-              tokenizer.hasMoreTokens(); )
+        for (StringTokenizer tokenizer = new StringTokenizer(classpath, 
File.pathSeparator);
+             tokenizer.hasMoreTokens();)
         {
-            classpathItems.add( new File( tokenizer.nextToken() ) );
+            classpathItems.add(new File(tokenizer.nextToken()));
         }
-        return (File[]) classpathItems.toArray( new File[0] );
+        return (File[]) classpathItems.toArray(new File[0]);
     }
 
     private URLClassLoader getGeneratedXmlBeanClassloader()
     {
         File libDir = new File(m_xmlbeansDir, "lib");
-        File[] jarFiles = libDir.listFiles(new FilenameFilter(){
+        File[] jarFiles = libDir.listFiles(new FilenameFilter()
+        {
             public boolean accept(File dir, String name)
             {
                 return name.endsWith(".jar");
@@ -942,7 +946,7 @@
             }
             catch (MalformedURLException murle)
             {
-                throw new RuntimeException( "Unable to load XMLBeans-generated 
jars and convert to URLs. Cause: " + murle, murle );
+                throw new RuntimeException("Unable to load XMLBeans-generated 
jars and convert to URLs. Cause: " + murle, murle);
             }
         }
         return new URLClassLoader(urls, this.getClass().getClassLoader());



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to