org.codehaus.xfire.service.object
Class ObjectServiceFactory

java.lang.Object
  extended by org.codehaus.xfire.service.object.ObjectServiceFactory
All Implemented Interfaces:
ServiceFactory
Direct Known Subclasses:
AnnotationServiceFactory, XMLBeansServiceBuilder

public class ObjectServiceFactory
extends java.lang.Object
implements ServiceFactory

Java objects-specific implementation of the ServiceFactory interface.

Author:
Dan Diephouse, Arjen Poutsma

Constructor Summary
ObjectServiceFactory()
          Initializes a new instance of the ObjectServiceFactory.
ObjectServiceFactory(TransportManager transportManager, TypeMappingRegistry registry)
          Initializes a new instance of the ObjectServiceFactory with the given transport manager and type mapping registry.
 
Method Summary
protected  void addOperation(DefaultObjectService service, java.lang.reflect.Method method)
           
 Service create(java.lang.Class clazz)
          Creates a service from the specified class.
 Service create(java.lang.Class clazz, SoapVersion version, java.lang.String style, java.lang.String use)
          Creates a service from the specified class, soap version, style and use.
 Service create(java.lang.Class clazz, java.lang.String name, java.lang.String namespace, SoapVersion version, java.lang.String style, java.lang.String use, java.lang.String encodingStyleURI)
          Creates a service from the specified class and parameters.
 Service create(java.lang.Class clazz, TypeMapping tm, java.net.URL wsdlUrl)
          Create a service from a WSDL file.
protected  java.lang.String getInParameterName(java.lang.reflect.Method method, int paramNumber, boolean doc)
           
protected  java.lang.String getOutParameterName(java.lang.reflect.Method method, boolean doc)
           
protected  void initializeOperations(DefaultObjectService service)
           
protected  void initializeTypeMapping(DefaultObjectService service)
          Creates a type mapping for this class and registers it with the TypeMappingRegistry.
protected  boolean isAsync(java.lang.reflect.Method method)
           
protected  boolean isValidMethod(java.lang.reflect.Method method)
           
protected  java.lang.String makeServiceNameFromClassName(java.lang.Class clazz)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectServiceFactory

public ObjectServiceFactory()
Initializes a new instance of the ObjectServiceFactory.


ObjectServiceFactory

public ObjectServiceFactory(TransportManager transportManager,
                            TypeMappingRegistry registry)
Initializes a new instance of the ObjectServiceFactory with the given transport manager and type mapping registry.

Parameters:
transportManager - the transport manager
registry - the type mapping registry
Method Detail

create

public Service create(java.lang.Class clazz,
                      TypeMapping tm,
                      java.net.URL wsdlUrl)
               throws java.lang.Exception
Description copied from interface: ServiceFactory
Create a service from a WSDL file. NOTE: This probably doesn't work yet.

Specified by:
create in interface ServiceFactory
Parameters:
wsdlUrl -
clazz - The service class for the wsdl.
Returns:
Throws:
java.lang.Exception

create

public Service create(java.lang.Class clazz)
Creates a service from the specified class. The returned service will have a name based on the class name, a namespace based on the class package, soap version 1.1, wrapped style, and literal use.

Specified by:
create in interface ServiceFactory
Parameters:
clazz - The service class used to populate the operations and parameters.
Returns:
The service.

create

public Service create(java.lang.Class clazz,
                      SoapVersion version,
                      java.lang.String style,
                      java.lang.String use)
Creates a service from the specified class, soap version, style and use. The returned service will have a name based on the class name, and a namespace based on the class package.

Some parameters can be null, and will be replaced with sensible defaults if so. See the specific parameters for more info.

Specified by:
create in interface ServiceFactory
Parameters:
clazz - The service class used to populate the operations and parameters.
version - The soap version. If null, Soap11 will be used.
style - The service style. If null, SoapConstants.STYLE_WRAPPED will be used.
use - The service use. If null, SoapConstants.USE_LITERAL will be used.
Returns:
The service.
See Also:
SoapConstants, Soap11, Soap12, SoapVersion

makeServiceNameFromClassName

protected java.lang.String makeServiceNameFromClassName(java.lang.Class clazz)

create

public Service create(java.lang.Class clazz,
                      java.lang.String name,
                      java.lang.String namespace,
                      SoapVersion version,
                      java.lang.String style,
                      java.lang.String use,
                      java.lang.String encodingStyleURI)
Creates a service from the specified class and parameters.

Most parameters can be null, and will be replaced with sensible defaults if so. See the specific parameters for more info.

Specified by:
create in interface ServiceFactory
Parameters:
clazz - The service class used to populate the operations and parameters.
name - The name of the service. If null, a name will be generated from the class name.
namespace - The default namespace of the service. If null, a namespace will be generated from the class package.
version - The soap version. If null, Soap11 will be used.
style - The service style. If null, SoapConstants.STYLE_WRAPPED will be used.
use - The service use. If null, SoapConstants.USE_LITERAL will be used.
encodingStyleURI - The encoding style to use.
Returns:
The service.
See Also:
SoapConstants, Soap11, Soap12, SoapVersion

initializeOperations

protected void initializeOperations(DefaultObjectService service)

isValidMethod

protected boolean isValidMethod(java.lang.reflect.Method method)

addOperation

protected void addOperation(DefaultObjectService service,
                            java.lang.reflect.Method method)

isAsync

protected boolean isAsync(java.lang.reflect.Method method)

getInParameterName

protected java.lang.String getInParameterName(java.lang.reflect.Method method,
                                              int paramNumber,
                                              boolean doc)

getOutParameterName

protected java.lang.String getOutParameterName(java.lang.reflect.Method method,
                                               boolean doc)

initializeTypeMapping

protected void initializeTypeMapping(DefaultObjectService service)
Creates a type mapping for this class and registers it with the TypeMappingRegistry. This needs to be called before initializeOperations().