org.apache.cxf.service.factory
Class ReflectionServiceFactoryBean

java.lang.Object
  extended by org.apache.cxf.service.factory.AbstractServiceFactoryBean
      extended by org.apache.cxf.service.factory.ReflectionServiceFactoryBean

public class ReflectionServiceFactoryBean
extends org.apache.cxf.service.factory.AbstractServiceFactoryBean

Introspects a class and builds a Service from it. If a WSDL URL is specified, a Service model will be directly from the WSDL and then metadata will be filled in from the service class. If no WSDL URL is specified, the Service will be constructed directly from the class structure.


Field Summary
static java.lang.String ELEMENT_NAME
           
static java.lang.String ENDPOINT_CLASS
           
static java.lang.String GENERIC_TYPE
           
static java.lang.String HEADER
           
static java.lang.String HOLDER
           
static java.lang.String METHOD
           
static java.lang.String MODE_INOUT
           
static java.lang.String MODE_OUT
           
protected  java.lang.Class<?> serviceClass
           
protected  java.lang.String wsdlURL
           
 
Constructor Summary
ReflectionServiceFactoryBean()
           
 
Method Summary
protected  org.apache.cxf.service.model.FaultInfo addFault(org.apache.cxf.service.model.InterfaceInfo service, org.apache.cxf.service.model.OperationInfo op, java.lang.Class exClass)
           
protected  void buildServiceFromClass()
           
protected  void buildServiceFromWSDL(java.lang.String url)
           
protected  void checkForElement(org.apache.cxf.service.model.ServiceInfo serviceInfo, org.apache.cxf.service.model.MessagePartInfo mpi)
           
 org.apache.cxf.service.Service create()
           
protected  void createBareMessage(org.apache.cxf.service.model.ServiceInfo serviceInfo, org.apache.cxf.service.model.OperationInfo opInfo, boolean isOut)
           
 org.apache.cxf.endpoint.Endpoint createEndpoint(org.apache.cxf.service.model.EndpointInfo ei)
           
protected  void createEndpoints()
           
protected  void createFaultForException(java.lang.Class<?> exClass, org.apache.cxf.service.model.FaultInfo fi)
           
protected  void createInputWrappedMessageParts(org.apache.cxf.service.model.OperationInfo op, java.lang.reflect.Method method, org.apache.cxf.service.model.MessageInfo inMsg)
           
protected  org.apache.cxf.service.model.InterfaceInfo createInterface(org.apache.cxf.service.model.ServiceInfo serviceInfo)
           
protected  org.apache.cxf.service.invoker.Invoker createInvoker()
           
protected  void createMessageParts(org.apache.cxf.service.model.InterfaceInfo intf, org.apache.cxf.service.model.OperationInfo op, java.lang.reflect.Method method)
           
protected  org.apache.cxf.service.model.OperationInfo createOperation(org.apache.cxf.service.model.ServiceInfo serviceInfo, org.apache.cxf.service.model.InterfaceInfo intf, java.lang.reflect.Method m)
           
protected  javax.xml.namespace.QName createOutputMessageName(org.apache.cxf.service.model.OperationInfo op, java.lang.reflect.Method method)
           
protected  void createOutputWrappedMessageParts(org.apache.cxf.service.model.OperationInfo op, java.lang.reflect.Method method, org.apache.cxf.service.model.MessageInfo outMsg)
           
protected  org.apache.cxf.service.model.ServiceInfo createServiceInfo(org.apache.cxf.service.model.InterfaceInfo intf)
           
protected  void createWrappedSchema(org.apache.cxf.service.model.ServiceInfo serviceInfo, org.apache.cxf.service.model.AbstractMessageContainer wrappedMessage, org.apache.cxf.service.model.AbstractMessageContainer unwrappedMessage, javax.xml.namespace.QName wrapperBeanName)
           
protected  java.lang.String getAction(org.apache.cxf.service.model.OperationInfo op, java.lang.reflect.Method method)
           
 boolean getAnonymousWrapperTypes()
           
protected  java.lang.Class<?> getBeanClass(java.lang.Class<?> exClass)
           
 java.util.List<AbstractServiceConfiguration> getConfigurations()
           
 org.apache.cxf.service.model.EndpointInfo getEndpointInfo()
           
 javax.xml.namespace.QName getEndpointName()
           
 java.util.concurrent.Executor getExecutor()
           
protected  javax.xml.namespace.QName getFaultName(org.apache.cxf.service.model.InterfaceInfo service, org.apache.cxf.service.model.OperationInfo o, java.lang.Class exClass, java.lang.Class beanClass)
           
protected  java.lang.Class getHolderClass(java.lang.reflect.ParameterizedType paramType)
           
 java.util.List<java.lang.String> getIgnoredClasses()
           
 java.util.List<java.lang.reflect.Method> getIgnoredMethods()
           
protected  javax.xml.namespace.QName getInParameterName(org.apache.cxf.service.model.OperationInfo op, java.lang.reflect.Method method, int paramNumber)
           
protected  javax.xml.namespace.QName getInPartName(org.apache.cxf.service.model.OperationInfo op, java.lang.reflect.Method method, int paramNumber)
           
protected  javax.xml.namespace.QName getInputMessageName(org.apache.cxf.service.model.OperationInfo op, java.lang.reflect.Method method)
           
protected  org.apache.cxf.service.model.InterfaceInfo getInterfaceInfo()
           
 javax.xml.namespace.QName getInterfaceName()
           
 org.apache.cxf.service.invoker.Invoker getInvoker()
           
protected  SimpleMethodDispatcher getMethodDispatcher()
           
protected  javax.xml.namespace.QName getOperationName(org.apache.cxf.service.model.InterfaceInfo service, java.lang.reflect.Method method)
          Creates a name for the operation from the method name.
protected  javax.xml.namespace.QName getOutParameterName(org.apache.cxf.service.model.OperationInfo op, java.lang.reflect.Method method, int paramNumber)
           
protected  javax.xml.namespace.QName getOutPartName(org.apache.cxf.service.model.OperationInfo op, java.lang.reflect.Method method, int paramNumber)
           
 java.util.Map<java.lang.String,java.lang.Object> getProperties()
           
 boolean getQualifyWrapperSchema()
           
protected  java.lang.Class getRequestWrapper(java.lang.reflect.Method selected)
           
protected  java.lang.String getRequestWrapperClassName(java.lang.reflect.Method selected)
           
protected  java.lang.Class getResponseWrapper(java.lang.reflect.Method selected)
           
protected  java.lang.String getResponseWrapperClassName(java.lang.reflect.Method selected)
           
 java.lang.Class<?> getServiceClass()
           
 java.util.List<AbstractServiceConfiguration> getServiceConfigurations()
           
protected  java.lang.String getServiceName()
           
protected  java.lang.String getServiceNamespace()
           
 javax.xml.namespace.QName getServiceQName()
           
 java.lang.String getStyle()
           
 java.lang.Boolean getWrapped()
          Returns non-null if wrapped mode was explicitely disabled or enabled.
 java.lang.String getWsdlURL()
           
protected  boolean hasOutMessage(java.lang.reflect.Method m)
           
protected  void initializeDefaultInterceptors()
           
protected  void initializeFaultInterceptors()
           
protected  void initializeFaults(org.apache.cxf.service.model.InterfaceInfo service, org.apache.cxf.service.model.OperationInfo op, java.lang.reflect.Method method)
           
protected  void initializeParameter(org.apache.cxf.service.model.MessagePartInfo part, java.lang.Class rawClass, java.lang.reflect.Type type)
           
protected  void initializeServiceConfigurations()
           
protected  void initializeServiceModel()
           
protected  void initializeWrappedSchema(org.apache.cxf.service.model.ServiceInfo serviceInfo)
           
protected  void initializeWSDLOperation(org.apache.cxf.service.model.InterfaceInfo intf, org.apache.cxf.service.model.OperationInfo o, java.lang.reflect.Method selected)
           
protected  void initializeWSDLOperations()
           
 boolean isAnonymousWrapperTypes()
           
protected  boolean isAsync(java.lang.reflect.Method method)
           
 boolean isHeader(java.lang.reflect.Method method, int j)
           
protected  boolean isInParam(java.lang.reflect.Method method, int j)
           
protected  boolean isMatchOperation(java.lang.String methodNameInClass, java.lang.String methodNameInWsdl)
           
protected  boolean isOutParam(java.lang.reflect.Method method, int j)
           
 boolean isPopulateFromClass()
           
 boolean isQualifyWrapperSchema()
           
 boolean isRPC(java.lang.reflect.Method method)
           
protected  boolean isValidMethod(java.lang.reflect.Method method)
           
 boolean isWrapped()
           
protected  boolean isWrapped(java.lang.reflect.Method method)
           
 void setAnonymousWrapperTypes(boolean b)
           
 void setConfigurations(java.util.List<AbstractServiceConfiguration> configurations)
           
 void setEndpointName(javax.xml.namespace.QName en)
           
 void setExecutor(java.util.concurrent.Executor executor)
           
 void setIgnoredClasses(java.util.List<java.lang.String> ignoredClasses)
           
 void setIgnoredMethods(java.util.List<java.lang.reflect.Method> ignoredMethods)
           
 void setInvoker(org.apache.cxf.service.invoker.Invoker invoker)
           
 void setPopulateFromClass(boolean fomClass)
           
 void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
           
 void setQualifyWrapperSchema(boolean b)
           
 void setServiceClass(java.lang.Class<?> serviceClass)
           
 void setServiceConfigurations(java.util.List<AbstractServiceConfiguration> serviceConfigurations)
           
 void setServiceName(javax.xml.namespace.QName serviceName)
           
 void setWrapped(boolean style)
           
 void setWsdlURL(java.lang.String wsdlURL)
           
 void setWsdlURL(java.net.URL wsdlURL)
           
 void validateServiceModel()
           
 
Methods inherited from class org.apache.cxf.service.factory.AbstractServiceFactoryBean
getBus, getDataBinding, getService, initializeDataBindings, setBus, setDataBinding, setService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENDPOINT_CLASS

public static final java.lang.String ENDPOINT_CLASS
See Also:
Constant Field Values

GENERIC_TYPE

public static final java.lang.String GENERIC_TYPE
See Also:
Constant Field Values

MODE_OUT

public static final java.lang.String MODE_OUT
See Also:
Constant Field Values

MODE_INOUT

public static final java.lang.String MODE_INOUT
See Also:
Constant Field Values

HOLDER

public static final java.lang.String HOLDER
See Also:
Constant Field Values

HEADER

public static final java.lang.String HEADER
See Also:
Constant Field Values

ELEMENT_NAME

public static final java.lang.String ELEMENT_NAME
See Also:
Constant Field Values

METHOD

public static final java.lang.String METHOD
See Also:
Constant Field Values

wsdlURL

protected java.lang.String wsdlURL

serviceClass

protected java.lang.Class<?> serviceClass
Constructor Detail

ReflectionServiceFactoryBean

public ReflectionServiceFactoryBean()
Method Detail

create

public org.apache.cxf.service.Service create()
Specified by:
create in class org.apache.cxf.service.factory.AbstractServiceFactoryBean

createEndpoints

protected void createEndpoints()

createEndpoint

public org.apache.cxf.endpoint.Endpoint createEndpoint(org.apache.cxf.service.model.EndpointInfo ei)
                                                throws org.apache.cxf.endpoint.EndpointException
Throws:
org.apache.cxf.endpoint.EndpointException

initializeServiceConfigurations

protected void initializeServiceConfigurations()

buildServiceFromWSDL

protected void buildServiceFromWSDL(java.lang.String url)

buildServiceFromClass

protected void buildServiceFromClass()

initializeServiceModel

protected void initializeServiceModel()

validateServiceModel

public void validateServiceModel()

isPopulateFromClass

public boolean isPopulateFromClass()

setPopulateFromClass

public void setPopulateFromClass(boolean fomClass)

getInterfaceInfo

protected org.apache.cxf.service.model.InterfaceInfo getInterfaceInfo()

initializeWSDLOperations

protected void initializeWSDLOperations()

initializeWSDLOperation

protected void initializeWSDLOperation(org.apache.cxf.service.model.InterfaceInfo intf,
                                       org.apache.cxf.service.model.OperationInfo o,
                                       java.lang.reflect.Method selected)

createInvoker

protected org.apache.cxf.service.invoker.Invoker createInvoker()

createServiceInfo

protected org.apache.cxf.service.model.ServiceInfo createServiceInfo(org.apache.cxf.service.model.InterfaceInfo intf)

createInterface

protected org.apache.cxf.service.model.InterfaceInfo createInterface(org.apache.cxf.service.model.ServiceInfo serviceInfo)

createOperation

protected org.apache.cxf.service.model.OperationInfo createOperation(org.apache.cxf.service.model.ServiceInfo serviceInfo,
                                                                     org.apache.cxf.service.model.InterfaceInfo intf,
                                                                     java.lang.reflect.Method m)

initializeWrappedSchema

protected void initializeWrappedSchema(org.apache.cxf.service.model.ServiceInfo serviceInfo)

checkForElement

protected void checkForElement(org.apache.cxf.service.model.ServiceInfo serviceInfo,
                               org.apache.cxf.service.model.MessagePartInfo mpi)

getAnonymousWrapperTypes

public boolean getAnonymousWrapperTypes()

isAnonymousWrapperTypes

public boolean isAnonymousWrapperTypes()

setAnonymousWrapperTypes

public void setAnonymousWrapperTypes(boolean b)

getQualifyWrapperSchema

public boolean getQualifyWrapperSchema()

isQualifyWrapperSchema

public boolean isQualifyWrapperSchema()

setQualifyWrapperSchema

public void setQualifyWrapperSchema(boolean b)

createWrappedSchema

protected void createWrappedSchema(org.apache.cxf.service.model.ServiceInfo serviceInfo,
                                   org.apache.cxf.service.model.AbstractMessageContainer wrappedMessage,
                                   org.apache.cxf.service.model.AbstractMessageContainer unwrappedMessage,
                                   javax.xml.namespace.QName wrapperBeanName)

createBareMessage

protected void createBareMessage(org.apache.cxf.service.model.ServiceInfo serviceInfo,
                                 org.apache.cxf.service.model.OperationInfo opInfo,
                                 boolean isOut)

createMessageParts

protected void createMessageParts(org.apache.cxf.service.model.InterfaceInfo intf,
                                  org.apache.cxf.service.model.OperationInfo op,
                                  java.lang.reflect.Method method)

createInputWrappedMessageParts

protected void createInputWrappedMessageParts(org.apache.cxf.service.model.OperationInfo op,
                                              java.lang.reflect.Method method,
                                              org.apache.cxf.service.model.MessageInfo inMsg)

createOutputWrappedMessageParts

protected void createOutputWrappedMessageParts(org.apache.cxf.service.model.OperationInfo op,
                                               java.lang.reflect.Method method,
                                               org.apache.cxf.service.model.MessageInfo outMsg)

initializeParameter

protected void initializeParameter(org.apache.cxf.service.model.MessagePartInfo part,
                                   java.lang.Class rawClass,
                                   java.lang.reflect.Type type)

getHolderClass

protected java.lang.Class getHolderClass(java.lang.reflect.ParameterizedType paramType)

getServiceQName

public javax.xml.namespace.QName getServiceQName()

getEndpointName

public javax.xml.namespace.QName getEndpointName()

getEndpointInfo

public org.apache.cxf.service.model.EndpointInfo getEndpointInfo()

setEndpointName

public void setEndpointName(javax.xml.namespace.QName en)

getServiceName

protected java.lang.String getServiceName()

getServiceNamespace

protected java.lang.String getServiceNamespace()

getInterfaceName

public javax.xml.namespace.QName getInterfaceName()

isValidMethod

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

isWrapped

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

isMatchOperation

protected boolean isMatchOperation(java.lang.String methodNameInClass,
                                   java.lang.String methodNameInWsdl)

isOutParam

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

isInParam

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

getInputMessageName

protected javax.xml.namespace.QName getInputMessageName(org.apache.cxf.service.model.OperationInfo op,
                                                        java.lang.reflect.Method method)

createOutputMessageName

protected javax.xml.namespace.QName createOutputMessageName(org.apache.cxf.service.model.OperationInfo op,
                                                            java.lang.reflect.Method method)

hasOutMessage

protected boolean hasOutMessage(java.lang.reflect.Method m)

initializeFaults

protected void initializeFaults(org.apache.cxf.service.model.InterfaceInfo service,
                                org.apache.cxf.service.model.OperationInfo op,
                                java.lang.reflect.Method method)

initializeDefaultInterceptors

protected void initializeDefaultInterceptors()
Overrides:
initializeDefaultInterceptors in class org.apache.cxf.service.factory.AbstractServiceFactoryBean

initializeFaultInterceptors

protected void initializeFaultInterceptors()

addFault

protected org.apache.cxf.service.model.FaultInfo addFault(org.apache.cxf.service.model.InterfaceInfo service,
                                                          org.apache.cxf.service.model.OperationInfo op,
                                                          java.lang.Class exClass)

createFaultForException

protected void createFaultForException(java.lang.Class<?> exClass,
                                       org.apache.cxf.service.model.FaultInfo fi)

getBeanClass

protected java.lang.Class<?> getBeanClass(java.lang.Class<?> exClass)

getFaultName

protected javax.xml.namespace.QName getFaultName(org.apache.cxf.service.model.InterfaceInfo service,
                                                 org.apache.cxf.service.model.OperationInfo o,
                                                 java.lang.Class exClass,
                                                 java.lang.Class beanClass)

getAction

protected java.lang.String getAction(org.apache.cxf.service.model.OperationInfo op,
                                     java.lang.reflect.Method method)

isHeader

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

getOperationName

protected javax.xml.namespace.QName getOperationName(org.apache.cxf.service.model.InterfaceInfo 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 -

isAsync

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

getInPartName

protected javax.xml.namespace.QName getInPartName(org.apache.cxf.service.model.OperationInfo op,
                                                  java.lang.reflect.Method method,
                                                  int paramNumber)

getInParameterName

protected javax.xml.namespace.QName getInParameterName(org.apache.cxf.service.model.OperationInfo op,
                                                       java.lang.reflect.Method method,
                                                       int paramNumber)

getOutParameterName

protected javax.xml.namespace.QName getOutParameterName(org.apache.cxf.service.model.OperationInfo op,
                                                        java.lang.reflect.Method method,
                                                        int paramNumber)

getOutPartName

protected javax.xml.namespace.QName getOutPartName(org.apache.cxf.service.model.OperationInfo op,
                                                   java.lang.reflect.Method method,
                                                   int paramNumber)

getResponseWrapper

protected java.lang.Class getResponseWrapper(java.lang.reflect.Method selected)

getResponseWrapperClassName

protected java.lang.String getResponseWrapperClassName(java.lang.reflect.Method selected)

getRequestWrapper

protected java.lang.Class getRequestWrapper(java.lang.reflect.Method selected)

getRequestWrapperClassName

protected java.lang.String getRequestWrapperClassName(java.lang.reflect.Method selected)

getMethodDispatcher

protected SimpleMethodDispatcher getMethodDispatcher()

getConfigurations

public java.util.List<AbstractServiceConfiguration> getConfigurations()

setConfigurations

public void setConfigurations(java.util.List<AbstractServiceConfiguration> configurations)

getServiceClass

public java.lang.Class<?> getServiceClass()

setServiceClass

public void setServiceClass(java.lang.Class<?> serviceClass)

getWsdlURL

public java.lang.String getWsdlURL()

setWsdlURL

public void setWsdlURL(java.lang.String wsdlURL)

setWsdlURL

public void setWsdlURL(java.net.URL wsdlURL)

getServiceConfigurations

public java.util.List<AbstractServiceConfiguration> getServiceConfigurations()

setServiceConfigurations

public void setServiceConfigurations(java.util.List<AbstractServiceConfiguration> serviceConfigurations)

setServiceName

public void setServiceName(javax.xml.namespace.QName serviceName)

getInvoker

public org.apache.cxf.service.invoker.Invoker getInvoker()

setInvoker

public void setInvoker(org.apache.cxf.service.invoker.Invoker invoker)

getExecutor

public java.util.concurrent.Executor getExecutor()

setExecutor

public void setExecutor(java.util.concurrent.Executor executor)

getIgnoredClasses

public java.util.List<java.lang.String> getIgnoredClasses()

setIgnoredClasses

public void setIgnoredClasses(java.util.List<java.lang.String> ignoredClasses)

isWrapped

public boolean isWrapped()

getStyle

public java.lang.String getStyle()

isRPC

public boolean isRPC(java.lang.reflect.Method method)

setWrapped

public void setWrapped(boolean style)

getWrapped

public java.lang.Boolean getWrapped()
Returns non-null if wrapped mode was explicitely disabled or enabled.


getProperties

public java.util.Map<java.lang.String,java.lang.Object> getProperties()

setProperties

public void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)

getIgnoredMethods

public java.util.List<java.lang.reflect.Method> getIgnoredMethods()

setIgnoredMethods

public void setIgnoredMethods(java.util.List<java.lang.reflect.Method> ignoredMethods)


Apache CXF is an effort undergoing incubation at the Apache Software Foundation(ASF) and sponsored by the Apache Incubator PMC.