org.objectweb.jonas_ws.wsgen
Class AbsConfigGenerator

java.lang.Object
  extended byorg.objectweb.jonas_ws.wsgen.AbsConfigGenerator
All Implemented Interfaces:
ConfigGenerator
Direct Known Subclasses:
AxisConfigGenerator

public abstract class AbsConfigGenerator
extends java.lang.Object
implements ConfigGenerator

This class realizes configuration files generation. This class implements genEndpointConfig & genClientConfig methods; configuration methods stay abstract (WS implementation specific).


Nested Class Summary
 class AbsConfigGenerator.DirFileFilter
           
 class AbsConfigGenerator.JavaFileFilter
           
 
Field Summary
protected  java.lang.String cp
          The classpath to use with command lines
protected  java.lang.String filename
          The complete name of the file processed
protected  java.io.File genDir
          The output directory where files are generated
protected  java.lang.String javaHomeBin
          The $JAVA_HOME/bin directory
protected static org.objectweb.util.monolog.api.Logger logger
          WsGen logger
 
Fields inherited from interface org.objectweb.jonas_ws.wsgen.ConfigGenerator
DEBUG, DEBUG_DEFAULT, KEEP_GEN, NO_CONFIG, NO_CONFIG_DEFAULT, VERBOSE, VERBOSE_DEFAULT
 
Constructor Summary
AbsConfigGenerator()
          Constructor : creates a AbsConfigGenerator object.
 
Method Summary
protected  void addSrcs(java.io.File dir, java.util.Vector srcs)
           
protected  void compileGenDir()
           
protected  void configureClient(ServiceRef sr)
          ConfigureClient has to be implemented in subClass.
protected  void configureEndpoint(WSDeploymentDesc wsdd)
          Configure Endpoint has to be implemented in subClass.
protected  boolean destroyFile(java.io.File file)
          Recursively destroy the given file.
protected  void destroyTempDir()
          Destroy the temporary directory used for generation.
 void genClientConfig(java.util.Iterator bdIt, java.lang.String filename)
          Client config generation for ajbjar file
 void genClientConfig(ServiceRef[] servRefs, java.lang.String filename)
          Client config generation for war file
protected  void genClientFiles(ServiceRef[] servRefs)
           
 void genEndpointConfig(WSDeploymentDesc dd, java.lang.String filename)
          Generate endpoint configuration files for the set of ServiceDesc included in WSDeploymentDesc.
 java.lang.String getDefaultMapping()
           
 java.lang.String getEngineWebApp()
          Return the webservices engine class name.
 java.lang.Object getOption(java.lang.String name)
          Get an option, return the option value or null if the option isn't set.
 java.lang.Object getOption(java.lang.String name, java.lang.Object defolt)
          Get an option, return the option value or default if the option isn't set.
protected  boolean isDebug()
          return true if debug mode is set.
protected  boolean isNoConfig()
          return true if noConfig mode is set.
protected  boolean isVerbose()
          return true if verbose mode is set.
 void setOption(java.lang.String name, java.lang.Object value)
          Set an option for generation.
protected  void trace(java.lang.String msg)
          Display the specified message only if verbose.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.objectweb.util.monolog.api.Logger logger
WsGen logger


genDir

protected java.io.File genDir
The output directory where files are generated


javaHomeBin

protected java.lang.String javaHomeBin
The $JAVA_HOME/bin directory


cp

protected java.lang.String cp
The classpath to use with command lines


filename

protected java.lang.String filename
The complete name of the file processed

Constructor Detail

AbsConfigGenerator

public AbsConfigGenerator()
Constructor : creates a AbsConfigGenerator object.

Method Detail

getDefaultMapping

public java.lang.String getDefaultMapping()
Specified by:
getDefaultMapping in interface ConfigGenerator

genEndpointConfig

public void genEndpointConfig(WSDeploymentDesc dd,
                              java.lang.String filename)
                       throws WsGenException
Description copied from interface: ConfigGenerator
Generate endpoint configuration files for the set of ServiceDesc included in WSDeploymentDesc. Common method for all Web Services implementation (Glue/Axis).

Specified by:
genEndpointConfig in interface ConfigGenerator
Parameters:
dd - The DeploymentDesc to process (image of a webservices.xml)
filename - The war or jar being processed
Throws:
WsGenException - if generation fails

addSrcs

protected void addSrcs(java.io.File dir,
                       java.util.Vector srcs)
                throws WsGenException
Throws:
WsGenException

compileGenDir

protected void compileGenDir()
                      throws WsGenException
Throws:
WsGenException

genClientFiles

protected void genClientFiles(ServiceRef[] servRefs)
                       throws WsGenException
Throws:
WsGenException

genClientConfig

public void genClientConfig(java.util.Iterator bdIt,
                            java.lang.String filename)
                     throws WsGenException
Client config generation for ajbjar file

Specified by:
genClientConfig in interface ConfigGenerator
Parameters:
bdIt - an iterator on a bean desc list
filename - The war or jar being processed
Throws:
WsGenException - if generation fails

genClientConfig

public void genClientConfig(ServiceRef[] servRefs,
                            java.lang.String filename)
                     throws WsGenException
Client config generation for war file

Specified by:
genClientConfig in interface ConfigGenerator
Parameters:
servRefs - The list of ServiceRef to process.
filename - The war or jar being processed
Throws:
WsGenException - if generation fails

destroyFile

protected boolean destroyFile(java.io.File file)
Recursively destroy the given file.

Parameters:
file - the file to destroy.

destroyTempDir

protected void destroyTempDir()
Destroy the temporary directory used for generation.


configureEndpoint

protected void configureEndpoint(WSDeploymentDesc wsdd)
                          throws WsGenException
Configure Endpoint has to be implemented in subClass. hold specific process for endpoint with specific WebService engine. Generate files in the temporary directory genDir. Needs to be overridden in sub classes.

Parameters:
wsdd - the webservices deployment descriptor
Throws:
WsGenException - if generation fails if the method isn't implemented

configureClient

protected void configureClient(ServiceRef sr)
                        throws WsGenException
ConfigureClient has to be implemented in subClass. hold specific process for client with specific WebService engine. Generate files in the temporary directory genDir. Needs to be overridden in sub classes.

Parameters:
sr - The ServiceRef representing the client dependency.
Throws:
WsGenException - if generation fails if the method isn't implemented

getEngineWebApp

public java.lang.String getEngineWebApp()
                                 throws WsGenException
Return the webservices engine class name.

Specified by:
getEngineWebApp in interface ConfigGenerator
Returns:
the webservices engine class name.
Throws:
WsGenException - if the method isn't implemented

trace

protected void trace(java.lang.String msg)
Display the specified message only if verbose.

Parameters:
msg - the message to display

isVerbose

protected boolean isVerbose()
return true if verbose mode is set.

Returns:
true if verbose mode is set.

isDebug

protected boolean isDebug()
return true if debug mode is set.

Returns:
true if debug mode is set.

isNoConfig

protected boolean isNoConfig()
return true if noConfig mode is set.

Returns:
true if noConfig mode is set.

setOption

public void setOption(java.lang.String name,
                      java.lang.Object value)
Set an option for generation.

Specified by:
setOption in interface ConfigGenerator
Parameters:
name - option name
value - option value

getOption

public java.lang.Object getOption(java.lang.String name,
                                  java.lang.Object defolt)
Get an option, return the option value or default if the option isn't set.

Specified by:
getOption in interface ConfigGenerator
Parameters:
name - option name
defolt - default option value
Returns:
the option value or default if the option isn't set.

getOption

public java.lang.Object getOption(java.lang.String name)
Get an option, return the option value or null if the option isn't set.

Specified by:
getOption in interface ConfigGenerator
Parameters:
name - option name
Returns:
the option value or null if the option isn't set.