it.imolinfo.jbi4ejb.webservice.generator
Class EJBUtils

java.lang.Object
  extended by it.imolinfo.jbi4ejb.webservice.generator.EJBUtils

public final class EJBUtils
extends java.lang.Object

The Class EJBUtils. This class contains the helper method added for the jbi4Ejb project. The helper method in the Utils class are from the jbi4corba project

Author:
Marco Piraccini

Method Summary
static void copyDirectory(java.io.File sourceLocation, java.io.File targetLocation)
          Copy directory.
static void createStub(java.lang.String classesDir, java.lang.String className, java.util.List<java.lang.String> jarFilesName)
          Creates the stub.
static java.io.File createTempDir()
          Creates a temporary directory.
static void removeEJBRemoteInterface(java.lang.String interfaceClassName, java.lang.String classesDirName)
          Removes the implements java.rmi.Remote and throws java.rmi.RemoteException clauses, using recursino (see EJB-53).
static void tweakRemoteInterfaceGeneratedFromWSDL(java.lang.String portTypeClassName, java.lang.String classesDirName)
          Modify the interface generated from the WSDL, adding the correct application exceptions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createTempDir

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

Returns:
the created directory or null if the creation has failed even though a file has been created.
Throws:
java.io.IOException - if a file could not be created.

createStub

public static void createStub(java.lang.String classesDir,
                              java.lang.String className,
                              java.util.List<java.lang.String> jarFilesName)
                       throws EJBDeployException
Creates the stub.

Parameters:
classesDir - The directory containing the classes
className - The class name to create the stub
jarFilesName - The jar lists
Throws:
EJBDeployException - If some problem occurs

tweakRemoteInterfaceGeneratedFromWSDL

public static void tweakRemoteInterfaceGeneratedFromWSDL(java.lang.String portTypeClassName,
                                                         java.lang.String classesDirName)
                                                  throws ClassGenerationException
Modify the interface generated from the WSDL, adding the correct application exceptions. Retrieve the Applicative Exceptions, wrapped by a org.codehaus.xfire.fault.FaultInfoException in the WSDL-generated interface. Adds the correct exception to the throws clause of the interface, with the java.rmi.RemoteException The Exception classes are subclassed form java.lang.Exception

Parameters:
portTypeClassName - The port type class name
classesDirName - The classes directory tweakRemoteInterfaceGeneratedFromWSDL
Throws:
ClassGenerationException - If some problem occurs

removeEJBRemoteInterface

public static void removeEJBRemoteInterface(java.lang.String interfaceClassName,
                                            java.lang.String classesDirName)
                                     throws ClassGenerationException
Removes the implements java.rmi.Remote and throws java.rmi.RemoteException clauses, using recursino (see EJB-53).

Parameters:
interfaceClassName - The port type class name
classesDirName - The classes directory where to save the file tweakRemoteInterfaceGeneratedFromWSDL
Throws:
ClassGenerationException - If some problem occurs

copyDirectory

public static void copyDirectory(java.io.File sourceLocation,
                                 java.io.File targetLocation)
                          throws java.io.IOException
Copy directory.

Parameters:
sourceLocation - The source directory
targetLocation - The target directory
Throws:
java.io.IOException - If some problem occurs in copying directory


Copyright © 2007-2008 Imola Informatica. All Rights Reserved.