it.imolinfo.jbi4corba.jbi.cxf
Class CXFUtils

java.lang.Object
  extended by it.imolinfo.jbi4corba.jbi.cxf.CXFUtils

public final class CXFUtils
extends Object

Utility methods to manage CXF classes.

Author:
Marco Piraccinis

Constructor Summary
CXFUtils()
           
 
Method Summary
protected static org.apache.cxf.Bus createBus()
          Creates the CXF "Bus".
static Document getAbstractWSDLDocument(javax.wsdl.Definition def)
          Gets the Abstract WSDL Documents starting from Definition
static Document getAbstractWSDLDocument(org.apache.cxf.service.Service service)
          Gets the Abstract WSDL Documents starting from Service
static String getBindingStyle(org.apache.cxf.service.model.BindingOperationInfo bio)
          Return the correct binding style for the binding, Document o RPC.
static org.apache.cxf.Bus getBus()
          The Bus can be null...
static org.apache.cxf.endpoint.Endpoint getEndpoint(org.apache.cxf.service.Service service, org.apache.cxf.service.model.EndpointInfo ei)
          Gets the endpoint from service endpoint.
static org.apache.cxf.service.model.EndpointInfo getEndpointInfo(org.apache.cxf.service.Service service)
          Gets the EndpointInfo for the FIRST (should be the only...) Endpoint.
static QName getInterfaceNameFromFirstEndpoint(org.apache.cxf.service.Service service)
          Gets THE FIRST ENDPOINT interface name.
static org.apache.cxf.jaxws.JaxWsClientFactoryBean getJaxWsClientFactoryBean()
          Creates the CXF Service factory.
static String getParameterStyle(org.apache.cxf.service.model.BindingOperationInfo bio)
          Return the correct parameter style for the binding, Wrapped or Bare (notice that the WSDL is always Document/literal).
static javax.wsdl.Definition getWSDLDefinition(org.apache.cxf.service.Service service)
          Gets the WSDL definition.
protected static Document getWSDLDocument(org.apache.cxf.service.Service service)
          Gets the WSDL document.
static void populateFaultInterceptors(org.apache.cxf.phase.PhaseInterceptorChain faultInterceptorChain, String parameterStyle, String bindingStyle)
          This method creates the CXF OUT Interceptors chain and process the message.
static void populateInInterceptorsForConsumer(org.apache.cxf.phase.PhaseInterceptorChain inInterceptorChain, String parameterStyle, String bindingStyle, boolean isFromIDL)
          This method creates the CXF OUT Interceptors chain and process the message.
static void populateInInterceptorsForProvider(org.apache.cxf.phase.PhaseInterceptorChain inInterceptorChain, String parameterStyle, String bindingStyle)
          This method creates the CXF Interceptors chain and process the message.
static void populateOutInterceptors(org.apache.cxf.phase.PhaseInterceptorChain outInterceptorChain, String parameterStyle, String bindingStyle, boolean isProviderOrConsumerFromIDL)
          This method creates the CXF OUT Interceptors chain and process the message.
static org.apache.cxf.Bus setupBus()
           
static void writeDefinitionOnOutputStream(org.apache.cxf.service.Service service, OutputStream out)
          Writes out the service definition on the output stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CXFUtils

public CXFUtils()
Method Detail

setupBus

public static org.apache.cxf.Bus setupBus()
                                   throws org.apache.cxf.BusException
Throws:
org.apache.cxf.BusException

getBus

public static org.apache.cxf.Bus getBus()
The Bus can be null...

Returns:
Throws:
org.apache.cxf.BusException

createBus

protected static org.apache.cxf.Bus createBus()
                                       throws org.apache.cxf.BusException
Creates the CXF "Bus".

Throws:
org.apache.cxf.BusException

getJaxWsClientFactoryBean

public static org.apache.cxf.jaxws.JaxWsClientFactoryBean getJaxWsClientFactoryBean()
                                                                             throws Jbi4CorbaException
Creates the CXF Service factory.

Throws:
Jbi4CorbaException

getWSDLDocument

protected static Document getWSDLDocument(org.apache.cxf.service.Service service)
                                   throws javax.wsdl.WSDLException
Gets the WSDL document.

Parameters:
service -
Returns:
the WSDL document
Throws:
javax.wsdl.WSDLException

getWSDLDefinition

public static javax.wsdl.Definition getWSDLDefinition(org.apache.cxf.service.Service service)
                                               throws javax.wsdl.WSDLException
Gets the WSDL definition.

Parameters:
service -
Returns:
the WSDL definition
Throws:
javax.wsdl.WSDLException

getAbstractWSDLDocument

public static Document getAbstractWSDLDocument(javax.wsdl.Definition def)
                                        throws javax.wsdl.WSDLException
Gets the Abstract WSDL Documents starting from Definition

Parameters:
def -
Returns:
the WSDL Document
Throws:
javax.wsdl.WSDLException

getAbstractWSDLDocument

public static Document getAbstractWSDLDocument(org.apache.cxf.service.Service service)
                                        throws javax.wsdl.WSDLException
Gets the Abstract WSDL Documents starting from Service

Parameters:
service -
Returns:
the WSDL Document
Throws:
javax.wsdl.WSDLException

writeDefinitionOnOutputStream

public static void writeDefinitionOnOutputStream(org.apache.cxf.service.Service service,
                                                 OutputStream out)
                                          throws javax.wsdl.WSDLException
Writes out the service definition on the output stream

Parameters:
out -
Throws:
javax.wsdl.WSDLException

getInterfaceNameFromFirstEndpoint

public static QName getInterfaceNameFromFirstEndpoint(org.apache.cxf.service.Service service)
Gets THE FIRST ENDPOINT interface name.

Parameters:
service -
Returns:

getEndpointInfo

public static org.apache.cxf.service.model.EndpointInfo getEndpointInfo(org.apache.cxf.service.Service service)
                                                                 throws IOException
Gets the EndpointInfo for the FIRST (should be the only...) Endpoint.

Parameters:
service -
Returns:
Throws:
IOException

getEndpoint

public static org.apache.cxf.endpoint.Endpoint getEndpoint(org.apache.cxf.service.Service service,
                                                           org.apache.cxf.service.model.EndpointInfo ei)
Gets the endpoint from service endpoint.


getBindingStyle

public static String getBindingStyle(org.apache.cxf.service.model.BindingOperationInfo bio)
Return the correct binding style for the binding, Document o RPC. We don'thave SOAP binding extensions, so we have to calculate that from the message part. See Section 7 of the SOAP 1.1 specification. (notice that the WSDL is always Document/literal).

Parameters:
bio -
Returns:
SoapBindingConstants.PARAMETER_STYLE_WRAPPED or SoapBindingConstants.PARAMETER_STYLE_BARE

populateOutInterceptors

public static void populateOutInterceptors(org.apache.cxf.phase.PhaseInterceptorChain outInterceptorChain,
                                           String parameterStyle,
                                           String bindingStyle,
                                           boolean isProviderOrConsumerFromIDL)
This method creates the CXF OUT Interceptors chain and process the message.

Parameters:
parameterStyle -
bindingStyle -
isProviderOrConsumerFromIDL -

populateFaultInterceptors

public static void populateFaultInterceptors(org.apache.cxf.phase.PhaseInterceptorChain faultInterceptorChain,
                                             String parameterStyle,
                                             String bindingStyle)
This method creates the CXF OUT Interceptors chain and process the message.

Parameters:
parameterStyle -
message -

populateInInterceptorsForConsumer

public static void populateInInterceptorsForConsumer(org.apache.cxf.phase.PhaseInterceptorChain inInterceptorChain,
                                                     String parameterStyle,
                                                     String bindingStyle,
                                                     boolean isFromIDL)
This method creates the CXF OUT Interceptors chain and process the message. The interceptor order is important! First the Stream is created, than the message is unwrapped and then converted into objects. Notice that with a custom binding, we could fix the interceptor execution order statically

Parameters:
parameterStyle -
bindingStyle -
message -

populateInInterceptorsForProvider

public static void populateInInterceptorsForProvider(org.apache.cxf.phase.PhaseInterceptorChain inInterceptorChain,
                                                     String parameterStyle,
                                                     String bindingStyle)
This method creates the CXF Interceptors chain and process the message.

Parameters:
parameterStyle -
message -

getParameterStyle

public static String getParameterStyle(org.apache.cxf.service.model.BindingOperationInfo bio)
Return the correct parameter style for the binding, Wrapped or Bare (notice that the WSDL is always Document/literal).

Parameters:
bio -
Returns:
SoapBindingConstants.PARAMETER_STYLE_WRAPPED or SoapBindingConstants.PARAMETER_STYLE_BARE


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