it.imolinfo.jbi4corba.webservice.generator
Class ProviderServiceClassesGenerator

java.lang.Object
  extended by it.imolinfo.jbi4corba.webservice.generator.ProviderServiceClassesGenerator

public class ProviderServiceClassesGenerator
extends Object

This class provides the 'IDL to WSDL' code generation.


Field Summary
protected static CodeGenerationProperties codeGenerationProperties
          The properties used to control the behavior during the code generation.
 
Constructor Summary
ProviderServiceClassesGenerator()
          Empty Constructor.
ProviderServiceClassesGenerator(CodeGenerationProperties prop)
          Empty Constructor.
 
Method Summary
protected  void addEnumClass(String workdirsrc)
           
 String createsPackageInfo(String namespace, String packagePath, String dirClasses)
          Creates the pacakge-info.java file for the correct jaxb mapping.
 List<ClientCorbaClassesHolder> generateProviderServiceClasses(JbiServiceDescriptor serviceDescriptor, String workdir, List<String> jars, String portTypeName)
           
 List<ClientCorbaClassesHolder> generateProviderServiceClasses(JbiServiceDescriptor serviceDescriptor, String workdir, String libDirName, String portTypeName)
          This class is used to generate a service from a IDL file.
 List<ClientCorbaClassesHolder> generateProviderServiceClasses(List<JbiServiceDescriptor> serviceDescriptorList, String workdir, List<String> jars, List<String> portTypeName)
          This class is used to generate a service from a IDL file.
 List<ClientCorbaClassesHolder> generateProviderServiceClasses(List<JbiServiceDescriptor> serviceDescriptorList, String workdir, String libDirName, List<String> portTypeName)
          This class is used to generate a service from a IDL file.
 ChildFirstClassLoader getOriginalClassLoader()
           
 URLClassLoader getUrlClassLoader()
           
protected  boolean setOnewayPropertyOnTheMethodSignature(String onewayMethod, List<MethodSignature> methodSignatureList)
          This method searches the right signature and set to true the 'oneway' property.
protected  void updateOnewayMethodSignature(Map<String,List<String>> onewayMap, Map<String,List<MethodSignature>> mapOperationsMethod)
          This method is used to update the 'oneway' property of the method signature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

codeGenerationProperties

protected static CodeGenerationProperties codeGenerationProperties
The properties used to control the behavior during the code generation.

Constructor Detail

ProviderServiceClassesGenerator

public ProviderServiceClassesGenerator()
Empty Constructor.


ProviderServiceClassesGenerator

public ProviderServiceClassesGenerator(CodeGenerationProperties prop)
Empty Constructor.

Parameters:
prop - This object contains all the configuration to perform the activities.
Method Detail

generateProviderServiceClasses

public List<ClientCorbaClassesHolder> generateProviderServiceClasses(JbiServiceDescriptor serviceDescriptor,
                                                                     String workdir,
                                                                     String libDirName,
                                                                     String portTypeName)
                                                              throws ClassGenerationException
This class is used to generate a service from a IDL file. Algorithm:
- idl to java
- provide value type implementation inspecting 'DefaultFactory' files.
- compile java files.
- bytecode manipulation: all the classes used in the 'xxxOperations.class' is visited. Where there is a non private attribute a getter/setter pair method will be added and all the array will be initialized to avoid NullPointerException.
- return a list of holder classes.

Parameters:
serviceDescriptor - Used to estract 'idlFileNameDirectory' and 'idlFileName'.
workdir - The java source files and compiled files are placed in 'workdir/src' and 'workdir/classes'
libDirName - The directory where the method looks for the jars.
Returns:
The list of 'holder' classes containing the reference to corba object, helper and operations classes.
Throws:
ClassGenerationException - The Class Generation Exception

generateProviderServiceClasses

public List<ClientCorbaClassesHolder> generateProviderServiceClasses(JbiServiceDescriptor serviceDescriptor,
                                                                     String workdir,
                                                                     List<String> jars,
                                                                     String portTypeName)
                                                              throws ClassGenerationException
Throws:
ClassGenerationException

generateProviderServiceClasses

public List<ClientCorbaClassesHolder> generateProviderServiceClasses(List<JbiServiceDescriptor> serviceDescriptorList,
                                                                     String workdir,
                                                                     String libDirName,
                                                                     List<String> portTypeName)
                                                              throws ClassGenerationException
This class is used to generate a service from a IDL file. Algorithm:
- idl to java
- provide value type implementation inspecting 'DefaultFactory' files.
- compile java files.
- bytecode manipulation: all the classes used in the 'xxxOperations.class' is visited. Where there is a non private attribute a getter/setter pair method will be added and all the array will be initialized to avoid NullPointerException.
- return a list of holder classes.

Parameters:
serviceDescriptor - Used to estract 'idlFileNameDirectory' and 'idlFileName'.
workdir - The java source files and compiled files are placed in 'workdir/src' and 'workdir/classes'
libDirName - The directory where the method looks for the jars.
Returns:
The list of 'holder' classes containing the reference to corba object, helper and operations classes.
Throws:
ClassGenerationException - The Class Generation Exception

generateProviderServiceClasses

public List<ClientCorbaClassesHolder> generateProviderServiceClasses(List<JbiServiceDescriptor> serviceDescriptorList,
                                                                     String workdir,
                                                                     List<String> jars,
                                                                     List<String> portTypeName)
                                                              throws ClassGenerationException
This class is used to generate a service from a IDL file. Algorithm:
- idl to java
- provide value type implementation inspecting 'DefaultFactory' files.
- compile java files.
- bytecode manipulation: all the classes used in the 'xxxOperations.class' is visited. Where there is a non private attribute a getter/setter pair method will be added and all the array will be initialized to avoid NullPointerException.
- return a list of holder classes.

Parameters:
serviceDescriptor - Used to estract 'idlFileNameDirectory' and 'idlFileName'.
workdir - The java source files and compiled files are placed in 'workdir/src' and 'workdir/classes'
jars - The list of jars used to generate the classes.
portTypeName - the porttype name (for the wsdl annotations). Can be null (in this case, the class name is used).
Returns:
The list of 'holder' classes containing the reference to corba object, helper and operations classes.
Throws:
ClassGenerationException - The class generation exception The portTypeName is necessary for the generation of the classes

createsPackageInfo

public String createsPackageInfo(String namespace,
                                 String packagePath,
                                 String dirClasses)
                          throws ClassGenerationException
Creates the pacakge-info.java file for the correct jaxb mapping.

Parameters:
namespace -
packagePath -
dirClasses -
Throws:
ClassGenerationException

updateOnewayMethodSignature

protected void updateOnewayMethodSignature(Map<String,List<String>> onewayMap,
                                           Map<String,List<MethodSignature>> mapOperationsMethod)
This method is used to update the 'oneway' property of the method signature.

Parameters:
onewayMap - A map where the key is a full java class name and the value is a list of oneway methods.
mapOperationsMethod - A map where the key is a full java class name and the value is a list method signatures.

setOnewayPropertyOnTheMethodSignature

protected boolean setOnewayPropertyOnTheMethodSignature(String onewayMethod,
                                                        List<MethodSignature> methodSignatureList)
This method searches the right signature and set to true the 'oneway' property.

Parameters:
onewayMethod - The name of the oneway method.
methodSignatureList - The list of the method's signature to inspect
Returns:
false when the oneway method is not found in the list.

getUrlClassLoader

public URLClassLoader getUrlClassLoader()
Returns:
the return

getOriginalClassLoader

public ChildFirstClassLoader getOriginalClassLoader()
Returns:
the return

addEnumClass

protected void addEnumClass(String workdirsrc)
                     throws ClassGenerationException
Parameters:
workdirsrc - The work dir src
Throws:
ClassGenerationException - The class generation exception


Copyright © 2005-2010 Imola Informatica. All Rights Reserved.