it.imolinfo.jbi4corba.webservice.generator
Class ConsumerServiceClassesGenerator

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

public class ConsumerServiceClassesGenerator
extends Object

This class generates (at deploy time) the code used by the jbi4corba in 'consumer' mode (at run time).


Constructor Summary
ConsumerServiceClassesGenerator()
          Default constructor.
 
Method Summary
 List<String> copyIDLs(String classesDirName, String wsdlDirName, String remoteClassName)
          Copy all the IDLs with care about (sub)path.
protected  WsdlInformation findOperationByMEP(org.apache.cxf.service.model.ServiceInfo serviceInfo, QName portType, WsdlInformation wi)
          This method extracts asychronous and synchronous operation and store them in the WsdlInformation object.
 ServerCorbaClassesHolder generateConsumerCorbaClassesHolder(String workdir, List<String> jars, List<ClientCorbaClassesHolder> classes, ProviderServiceClassesGenerator serviceGenerator, JbiServiceDescriptor jbidesc)
          This method is used to generate all the consumer code starting from the classes already generated with provider class generation API.
 ServerCorbaClassesHolder generateConsumerServiceClasses(String wsdlStringUrl, String workdir, String libDirName, JbiServiceDescriptor jbiServiceDescriptor)
          This method is used to generate all the consumer code starting from the WSDL of the Endpoint to consume.
 ServerCorbaClassesHolder generateConsumerServiceClassesDirect(String wsdlStringUrl, String workdir, List<String> jars, JbiServiceDescriptor jbiServiceDescriptor)
          This method is used to generate all the consumer code starting from the WSDL of the Endpoint to consume.
 ServerCorbaClassesHolder generateConsumerServiceClassesDirectFromIDL(File wsdlDirFile, List<String> jars, JbiServiceDescriptor jbiServiceDescriptor, WsdlInformation wsdlInformation)
          This method is used to generate all the consumer code starting from the IDL found inside the WSDL of the Endpoint to consume.
 ServerCorbaClassesHolder generateConsumerServiceClassesDirectFromWSDL(File wsdlDirFile, List<String> jars)
          This method is used to generate all the consumer code starting from the WSDL of the Endpoint to consume.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsumerServiceClassesGenerator

public ConsumerServiceClassesGenerator()
Default constructor.

Method Detail

generateConsumerServiceClasses

public ServerCorbaClassesHolder generateConsumerServiceClasses(String wsdlStringUrl,
                                                               String workdir,
                                                               String libDirName,
                                                               JbiServiceDescriptor jbiServiceDescriptor)
                                                        throws ClassGenerationException
This method is used to generate all the consumer code starting from the WSDL of the Endpoint to consume. Steps: 1) code generation: wsdl to java 2) compile the new source 3) bytecode manipultion: the classes must be modified to use rmic 4) compile with rmic to generate the corba classes 5) add the getter, setter and serialVersionUID to the class 6) save all the objects in the ServerCorbaClassesHolder

Parameters:
wsdlStringUrl - Where the WSDL is located.
workdir - Where the method can generate the code.
jars - The jar needed at compile time and run time.
All - the references to the object generated.
Throws:
ClassGenerationException - When the code cannot be generated.

generateConsumerServiceClassesDirect

public ServerCorbaClassesHolder generateConsumerServiceClassesDirect(String wsdlStringUrl,
                                                                     String workdir,
                                                                     List<String> jars,
                                                                     JbiServiceDescriptor jbiServiceDescriptor)
                                                              throws ClassGenerationException
This method is used to generate all the consumer code starting from the WSDL of the Endpoint to consume. The consumer code can be generated starting from IDL in case it is included inside WSDL (idl element) Steps: 1) copy wsdl from url to local directory 2) check if IDL content is found inside WSDL 3) call the proper method to generate consumer classes

Parameters:
wsdlStringUrl - Where the WSDL is located.
workdir - Where the method can generate the code.
jars - The jar needed at compile time and run time.
All - the references to the object generated.
Throws:
ClassGenerationException - When the code cannot be generated.

generateConsumerServiceClassesDirectFromWSDL

public ServerCorbaClassesHolder generateConsumerServiceClassesDirectFromWSDL(File wsdlDirFile,
                                                                             List<String> jars)
                                                                      throws ClassGenerationException
This method is used to generate all the consumer code starting from the WSDL of the Endpoint to consume. Steps: 1) code generation: wsdl to java 2) compile the new source 3) bytecode manipultion: the classes must be modified to use rmic 4) compile with rmic to generate the corba classes 5) add the getter, setter and serialVersionUID to the class 6) save all the objects in the ServerCorbaClassesHolder

Parameters:
wsdlDirFile - Where the WSDL is located.
workdir - Where the method can generate the code.
jars - The jar needed at compile time and run time.
All - the references to the object generated.
Throws:
ClassGenerationException - When the code cannot be generated.

generateConsumerServiceClassesDirectFromIDL

public ServerCorbaClassesHolder generateConsumerServiceClassesDirectFromIDL(File wsdlDirFile,
                                                                            List<String> jars,
                                                                            JbiServiceDescriptor jbiServiceDescriptor,
                                                                            WsdlInformation wsdlInformation)
                                                                     throws ClassGenerationException
This method is used to generate all the consumer code starting from the IDL found inside the WSDL of the Endpoint to consume.

Parameters:
wsdlDirFile - Dir where the WSDL is located.
idlContent - Content of the idl file extracted previously from WSDL
workdir - Where the method can generate the code.
jars - The jar needed at compile time and run time.
All - the references to the object generated.
Throws:
ClassGenerationException - When the code cannot be generated.

generateConsumerCorbaClassesHolder

public ServerCorbaClassesHolder generateConsumerCorbaClassesHolder(String workdir,
                                                                   List<String> jars,
                                                                   List<ClientCorbaClassesHolder> classes,
                                                                   ProviderServiceClassesGenerator serviceGenerator,
                                                                   JbiServiceDescriptor jbidesc)
                                                            throws ClassGenerationException
This method is used to generate all the consumer code starting from the classes already generated with provider class generation API.

Parameters:
serviceGenerator - ProviderServiceClassesGenerator
classes - ClientCorbaClassesHolder
workdir - Where the method can generate the code.
jars - The jar needed at compile time and run time.
Returns:
All the references to the object generated.
Throws:
ClassGenerationException - When the code cannot be generated.

copyIDLs

public List<String> copyIDLs(String classesDirName,
                             String wsdlDirName,
                             String remoteClassName)
                      throws ClassGenerationException
Copy all the IDLs with care about (sub)path.

Parameters:
classesDirName - The directory where we can find the IDL files.
wsdlDirName - The directory where we copy he IDL files.
remoteClassName - The remote class name.
Returns:
The list of the IDL files in classesDirName.
Throws:
ClassGenerationException - The class generation exception

findOperationByMEP

protected WsdlInformation findOperationByMEP(org.apache.cxf.service.model.ServiceInfo serviceInfo,
                                             QName portType,
                                             WsdlInformation wi)
This method extracts asychronous and synchronous operation and store them in the WsdlInformation object.

Parameters:
service - The service to inspect.
portType - The portType associated to the operations.
wi - The WsdlInformation used.
Returns:
The WsdlInformation updated.


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