org.codehaus.xfire.service.binding
Class ObjectServiceFactory

java.lang.Object
  extended by org.codehaus.xfire.service.binding.ObjectServiceFactory
All Implemented Interfaces:
ServiceFactory
Direct Known Subclasses:
AnnotationServiceFactory, JaxbServiceFactory, PicoObjectServiceFactory, XmlBeansServiceFactory

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)
           
ObjectServiceFactory(TransportManager transportManager, BindingProvider provider)
          Initializes a new instance of the ObjectServiceFactory with the given transport manager and type mapping registry.
 
Method Summary
 void addIgnoredMethods(java.lang.String className)
          Ignore the specified class' declared methods.
protected  void addOperation(Service endpoint, java.lang.reflect.Method method)
           
 Service create(java.lang.Class clazz)
          Creates a service from the specified class.
 Service create(java.lang.Class clazz, java.util.Map properties)
          Creates a service from the specified class.
 Service create(java.lang.Class clazz, java.lang.String name, java.lang.String namespace, java.util.Map properties)
          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.util.Map properties)
           
 Service create(java.lang.Class clazz, java.net.URL wsdlUrl)
          Create a service from a WSDL file.
protected  java.lang.String getAction(OperationInfo op)
           
 BindingProvider getBindingProvider()
           
protected  javax.xml.namespace.QName getInParameterName(Service endpoint, OperationInfo op, java.lang.reflect.Method method, int paramNumber, boolean doc)
           
protected  java.lang.String getMEP(java.lang.reflect.Method method)
           
protected  java.lang.String getOperationName(ServiceInfo service, java.lang.reflect.Method method)
          Creates a name for the operation from the method name.
protected  javax.xml.namespace.QName getOutParameterName(Service endpoint, OperationInfo op, java.lang.reflect.Method method, boolean doc)
           
 SoapVersion getSoapVersion()
           
 java.lang.String getStyle()
           
 TransportManager getTransportManager()
           
 java.lang.String getUse()
           
 WSDLBuilderFactory getWsdlBuilderFactory()
           
protected  void initializeOperations(Service endpoint)
           
protected  boolean isAsync(java.lang.reflect.Method method)
           
protected  boolean isHeader(java.lang.reflect.Method method, int j)
           
protected  boolean isValidMethod(java.lang.reflect.Method method)
           
 boolean isVoidOneWay()
           
protected  java.lang.String makeServiceNameFromClassName(java.lang.Class clazz)
           
protected  void registerHandlers(Service service)
           
 void setBindingProvider(BindingProvider bindingProvider)
           
 void setSoapVersion(SoapVersion soapVersion)
           
 void setStyle(java.lang.String style)
           
 void setTransportManager(TransportManager transportManager)
           
 void setUse(java.lang.String use)
           
 void setVoidOneWay(boolean voidOneWay)
           
 void setWsdlBuilderFactory(WSDLBuilderFactory wsdlBuilderFactory)
           
 
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,
                            BindingProvider provider)
Initializes a new instance of the ObjectServiceFactory with the given transport manager and type mapping registry.

Parameters:
transportManager - the transport manager
provider - the binding provider

ObjectServiceFactory

public ObjectServiceFactory(TransportManager transportManager)
Method Detail

getBindingProvider

public BindingProvider getBindingProvider()

create

public Service create(java.lang.Class clazz,
                      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 service name will be the unqualified class name. The namespace will be based on the package. The service will use 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. If the class is an interface, then the implementation class that implements that interface must be set via Service.setProperty(String, Object) with the property key being ObjectInvoker.SERVICE_IMPL_CLASS
Returns:
The service.

create

public Service create(java.lang.Class clazz,
                      java.util.Map properties)
Creates a service from the specified class. The service name will be the unqualified class name. The namespace will be based on the package. The service will use 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. If the class is an interface, then the implementation class that implements that interface must be set via Service.setProperty(String, Object) with the property key being ObjectInvoker.SERVICE_IMPL_CLASS
properties - Properties to set on the service and use in construction.
Returns:
The service.

create

public Service create(java.lang.Class clazz,
                      java.lang.String name,
                      java.lang.String namespace,
                      java.util.Map properties)
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.
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.
properties - Service specific properties which the ServiceFactory will use to create the service.
Returns:
The service.

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.util.Map properties)

registerHandlers

protected void registerHandlers(Service service)

initializeOperations

protected void initializeOperations(Service endpoint)

addIgnoredMethods

public void addIgnoredMethods(java.lang.String className)
Ignore the specified class' declared methods. This can be used to not expose certain interfaces as a service. By default, the methods specified by the following interfaces/classes are ignored:
  • java.lang.Object
  • org.omg.CORBA_2_3.portable.ObjectImpl
  • org.omg.CORBA.portable.ObjectImpl
  • javax.ejb.EJBObject
  • javax.ejb.EJBLocalObject
  • javax.rmi.CORBA.Stub

    Parameters:
    className - the fully qualified class name

  • isValidMethod

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

    addOperation

    protected void addOperation(Service endpoint,
                                java.lang.reflect.Method method)

    getAction

    protected java.lang.String getAction(OperationInfo op)

    isHeader

    protected boolean isHeader(java.lang.reflect.Method method,
                               int j)

    getOperationName

    protected java.lang.String getOperationName(ServiceInfo service,
                                                java.lang.reflect.Method method)
    Creates a name for the operation from the method name. If an operation with that name already exists, a name is create by appending an integer to the end. I.e. if there is already two methods named doSomething, the first one will have an operation name of "doSomething" and the second "doSomething1".

    Parameters:
    service -
    method -
    Returns:

    getMEP

    protected java.lang.String getMEP(java.lang.reflect.Method method)

    isAsync

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

    getInParameterName

    protected javax.xml.namespace.QName getInParameterName(Service endpoint,
                                                           OperationInfo op,
                                                           java.lang.reflect.Method method,
                                                           int paramNumber,
                                                           boolean doc)

    getOutParameterName

    protected javax.xml.namespace.QName getOutParameterName(Service endpoint,
                                                            OperationInfo op,
                                                            java.lang.reflect.Method method,
                                                            boolean doc)

    getTransportManager

    public TransportManager getTransportManager()

    setTransportManager

    public void setTransportManager(TransportManager transportManager)

    setBindingProvider

    public void setBindingProvider(BindingProvider bindingProvider)

    getStyle

    public java.lang.String getStyle()

    setStyle

    public void setStyle(java.lang.String style)

    getUse

    public java.lang.String getUse()

    setUse

    public void setUse(java.lang.String use)

    getSoapVersion

    public SoapVersion getSoapVersion()

    setSoapVersion

    public void setSoapVersion(SoapVersion soapVersion)

    isVoidOneWay

    public boolean isVoidOneWay()

    setVoidOneWay

    public void setVoidOneWay(boolean voidOneWay)

    getWsdlBuilderFactory

    public WSDLBuilderFactory getWsdlBuilderFactory()

    setWsdlBuilderFactory

    public void setWsdlBuilderFactory(WSDLBuilderFactory wsdlBuilderFactory)


    Copyright © 2004-2005 Codehaus. All Rights Reserved.