org.codehaus.xfire.annotations
Class AnnotationServiceFactory

java.lang.Object
  extended by org.codehaus.xfire.service.binding.ObjectServiceFactory
      extended by org.codehaus.xfire.annotations.AnnotationServiceFactory
All Implemented Interfaces:
org.codehaus.xfire.service.ServiceFactory

public class AnnotationServiceFactory
extends org.codehaus.xfire.service.binding.ObjectServiceFactory
implements org.codehaus.xfire.service.ServiceFactory

Annotations-bases implementation of the ServiceFactory interface.

Author:
Arjen Poutsma

Field Summary
static java.lang.String ALLOW_INTERFACE
           
 
Fields inherited from class org.codehaus.xfire.service.binding.ObjectServiceFactory
CREATE_DEFAULT_BINDINGS, PORT_NAME, PORT_TYPE, SCHEMAS, SCOPE, SOAP11_TRANSPORTS, SOAP12_TRANSPORTS, STYLE, USE
 
Constructor Summary
AnnotationServiceFactory()
          Creates an AnnotationServiceFactory which uses the most appropriate annotations implementation - commons-attributes on Java 1.4 and Java 5 attributes on Java 5 JVMs.
AnnotationServiceFactory(org.codehaus.xfire.transport.TransportManager transportManager)
          Creates an AnnotationServiceFactory which uses the most appropriate annotations implementation - commons-attributes on Java 1.4 and Java 5 attributes on Java 5 JVMs.
AnnotationServiceFactory(org.codehaus.xfire.transport.TransportManager transportManager, org.codehaus.xfire.aegis.type.Configuration config)
           
AnnotationServiceFactory(WebAnnotations webAnnotations, org.codehaus.xfire.transport.TransportManager transportManager)
           
AnnotationServiceFactory(WebAnnotations webAnnotations, org.codehaus.xfire.transport.TransportManager transportManager, org.codehaus.xfire.service.binding.BindingProvider provider)
          Initializes a new instance of the AnnotationServiceFactory with the given annotations facade, transport manager and type mapping registry.
 
Method Summary
 org.codehaus.xfire.service.Service create(java.lang.Class clazz, javax.xml.namespace.QName name, java.net.URL wsdlUrl, java.util.Map properties)
           
 org.codehaus.xfire.service.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.
protected  java.lang.String createPortType(java.lang.String name, WebServiceAnnotation webServiceAnnotation)
           
protected  java.lang.String createServiceName(java.lang.Class clazz, WebServiceAnnotation webServiceAnnotation, java.lang.String current)
           
protected  java.lang.String createServiceNamespace(java.lang.Class clazz, WebServiceAnnotation webServiceAnnotation, java.lang.String current)
           
protected  WebAnnotations getAnnotations()
           
 AnnotationsValidator getValidator()
           
protected  java.lang.Class loadClass(java.lang.String endpointInterface)
          Attempt to load a class first from this class's ClassLoader, then from the context classloader.
 void setValidator(AnnotationsValidator validator)
           
 
Methods inherited from class org.codehaus.xfire.service.binding.ObjectServiceFactory
addFault, addIgnoredMethods, addOperation, addSoap11Transport, addSoap12Transport, configureHeaders, create, create, create, create, createBindingOperation, createBindings, createDocumentationProvider, createEndpoint, createInputMessageName, createOutputMessageName, createSoap11Binding, createSoap12Binding, createSoapBinding, getAction, getBindingProvider, getCustomTypesMapping, getDocumentationProvider, getFaultName, getIgnoredClasses, getInParameterName, getMEP, getOperationName, getOutParameterName, getSerializer, getServiceConfigurations, getSoap11Transports, getSoap12Transports, getStyle, getTargetNamespace, getTransportManager, getUse, getWsdlBuilderFactory, hasOutMessage, initializeFaults, initializeOperations, isAsync, isBindingCreationEnabled, isCustomFaultsEnabled, isFaultInfoClass, isHeader, isInParam, isOutParam, isValidMethod, isVoidOneWay, makeServiceNameFromClassName, registerHandlers, setBindingCreationEnabled, setBindingProvider, setCustomFaultsEnabled, setCustomTypesMapping, setDocumentationProvider, setServiceConfigurations, setStyle, setTransportManager, setUse, setVoidOneWay, setWsdlBuilderFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.codehaus.xfire.service.ServiceFactory
create, create, create
 

Field Detail

ALLOW_INTERFACE

public static final java.lang.String ALLOW_INTERFACE
See Also:
Constant Field Values
Constructor Detail

AnnotationServiceFactory

public AnnotationServiceFactory()
Creates an AnnotationServiceFactory which uses the most appropriate annotations implementation - commons-attributes on Java 1.4 and Java 5 attributes on Java 5 JVMs.

The TransportManager is retrieved from the XFireFactory.


AnnotationServiceFactory

public AnnotationServiceFactory(org.codehaus.xfire.transport.TransportManager transportManager)
Creates an AnnotationServiceFactory which uses the most appropriate annotations implementation - commons-attributes on Java 1.4 and Java 5 attributes on Java 5 JVMs.


AnnotationServiceFactory

public AnnotationServiceFactory(org.codehaus.xfire.transport.TransportManager transportManager,
                                org.codehaus.xfire.aegis.type.Configuration config)

AnnotationServiceFactory

public AnnotationServiceFactory(WebAnnotations webAnnotations,
                                org.codehaus.xfire.transport.TransportManager transportManager)

AnnotationServiceFactory

public AnnotationServiceFactory(WebAnnotations webAnnotations,
                                org.codehaus.xfire.transport.TransportManager transportManager,
                                org.codehaus.xfire.service.binding.BindingProvider provider)
Initializes a new instance of the AnnotationServiceFactory with the given annotations facade, transport manager and type mapping registry.

Parameters:
webAnnotations - the annotations facade
transportManager - the transport manager
provider - the registry
Method Detail

getAnnotations

protected WebAnnotations getAnnotations()

create

public org.codehaus.xfire.service.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. If the class has a SOAPBindingAnnotation, it will be used to define the style and use of the service. If the class has a WebServiceAnnotation, it will be used to define the name, service name, target namespace. If the annotation defines an endpoint interface, all methods of that interface are exposed as operations. If no endpoint interface is defined, all methods that have the WebMethodAnnotation are exposed.

Specified by:
create in interface org.codehaus.xfire.service.ServiceFactory
Overrides:
create in class org.codehaus.xfire.service.binding.ObjectServiceFactory
Parameters:
clazz - The service class used to populate the operations and parameters.
Returns:
The service.

loadClass

protected java.lang.Class loadClass(java.lang.String endpointInterface)
                             throws java.lang.ClassNotFoundException
Attempt to load a class first from this class's ClassLoader, then from the context classloader.

Parameters:
endpointInterface -
Returns:
Throws:
java.lang.ClassNotFoundException

createServiceNamespace

protected java.lang.String createServiceNamespace(java.lang.Class clazz,
                                                  WebServiceAnnotation webServiceAnnotation,
                                                  java.lang.String current)

createServiceName

protected java.lang.String createServiceName(java.lang.Class clazz,
                                             WebServiceAnnotation webServiceAnnotation,
                                             java.lang.String current)

createPortType

protected java.lang.String createPortType(java.lang.String name,
                                          WebServiceAnnotation webServiceAnnotation)

create

public org.codehaus.xfire.service.Service create(java.lang.Class clazz,
                                                 javax.xml.namespace.QName name,
                                                 java.net.URL wsdlUrl,
                                                 java.util.Map properties)
Specified by:
create in interface org.codehaus.xfire.service.ServiceFactory
Overrides:
create in class org.codehaus.xfire.service.binding.ObjectServiceFactory

getValidator

public AnnotationsValidator getValidator()

setValidator

public void setValidator(AnnotationsValidator validator)


Copyright © 2004-2010. All Rights Reserved.