org.objectweb.jonas_ws.wsgen
Class WsGen

java.lang.Object
  extended byorg.objectweb.jonas_ws.wsgen.WsGen
Direct Known Subclasses:
EarWsGen, EjbJarWsGen, WebAppWsGen

public abstract class WsGen
extends java.lang.Object

Author:
Xavier Delplanque & Guillaume Sauthier

Field Summary
protected  ConfigGenerator cg
          The Generator used for webservices classes and configuration files creation
protected  boolean debug
          Is the command is on debug mode ?
protected  java.lang.String fileInputName
          input file name
protected  boolean isHelp
          Is the command used for help message ?
protected  boolean keepGenerated
           
protected static org.objectweb.util.monolog.api.Logger logger
          The logger to use
protected  java.lang.String outputdir
          Name of the directory where to place the generated file
protected  java.io.File tmpDir
          temp directory for archive creation
protected  boolean verbose
          Is the command on verbose ?
 
Constructor Summary
protected WsGen(java.lang.String outputDir, ConfigGenerator cGen, boolean isVerbose, boolean isDebug, java.lang.String filename)
          Constructor : creates a WsGen object.
 
Method Summary
abstract  void configure()
          Abstract method for configuration of the Object.
static java.io.File createTempDir()
          Create a cleaned temporary directory.
static void debug(java.lang.String msg)
          Display the specified message.
protected static boolean destroyFile(java.io.File file)
          Recursively destroy the given file/directory.
static void error(java.lang.String msg)
          Display the specified error message.
static void fatalError(java.lang.Exception e)
          Display the specified error message and exits with an EXIT_FAILURE status.
static void fatalError(java.lang.String msg)
          Display the specified error message and exits with an EXIT_FAILURE status.
static java.net.URL getExplodedJar(java.lang.String fileInputName)
          Unpack the jar in a temporary directory.
static void info(java.lang.String msg)
          Display the specified message.
static void main(java.lang.String[] args)
          JOnAS Method
protected  void removeDir(java.io.File dir)
           
protected  void removeTempDirectories()
           
static void usage()
          Display the usage
static void warning(java.lang.String msg)
          Display the specified warning message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cg

protected ConfigGenerator cg
The Generator used for webservices classes and configuration files creation


keepGenerated

protected boolean keepGenerated

tmpDir

protected java.io.File tmpDir
temp directory for archive creation


verbose

protected boolean verbose
Is the command on verbose ?


debug

protected boolean debug
Is the command is on debug mode ?


isHelp

protected boolean isHelp
Is the command used for help message ?


outputdir

protected java.lang.String outputdir
Name of the directory where to place the generated file


fileInputName

protected java.lang.String fileInputName
input file name


logger

protected static org.objectweb.util.monolog.api.Logger logger
The logger to use

Constructor Detail

WsGen

protected WsGen(java.lang.String outputDir,
                ConfigGenerator cGen,
                boolean isVerbose,
                boolean isDebug,
                java.lang.String filename)
         throws WsGenException
Constructor : creates a WsGen object. Generate source files for client and configuration files for both endpoints and clients (if needed).

Parameters:
outputDir - the directory where to store generated files
cGen - The ConfigGenerator to use (Axis/Glue/...)
isVerbose - Indicate if command is in verbose mode
isDebug - Indicate if command is in debug mode
filename - file to process.
Method Detail

removeTempDirectories

protected void removeTempDirectories()

main

public static void main(java.lang.String[] args)
JOnAS Method


usage

public static void usage()
Display the usage


info

public static void info(java.lang.String msg)
Display the specified message.

Parameters:
msg - the message to display

debug

public static void debug(java.lang.String msg)
Display the specified message.

Parameters:
msg - the message to display

warning

public static void warning(java.lang.String msg)
Display the specified warning message.

Parameters:
msg - the warning message to display

error

public static void error(java.lang.String msg)
Display the specified error message.

Parameters:
msg - the error message to display

fatalError

public static void fatalError(java.lang.String msg)
Display the specified error message and exits with an EXIT_FAILURE status.

Parameters:
msg - the error message to display

fatalError

public static void fatalError(java.lang.Exception e)
Display the specified error message and exits with an EXIT_FAILURE status.

Parameters:
e - the error to display

createTempDir

public static java.io.File createTempDir()
                                  throws java.io.IOException
Create a cleaned temporary directory.

Returns:
the temp directory file
Throws:
java.io.IOException - if a temp directory cannot be created.

getExplodedJar

public static java.net.URL getExplodedJar(java.lang.String fileInputName)
Unpack the jar in a temporary directory.

Returns:
the output directory URL

removeDir

protected void removeDir(java.io.File dir)

destroyFile

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

Parameters:
file - the file to destroy.
Returns:
true if deletion OK, otherwise false.

configure

public abstract void configure()
                        throws WsGenException
Abstract method for configuration of the Object.

Throws:
WsGenException - when configuration fails.