Home » geronimo-2.2-source-release » org.apache.geronimo.jaxws.wsdl » [javadoc | source]

    1   /**
    2    *  Licensed to the Apache Software Foundation (ASF) under one or more
    3    *  contributor license agreements.  See the NOTICE file distributed with
    4    *  this work for additional information regarding copyright ownership.
    5    *  The ASF licenses this file to You under the Apache License, Version 2.0
    6    *  (the "License"); you may not use this file except in compliance with
    7    *  the License.  You may obtain a copy of the License at
    8    *
    9    *     http://www.apache.org/licenses/LICENSE-2.0
   10    *
   11    *  Unless required by applicable law or agreed to in writing, software
   12    *  distributed under the License is distributed on an "AS IS" BASIS,
   13    *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14    *  See the License for the specific language governing permissions and
   15    *  limitations under the License.
   16    */
   17   package org.apache.geronimo.jaxws.wsdl;
   18   
   19   import javax.xml.namespace.QName;
   20   
   21   public class WsdlGeneratorOptions {
   22   
   23       private final static String ADD_TO_CLASSPATH_WSGEN_PROPERTY =
   24           "org.apache.geronimo.jaxws.wsgen.addToClassPath";
   25       
   26       private final static String FORK_WSGEN_PROPERTY = 
   27           "org.apache.geronimo.jaxws.wsgen.fork";
   28       
   29       private final static String FORK_TIMEOUT_WSGEN_PROPERTY = 
   30           "org.apache.geronimo.jaxws.wsgen.fork.timeout";
   31       
   32       public final static long FORK_POLL_FREQUENCY = 1000 * 2; // 2 seconds
   33       
   34       public enum SAAJ { SUN, Axis2 };
   35       
   36       private QName wsdlService;
   37       private QName wsdlPort;
   38       private SAAJ saaj;
   39       private boolean fork = getDefaultFork();
   40       private long forkTimeout = getDefaultForkTimeout();
   41       private boolean addToClassPath = getDefaultAddToClassPath();
   42       
   43       private static boolean getDefaultFork() {
   44           String value = System.getProperty(FORK_WSGEN_PROPERTY);
   45           if (value != null) {
   46               return Boolean.valueOf(value).booleanValue();
   47           } else {
   48               String osName = System.getProperty("os.name");
   49               if (osName == null) {
   50                   return false;
   51               }
   52               osName = osName.toLowerCase();
   53               // Fork on Windows only
   54               return (osName.indexOf("windows") != -1);            
   55           }
   56       }
   57       
   58       private static long getDefaultForkTimeout() {
   59           String value = System.getProperty(FORK_TIMEOUT_WSGEN_PROPERTY);
   60           if (value != null) {
   61               return Long.parseLong(value);
   62           } else {
   63               return 1000 * 60; // 60 seconds
   64           }
   65       }
   66       
   67       private static boolean getDefaultAddToClassPath() {
   68           String value = System.getProperty(ADD_TO_CLASSPATH_WSGEN_PROPERTY);
   69           if (value == null) {
   70               return true;
   71           } else {
   72               return Boolean.parseBoolean(value);
   73           }
   74       }
   75       
   76       public QName getWsdlService() {
   77           return wsdlService;
   78       }
   79       
   80       public void setWsdlService(QName wsdlService) {
   81           this.wsdlService = wsdlService;
   82       }
   83       
   84       public QName getWsdlPort() {
   85           return wsdlPort;
   86       }
   87       
   88       public void setWsdlPort(QName wsdlPort) {
   89           this.wsdlPort = wsdlPort;
   90       }
   91   
   92       public void setSAAJ(SAAJ saaj) {
   93           this.saaj = saaj;
   94       }
   95       
   96       public SAAJ getSAAJ() {
   97           return this.saaj;
   98       }
   99       
  100       public void setAddToClassPath(boolean addToClassPath) {
  101           this.addToClassPath = addToClassPath;        
  102       }
  103       
  104       public boolean getAddToClassPath() {
  105           return this.addToClassPath;
  106       }
  107       
  108       public long getForkTimeout() {
  109           return forkTimeout;
  110       }
  111   
  112       public void setForkTimeout(long forkTimeout) {
  113           this.forkTimeout = forkTimeout;
  114       }
  115   
  116       public void setFork(boolean fork) {
  117           this.fork = fork;
  118       }
  119       
  120       public boolean getFork() {
  121           return this.fork;
  122       }
  123       
  124   }

Home » geronimo-2.2-source-release » org.apache.geronimo.jaxws.wsdl » [javadoc | source]