com.sun.enterprise.deployment.util.webservice
Class WsCompileInvoker

java.lang.Object
  extended by com.sun.enterprise.deployment.util.webservice.WsCompileInvoker

@Contract
public abstract class WsCompileInvoker
extends java.lang.Object

This interface is used by the deploytool to generate webservice artifacts. A client is expected to set the options and features using the add* methods before calling the generate* method Here is a code sample SEIConfig cfg = new SEIConfig("WeatherWebService", "WeatherWebService", "endpoint", "endpoint.WeatherService", "endpoint.WeatherServiceImpl"); WsCompileInvoker inv = WsCompileInvoker.getWsCompileInvoker(System.out); inv.addWsCompileOption(inv.TARGET_DIR, "/home/user/codesamples/weatherinfo/test"); inv.addWsCompileOption(inv.MAP_FILE, "/home/user/codesamples/weatherinfo/test/map109.xml"); inv.addWsCompileOption(inv.CLASS_PATH, "/home/user/codesamples/weatherinfo/service/build/classes"); inv.addWsCompileFeature("wsi"); inv.addWsCompileFeature("strict"); inv.generateWSDL(cfg); If the client uses the same instance of WsCompileInvoker for multiple invocations of wscompile, then it is the client's responsibility to empty the options (using the clearWsCompileOptionsAndFeatures() method) that are present in this Map before using this Map for the next wscompile invocation


Field Summary
static java.lang.String CLASS_PATH
          This specifies the classpath to be used by the wscompile tool - ideally this should at least be set to directory where the SEI package is present.
static java.lang.String MAP_FILE
          This specifies the file name to be used by the wscompile tool for creating the 109 mapping file.
static java.lang.String TARGET_DIR
          This specifies the target directory to be used by the wscompile tool to create the service artifacts - if this is not specified, then the current directory will be used by the wscompile tool
protected  java.util.HashMap wsCompileOptions
          This Map holds all the options to be used while invoking the wscompile tool; the options are set by the client of this interface using the setter methods available in this interface.
 
Constructor Summary
WsCompileInvoker()
           
 
Method Summary
 void addWsCompileFeature(java.lang.String feature)
          This is used to set a feature to be used while invoking the wscompile tool; for example to use the -f:wsi feature, the call will be addWsCompileFeature("wsi") This will prefix -f: to the feature and set it as part of the options Map with operand being null
 void addWsCompileOption(java.lang.String option, java.lang.String operand)
          This is used to set an option to be used while invoking the wscompile tool; for example to use the -classpath option for wscompile, the call will be setWsCompileOption(WsCompileInvoker.CLASS_PATH, "the_path"); For using wscompile options that are not defined in WsCompileInvoker, the 'option' argument of this call will be the actual argument to be used ; for example, for using the '-s' option of wscompile, the call to set the option will be setWsCompileOption("-s", "the_path_to_be_used"); For options that dont have an operand, the second argument can be null; for example, to invoke the wscompile tool with verbose option, the -verbose option will be set with this call setWsCompileOption("-verbose", null);
 void clearWsCompileOptionsAndFeatures()
          This is used to clear all options that have been set
abstract  void generateClientStubs(WSDLConfig config)
          This is used to generate the non-portable client side artifacts given information on WSDL file location and the package name; The caller sends the required info on WSDL location, package name etc in WSDLConfig argument and this method creates the equivalent jaxrpc-config.xml, invokes wscompile with -gen:client option which will generate all required non-portable client-side artifacts like JAXRPC stubs etc.
abstract  void generateSEI(WSDLConfig config)
          This is used to generate SEI and mapping files given information on WSDL file location, require package name.
abstract  void generateWSDL(SEIConfig config)
          This is used to generate WSDL and mapping files given information on SEI config; the caller sends in all the required info in SEIConfig (info like name of webservice, interface name, package name etc) and this method creates the equivalent jaxrpc-config.xml, invokes wscompile with -define option which will generate the WSDL and the mapping file.
 boolean removeWsCompileFeature(java.lang.String feature)
          This is used to remove a feature that was set; for example to remove "-f:strict" feature that was set before the call will be removeWsCompileFeature("strict")
 boolean removeWsCompileOption(java.lang.String option)
          This is used to remove an option that was already set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wsCompileOptions

protected java.util.HashMap wsCompileOptions
This Map holds all the options to be used while invoking the wscompile tool; the options are set by the client of this interface using the setter methods available in this interface.


CLASS_PATH

public static final java.lang.String CLASS_PATH
This specifies the classpath to be used by the wscompile tool - ideally this should at least be set to directory where the SEI package is present.

See Also:
Constant Field Values

TARGET_DIR

public static final java.lang.String TARGET_DIR
This specifies the target directory to be used by the wscompile tool to create the service artifacts - if this is not specified, then the current directory will be used by the wscompile tool

See Also:
Constant Field Values

MAP_FILE

public static final java.lang.String MAP_FILE
This specifies the file name to be used by the wscompile tool for creating the 109 mapping file.

See Also:
Constant Field Values
Constructor Detail

WsCompileInvoker

public WsCompileInvoker()
Method Detail

generateWSDL

public abstract void generateWSDL(SEIConfig config)
                           throws WsCompileInvokerException,
                                  java.io.IOException
This is used to generate WSDL and mapping files given information on SEI config; the caller sends in all the required info in SEIConfig (info like name of webservice, interface name, package name etc) and this method creates the equivalent jaxrpc-config.xml, invokes wscompile with -define option which will generate the WSDL and the mapping file.

Parameters:
SEIConfig - containing webservice name, package name, namespace, SEI and its implementation
Throws:
WsCompileInvokerException
java.io.IOException

generateSEI

public abstract void generateSEI(WSDLConfig config)
                          throws WsCompileInvokerException,
                                 java.io.IOException
This is used to generate SEI and mapping files given information on WSDL file location, require package name. The caller sends the required info on WSDL location, package name etc in WSDLConfig argument and this method creates the equivalent jaxrpc-config,xml, invokes wscompile with -import option which will generate the SEI and a template implementation of the SEI.

Parameters:
WSDLConfig - containing webservice name, package name, and WSDL location
Throws:
WsCompileInvokerException
java.io.IOException

generateClientStubs

public abstract void generateClientStubs(WSDLConfig config)
                                  throws WsCompileInvokerException,
                                         java.io.IOException
This is used to generate the non-portable client side artifacts given information on WSDL file location and the package name; The caller sends the required info on WSDL location, package name etc in WSDLConfig argument and this method creates the equivalent jaxrpc-config.xml, invokes wscompile with -gen:client option which will generate all required non-portable client-side artifacts like JAXRPC stubs etc.

Parameters:
WSDLConfig - containing webservice name, package name, and WSDL location
Throws:
WsCompileInvokerException
java.io.IOException

addWsCompileOption

public void addWsCompileOption(java.lang.String option,
                               java.lang.String operand)
This is used to set an option to be used while invoking the wscompile tool; for example to use the -classpath option for wscompile, the call will be setWsCompileOption(WsCompileInvoker.CLASS_PATH, "the_path"); For using wscompile options that are not defined in WsCompileInvoker, the 'option' argument of this call will be the actual argument to be used ; for example, for using the '-s' option of wscompile, the call to set the option will be setWsCompileOption("-s", "the_path_to_be_used"); For options that dont have an operand, the second argument can be null; for example, to invoke the wscompile tool with verbose option, the -verbose option will be set with this call setWsCompileOption("-verbose", null);

Parameters:
String - option the wscompile option to be used
String - operand the operand for the option; null if none;

removeWsCompileOption

public boolean removeWsCompileOption(java.lang.String option)
This is used to remove an option that was already set

Parameters:
String - The option that has to be removed

addWsCompileFeature

public void addWsCompileFeature(java.lang.String feature)
This is used to set a feature to be used while invoking the wscompile tool; for example to use the -f:wsi feature, the call will be addWsCompileFeature("wsi") This will prefix -f: to the feature and set it as part of the options Map with operand being null

Parameters:
String - the feature to be set

removeWsCompileFeature

public boolean removeWsCompileFeature(java.lang.String feature)
This is used to remove a feature that was set; for example to remove "-f:strict" feature that was set before the call will be removeWsCompileFeature("strict")

Parameters:
String - the feature to be removed

clearWsCompileOptionsAndFeatures

public void clearWsCompileOptionsAndFeatures()
This is used to clear all options that have been set



Copyright © 2012 GlassFish Community. All Rights Reserved.