com.legstar.cixs.jaxws.gen
Class Cixs2JaxwsGenerator

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by com.legstar.cixs.gen.ant.AbstractCixsGenerator
              extended by com.legstar.cixs.jaxws.gen.AbstractCixsJaxwsGenerator
                  extended by com.legstar.cixs.jaxws.gen.Cixs2JaxwsGenerator

public class Cixs2JaxwsGenerator
extends AbstractCixsJaxwsGenerator

This Ant task creates the various Jaxws artifacts needed to implement a servlet proxy that acts as an adapter for a Web Service so that a mainframe program can call the target Web Service without any knowledge of SOAP. The task also generates a sample COBOL CICS program that demonstrates how to call the proxy servlet.


Field Summary
static String CIXS_TO_JAXWS_GENERATOR_NAME
          This generator name.
static String DEFAULT_SERVER_PATH_TEMPLATE
          Default pattern for server PATH.
static String OPERATION_COBOL_CICS_DFHWBCLI_CLIENT_VLC_TEMPLATE
          Velocity template for COBOL client using DFHWBCLI generation.
static String OPERATION_COBOL_CICS_LSHTTAPI_CLIENT_VLC_TEMPLATE
          Velocity template for COBOL client using LSHTTAPI generation.
static String OPERATION_COBOL_CICS_WEBAPI_CLIENT_VLC_TEMPLATE
          Velocity template for COBOL client using WEBAPI generation.
static String OPERATION_COBOL_CICS_WMQ_CLIENT_VLC_TEMPLATE
          Velocity template for COBOL client using WMQ generation.
static String SERVICE_ANT_BUILD_WAR_VLC_TEMPLATE
          Velocity template for war ant build generation.
static String SERVICE_ANT_DEPLOY_VLC_TEMPLATE
          Velocity template for service ant-deploy.
static String SERVICE_MODEL_NAME
          The service model name is it appears in templates.
static String SERVICE_WEB_XML_VLC_TEMPLATE
          Velocity template for web descriptor generation.
 
Fields inherited from class com.legstar.cixs.jaxws.gen.AbstractCixsJaxwsGenerator
JAXWS_GENERATOR_NAME
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
Cixs2JaxwsGenerator()
          Constructor.
 
Method Summary
 void addExtendedParameters(Map<String,Object> parameters)
          Add common parameters expected by templates to come from a parameters map.
 void addHttpTransportParameters(HttpTransportParameters httpTransportParameters)
           
 void addPojoTargetParameters(PojoParameters pojoTargetParameters)
           
 void addWebServiceTargetParameters(WebServiceParameters webServiceTargetParameters)
           
 void checkExtendedExtendedInput()
          Give the inheriting generators a chance to add more controls.
static String generateAntBuildWar(CixsJaxwsService service, Map<String,Object> parameters, File serviceAntFilesDir)
          Create the Ant Build for a War file generation.
static String generateAntDeploy(CixsJaxwsService service, Map<String,Object> parameters, File serviceAntFilesDir)
          Create the deploy Ant Build file.
static void generateCobolCicsClient(AbstractCixsService service, CixsOperation operation, Map<String,Object> parameters, File cobolFilesDir, TransportType transportType, CobolHttpClientType cobolHttpClientType)
          Create a COBOl CICS Client program to use for testing.
 void generateExtended(Map<String,Object> parameters)
          Create more artifacts for a Jboss ESB service.
static String generateWebXml(CixsJaxwsService service, Map<String,Object> parameters, File serviceWebFilesDir)
          Create the Jaxws Web Xml file.
 AntBuildCixs2JaxwsModel getAntModel()
          
 List<CixsOperation> getCixsOperations()
          Convenience method to get the inner mapped operations.
 String getDefaultServicePath()
           
 String getGeneratorName()
          
 HttpTransportParameters getHttpTransportParameters()
           
 PojoParameters getPojoTargetParameters()
           
 String getProxyTargetType()
           
protected  ProxyTargetType getProxyTargetTypeInternal()
           
 String getSampleCobolHttpClientType()
           
protected  CobolHttpClientType getSampleCobolHttpClientTypeInternal()
          When ant 1.7.0 will become widespread, we will be able to expose this method directly (support for enum JDK 1.5).
 File getTargetCobolDir()
           
 WebServiceParameters getWebServiceTargetParameters()
           
 void setHttpTransportParameters(HttpTransportParameters httpTransportParameters)
           
 void setPojoTargetParameters(PojoParameters pojoTargetParameters)
           
 void setProxyTargetType(String proxyTargetType)
           
protected  void setProxyTargetTypeInternal(ProxyTargetType proxyTargetType)
           
 void setSampleCobolHttpClientType(String sampleCobolHttpClientType)
           
 void setTargetCobolDir(File targetCobolDir)
           
 void setWebServiceTargetParameters(WebServiceParameters webServiceTargetParameters)
           
 
Methods inherited from class com.legstar.cixs.jaxws.gen.AbstractCixsJaxwsGenerator
add, addCixsJaxwsService, checkExtendedInput, generate, getCixsJaxwsService, getTargetWarDir, getTargetWDDDir, getVersion, setCixsJaxwsService, setTargetWarDir, setTargetWDDDir
 
Methods inherited from class com.legstar.cixs.gen.ant.AbstractCixsGenerator
add, addCixsService, completeModel, execute, generateFile, generateFile, getCixsService, getCoxbBinDir, getCustBinDir, getHostCharset, getJaxbBinDir, getTargetAntDir, getTargetBinDir, getTargetDistDir, getTargetSrcDir, init, setCixsService, setCoxbBinDir, setCustBinDir, setHostCharset, setJaxbBinDir, setTargetAntDir, setTargetBinDir, setTargetDistDir, setTargetSrcDir
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CIXS_TO_JAXWS_GENERATOR_NAME

public static final String CIXS_TO_JAXWS_GENERATOR_NAME
This generator name.

See Also:
Constant Field Values

SERVICE_ANT_BUILD_WAR_VLC_TEMPLATE

public static final String SERVICE_ANT_BUILD_WAR_VLC_TEMPLATE
Velocity template for war ant build generation.

See Also:
Constant Field Values

SERVICE_ANT_DEPLOY_VLC_TEMPLATE

public static final String SERVICE_ANT_DEPLOY_VLC_TEMPLATE
Velocity template for service ant-deploy.

See Also:
Constant Field Values

SERVICE_WEB_XML_VLC_TEMPLATE

public static final String SERVICE_WEB_XML_VLC_TEMPLATE
Velocity template for web descriptor generation.

See Also:
Constant Field Values

OPERATION_COBOL_CICS_LSHTTAPI_CLIENT_VLC_TEMPLATE

public static final String OPERATION_COBOL_CICS_LSHTTAPI_CLIENT_VLC_TEMPLATE
Velocity template for COBOL client using LSHTTAPI generation.

See Also:
Constant Field Values

OPERATION_COBOL_CICS_WEBAPI_CLIENT_VLC_TEMPLATE

public static final String OPERATION_COBOL_CICS_WEBAPI_CLIENT_VLC_TEMPLATE
Velocity template for COBOL client using WEBAPI generation.

See Also:
Constant Field Values

OPERATION_COBOL_CICS_DFHWBCLI_CLIENT_VLC_TEMPLATE

public static final String OPERATION_COBOL_CICS_DFHWBCLI_CLIENT_VLC_TEMPLATE
Velocity template for COBOL client using DFHWBCLI generation.

See Also:
Constant Field Values

OPERATION_COBOL_CICS_WMQ_CLIENT_VLC_TEMPLATE

public static final String OPERATION_COBOL_CICS_WMQ_CLIENT_VLC_TEMPLATE
Velocity template for COBOL client using WMQ generation.

See Also:
Constant Field Values

SERVICE_MODEL_NAME

public static final String SERVICE_MODEL_NAME
The service model name is it appears in templates.

See Also:
Constant Field Values

DEFAULT_SERVER_PATH_TEMPLATE

public static final String DEFAULT_SERVER_PATH_TEMPLATE
Default pattern for server PATH. Must be kept in sync with various velocity templates.

See Also:
Constant Field Values
Constructor Detail

Cixs2JaxwsGenerator

public Cixs2JaxwsGenerator()
Constructor.

Method Detail

addExtendedParameters

public void addExtendedParameters(Map<String,Object> parameters)
Add common parameters expected by templates to come from a parameters map.

Specified by:
addExtendedParameters in class AbstractCixsJaxwsGenerator
Parameters:
parameters - a parameters map to which parameters must be added

checkExtendedExtendedInput

public void checkExtendedExtendedInput()
                                throws com.legstar.codegen.CodeGenMakeException
Give the inheriting generators a chance to add more controls.

Specified by:
checkExtendedExtendedInput in class AbstractCixsJaxwsGenerator
Throws:
com.legstar.codegen.CodeGenMakeException - if control fails

generateExtended

public void generateExtended(Map<String,Object> parameters)
                      throws com.legstar.codegen.CodeGenMakeException
Create more artifacts for a Jboss ESB service.

Specified by:
generateExtended in class AbstractCixsJaxwsGenerator
Parameters:
parameters - a predefined set of parameters useful for generation
Throws:
com.legstar.codegen.CodeGenMakeException - if generation fails

generateAntBuildWar

public static String generateAntBuildWar(CixsJaxwsService service,
                                         Map<String,Object> parameters,
                                         File serviceAntFilesDir)
                                  throws com.legstar.codegen.CodeGenMakeException
Create the Ant Build for a War file generation.

Parameters:
service - the service description
parameters - miscellaneous help parameters
serviceAntFilesDir - where to store the generated file
Returns:
the generated file name
Throws:
com.legstar.codegen.CodeGenMakeException - if generation fails

generateAntDeploy

public static String generateAntDeploy(CixsJaxwsService service,
                                       Map<String,Object> parameters,
                                       File serviceAntFilesDir)
                                throws com.legstar.codegen.CodeGenMakeException
Create the deploy Ant Build file.

Parameters:
service - the Jaxws service description
parameters - miscellaneous help parameters
serviceAntFilesDir - where to store the generated file
Returns:
the generated file name
Throws:
com.legstar.codegen.CodeGenMakeException - if generation fails

generateWebXml

public static String generateWebXml(CixsJaxwsService service,
                                    Map<String,Object> parameters,
                                    File serviceWebFilesDir)
                             throws com.legstar.codegen.CodeGenMakeException
Create the Jaxws Web Xml file.

Parameters:
service - the Jaxws service description
parameters - miscellaneous help parameters
serviceWebFilesDir - where to store the generated file
Returns:
the generated file name
Throws:
com.legstar.codegen.CodeGenMakeException - if generation fails

generateCobolCicsClient

public static void generateCobolCicsClient(AbstractCixsService service,
                                           CixsOperation operation,
                                           Map<String,Object> parameters,
                                           File cobolFilesDir,
                                           TransportType transportType,
                                           CobolHttpClientType cobolHttpClientType)
                                    throws com.legstar.codegen.CodeGenMakeException
Create a COBOl CICS Client program to use for testing.

Parameters:
service - the Jaxws service description
operation - the operation for which a program is to be generated
parameters - the set of parameters to pass to template engine
cobolFilesDir - location where COBOL code should be generated
transportType - wire protocol to use between cobol client and proxy
cobolHttpClientType - the type of COBOL http client sample to generate
Throws:
com.legstar.codegen.CodeGenMakeException - if generation fails

getTargetCobolDir

public File getTargetCobolDir()
Returns:
the directory where COBOL files will be created

setTargetCobolDir

public void setTargetCobolDir(File targetCobolDir)
Parameters:
targetCobolDir - the directory where COBOL files will be created to set

getAntModel

public AntBuildCixs2JaxwsModel getAntModel()

Overrides:
getAntModel in class AbstractCixsJaxwsGenerator
See Also:
AbstractCixsGenerator.getAntModel()

getCixsOperations

public List<CixsOperation> getCixsOperations()
Convenience method to get the inner mapped operations.

Overrides:
getCixsOperations in class AbstractCixsJaxwsGenerator
Returns:
the operations list

getGeneratorName

public String getGeneratorName()

Specified by:
getGeneratorName in class AbstractCixsGenerator

getSampleCobolHttpClientTypeInternal

protected CobolHttpClientType getSampleCobolHttpClientTypeInternal()
When ant 1.7.0 will become widespread, we will be able to expose this method directly (support for enum JDK 1.5).

Returns:
the Http Cobol Client Type in use.

getSampleCobolHttpClientType

public String getSampleCobolHttpClientType()
Returns:
the Http Cobol Client Type in use.

setSampleCobolHttpClientType

public void setSampleCobolHttpClientType(String sampleCobolHttpClientType)
Parameters:
sampleCobolHttpClientType - the Http Cobol Client Type in use.

getProxyTargetTypeInternal

protected ProxyTargetType getProxyTargetTypeInternal()
Returns:
the type of target that the generated proxy service will invoke

setProxyTargetTypeInternal

protected void setProxyTargetTypeInternal(ProxyTargetType proxyTargetType)
Parameters:
proxyTargetType - the type of target that the generated proxy service will invoke

getProxyTargetType

public String getProxyTargetType()
Returns:
the type of target that the generated proxy service will invoke

setProxyTargetType

public void setProxyTargetType(String proxyTargetType)
Parameters:
proxyTargetType - the type of target that the generated proxy service will invoke

getPojoTargetParameters

public PojoParameters getPojoTargetParameters()
Returns:
the set of parameters needed to invoke a POJO

setPojoTargetParameters

public void setPojoTargetParameters(PojoParameters pojoTargetParameters)
Parameters:
pojoTargetParameters - the set of parameters needed to invoke a POJO to set

addPojoTargetParameters

public void addPojoTargetParameters(PojoParameters pojoTargetParameters)
Parameters:
pojoTargetParameters - the set of parameters needed to invoke a POJO to set

getWebServiceTargetParameters

public WebServiceParameters getWebServiceTargetParameters()
Returns:
the set of parameters needed to invoke a Web Service

setWebServiceTargetParameters

public void setWebServiceTargetParameters(WebServiceParameters webServiceTargetParameters)
Parameters:
webServiceTargetParameters - the set of parameters needed to invoke a Web Service to set

addWebServiceTargetParameters

public void addWebServiceTargetParameters(WebServiceParameters webServiceTargetParameters)
Parameters:
webServiceTargetParameters - the set of parameters needed to invoke a Web Service to set

getHttpTransportParameters

public HttpTransportParameters getHttpTransportParameters()
Returns:
the set of parameters needed to access the proxy over HTTP

setHttpTransportParameters

public void setHttpTransportParameters(HttpTransportParameters httpTransportParameters)
Parameters:
httpTransportParameters - the set of parameters needed to access the proxy over HTTP

addHttpTransportParameters

public void addHttpTransportParameters(HttpTransportParameters httpTransportParameters)
Parameters:
httpTransportParameters - the set of parameters needed to access the proxy over HTTP to set

getDefaultServicePath

public String getDefaultServicePath()
Returns:
a good default path that the host could use to reach the generated service proxy


Copyright © 2014 LegSem. All Rights Reserved.