Class ReflectionServiceFactoryBean
- java.lang.Object
-
- org.apache.cxf.service.factory.AbstractServiceFactoryBean
-
- org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean
-
public class ReflectionServiceFactoryBean extends org.apache.cxf.service.factory.AbstractServiceFactoryBeanIntrospects a class and builds aServicefrom 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
Fields Modifier and Type Field Description static StringELEMENT_NAMEstatic StringENDPOINT_CLASSstatic StringEXTRA_CLASSstatic StringFORCE_TYPESstatic StringGENERIC_TYPEstatic StringHEADERstatic StringHOLDERstatic StringMETHODstatic StringMETHOD_ANNOTATIONSstatic StringMETHOD_PARAM_ANNOTATIONSstatic StringMODE_INOUTstatic StringMODE_OUTstatic StringPARAM_ANNOTATIONprotected Map<Type,Map<String,Class<?>>>parameterizedTypesstatic StringRAW_CLASSprotected Map<String,String>schemaLocationMappingprotected Class<?>serviceClassprotected ParameterizedTypeserviceTypestatic StringWRAPPERGEN_NEEDEDprotected StringwsdlURL
-
Constructor Summary
Constructors Constructor Description ReflectionServiceFactoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.cxf.service.model.FaultInfoaddFault(org.apache.cxf.service.model.InterfaceInfo service, org.apache.cxf.service.model.OperationInfo op, Class<?> exClass)protected voidbindOperation(org.apache.cxf.service.model.OperationInfo op, Method m)protected voidbuildServiceFromClass()protected voidbuildServiceFromWSDL(String url)protected voidcheckForElement(org.apache.cxf.service.model.ServiceInfo serviceInfo, org.apache.cxf.service.model.MessagePartInfo mpi)protected voidcheckServiceClassAnnotations(Class<?> sc)org.apache.cxf.service.Servicecreate()protected voidcreateBareMessage(org.apache.cxf.service.model.ServiceInfo serviceInfo, org.apache.cxf.service.model.OperationInfo opInfo, boolean isOut)protected org.apache.cxf.databinding.DataBindingcreateDefaultDataBinding()org.apache.cxf.endpoint.EndpointcreateEndpoint(org.apache.cxf.service.model.EndpointInfo ei)protected voidcreateEndpoints()protected voidcreateFaultForException(Class<?> exClass, org.apache.cxf.service.model.FaultInfo fi)protected voidcreateInputWrappedMessageParts(org.apache.cxf.service.model.OperationInfo op, Method method, org.apache.cxf.service.model.MessageInfo inMsg)protected org.apache.cxf.service.model.InterfaceInfocreateInterface(org.apache.cxf.service.model.ServiceInfo serviceInfo)protected org.apache.cxf.service.invoker.InvokercreateInvoker()protected voidcreateMessageParts(org.apache.cxf.service.model.InterfaceInfo intf, org.apache.cxf.service.model.OperationInfo op, Method method)protected org.apache.cxf.service.model.OperationInfocreateOperation(org.apache.cxf.service.model.ServiceInfo serviceInfo, org.apache.cxf.service.model.InterfaceInfo intf, Method m)protected QNamecreateOutputMessageName(org.apache.cxf.service.model.OperationInfo op, Method method)protected voidcreateOutputWrappedMessageParts(org.apache.cxf.service.model.OperationInfo op, Method method, org.apache.cxf.service.model.MessageInfo outMsg)protected org.apache.cxf.service.model.ServiceInfocreateServiceInfo(org.apache.cxf.service.model.InterfaceInfo intf)protected voidcreateWrappedSchema(org.apache.cxf.service.model.ServiceInfo serviceInfo, org.apache.cxf.service.model.AbstractMessageContainer wrappedMessage, org.apache.cxf.service.model.AbstractMessageContainer unwrappedMessage, QName wrapperBeanName)protected StringgetAction(org.apache.cxf.service.model.OperationInfo op, Method method)booleangetAnonymousWrapperTypes()protected Class<?>getBeanClass(Class<?> exClass)List<AbstractServiceConfiguration>getConfigurations()org.apache.cxf.service.model.EndpointInfogetEndpointInfo()QNamegetEndpointName()QNamegetEndpointName(boolean lookup)ExecutorgetExecutor()protected Set<Class<?>>getExtraClass()protected QNamegetFaultName(org.apache.cxf.service.model.InterfaceInfo service, org.apache.cxf.service.model.OperationInfo o, Class<?> exClass, Class<?> beanClass)List<org.apache.cxf.feature.Feature>getFeatures()TypegetHolderType(Class<?> cls, Type type)List<String>getIgnoredClasses()List<Method>getIgnoredMethods()protected QNamegetInParameterName(org.apache.cxf.service.model.OperationInfo op, Method method, int paramNumber)protected QNamegetInPartName(org.apache.cxf.service.model.OperationInfo op, Method method, int paramNumber)protected QNamegetInputMessageName(org.apache.cxf.service.model.OperationInfo op, Method method)protected org.apache.cxf.service.model.InterfaceInfogetInterfaceInfo()QNamegetInterfaceName()org.apache.cxf.service.invoker.InvokergetInvoker()org.apache.cxf.service.invoker.MethodDispatchergetMethodDispatcher()protected QNamegetOperationName(org.apache.cxf.service.model.InterfaceInfo service, Method method)Creates a name for the operation from the method name.protected QNamegetOutParameterName(org.apache.cxf.service.model.OperationInfo op, Method method, int paramNumber)protected QNamegetOutPartName(org.apache.cxf.service.model.OperationInfo op, Method method, int paramNumber)Map<String,Object>getProperties()booleangetQualifyWrapperSchema()protected Class<?>getRequestWrapper(Method selected)protected StringgetRequestWrapperClassName(Method selected)protected Class<?>getResponseWrapper(Method selected)protected StringgetResponseWrapperClassName(Method selected)Class<?>getServiceClass()List<AbstractServiceConfiguration>getServiceConfigurations()protected StringgetServiceName()protected StringgetServiceNamespace()QNamegetServiceQName()QNamegetServiceQName(boolean lookup)StringgetStyle()BooleangetWrapped()Returns non-null if wrapped mode was explicitely disabled or enabled.longgetWrapperPartMaxOccurs(org.apache.cxf.service.model.MessagePartInfo mpi)longgetWrapperPartMinOccurs(org.apache.cxf.service.model.MessagePartInfo mpi)StringgetWsdlURL()protected booleanhasOutMessage(Method m)booleanhasWrappedMethods(org.apache.cxf.service.model.InterfaceInfo interfaceInfo)protected booleaninitializeClassInfo(org.apache.cxf.service.model.OperationInfo o, Method method, List<String> paramOrder)set the holder generic type info into message part infoprotected voidinitializeDefaultInterceptors()protected voidinitializeFaultInterceptors()protected voidinitializeFaults(org.apache.cxf.service.model.InterfaceInfo service, org.apache.cxf.service.model.OperationInfo op, Method method)protected voidinitializeParameter(org.apache.cxf.service.model.MessagePartInfo part, Class<?> rawClass, Type type)protected voidinitializeServiceConfigurations()protected voidinitializeServiceModel()protected voidinitializeWrappedSchema(org.apache.cxf.service.model.ServiceInfo serviceInfo)protected voidinitializeWSDLOperation(org.apache.cxf.service.model.InterfaceInfo intf, org.apache.cxf.service.model.OperationInfo o, Method method)protected voidinitializeWSDLOperations()booleanisAnonymousWrapperTypes()protected booleanisAsync(Method method)protected booleanisFromWsdl()booleanisHeader(Method method, int j)booleanisHolder(Class<?> cls, Type type)protected booleanisInOutParam(Method method, int j)protected booleanisInParam(Method method, int j)protected booleanisMatchOperation(String methodNameInClass, String methodNameInWsdl)protected booleanisOutParam(Method method, int j)booleanisPopulateFromClass()booleanisQualifyWrapperSchema()booleanisRPC(Method method)protected booleanisValidMethod(Method method)booleanisWrapped()protected booleanisWrapped(Method method)booleanisWrapperPartNillable(org.apache.cxf.service.model.MessagePartInfo mpi)BooleanisWrapperPartQualified(org.apache.cxf.service.model.MessagePartInfo mpi)protected voidprocessTypes(Class<?> sc, Type tp)voidreset()voidsetAnonymousWrapperTypes(boolean b)voidsetConfigurations(List<AbstractServiceConfiguration> configurations)voidsetEndpointName(QName en)voidsetExecutor(Executor executor)voidsetFeatures(List<? extends org.apache.cxf.feature.Feature> features2)voidsetIgnoredClasses(List<String> ignoredClasses)voidsetIgnoredMethods(List<Method> ignoredMethods)voidsetInvoker(org.apache.cxf.service.invoker.Invoker invoker)protected voidsetMethodDispatcher(org.apache.cxf.service.invoker.MethodDispatcher m)voidsetPopulateFromClass(boolean fomClass)voidsetProperties(Map<String,Object> properties)voidsetQualifyWrapperSchema(boolean b)voidsetSchemaLocations(List<String> schemaLocations)voidsetServiceClass(Class<?> serviceClass)voidsetServiceConfigurations(List<AbstractServiceConfiguration> serviceConfigurations)voidsetServiceName(QName serviceName)protected voidsetServiceProperties()voidsetServiceType(ParameterizedType servicetype)voidsetValidate(boolean validate)If 'validate' is true, this class will validate the service.voidsetWrapped(boolean style)voidsetWsdlURL(String wsdlURL)voidsetWsdlURL(URL wsdlURL)voidupdateBindingOperation(org.apache.cxf.service.model.BindingOperationInfo boi)voidvalidateServiceModel()
-
-
-
Field Detail
-
ENDPOINT_CLASS
public static final String ENDPOINT_CLASS
- See Also:
- Constant Field Values
-
GENERIC_TYPE
public static final String GENERIC_TYPE
- See Also:
- Constant Field Values
-
RAW_CLASS
public static final String RAW_CLASS
- See Also:
- Constant Field Values
-
WRAPPERGEN_NEEDED
public static final String WRAPPERGEN_NEEDED
- See Also:
- Constant Field Values
-
EXTRA_CLASS
public static final String EXTRA_CLASS
- See Also:
- Constant Field Values
-
MODE_OUT
public static final String MODE_OUT
- See Also:
- Constant Field Values
-
MODE_INOUT
public static final String MODE_INOUT
- See Also:
- Constant Field Values
-
HOLDER
public static final String HOLDER
- See Also:
- Constant Field Values
-
HEADER
public static final String HEADER
- See Also:
- Constant Field Values
-
ELEMENT_NAME
public static final String ELEMENT_NAME
- See Also:
- Constant Field Values
-
METHOD
public static final String METHOD
- See Also:
- Constant Field Values
-
FORCE_TYPES
public static final String FORCE_TYPES
- See Also:
- Constant Field Values
-
METHOD_PARAM_ANNOTATIONS
public static final String METHOD_PARAM_ANNOTATIONS
- See Also:
- Constant Field Values
-
METHOD_ANNOTATIONS
public static final String METHOD_ANNOTATIONS
- See Also:
- Constant Field Values
-
PARAM_ANNOTATION
public static final String PARAM_ANNOTATION
- See Also:
- Constant Field Values
-
wsdlURL
protected String wsdlURL
-
serviceClass
protected Class<?> serviceClass
-
serviceType
protected ParameterizedType serviceType
-
-
Method Detail
-
createDefaultDataBinding
protected org.apache.cxf.databinding.DataBinding createDefaultDataBinding()
- Overrides:
createDefaultDataBindingin classorg.apache.cxf.service.factory.AbstractServiceFactoryBean
-
reset
public void reset()
-
create
public org.apache.cxf.service.Service create()
- Specified by:
createin classorg.apache.cxf.service.factory.AbstractServiceFactoryBean
-
createEndpoints
protected void createEndpoints()
-
updateBindingOperation
public void updateBindingOperation(org.apache.cxf.service.model.BindingOperationInfo boi)
-
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()
-
setServiceProperties
protected void setServiceProperties()
-
buildServiceFromWSDL
protected void buildServiceFromWSDL(String url)
-
buildServiceFromClass
protected void buildServiceFromClass()
-
hasWrappedMethods
public boolean hasWrappedMethods(org.apache.cxf.service.model.InterfaceInfo interfaceInfo)
-
isFromWsdl
protected boolean isFromWsdl()
-
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, Method method)
-
initializeClassInfo
protected boolean initializeClassInfo(org.apache.cxf.service.model.OperationInfo o, Method method, List<String> paramOrder)set the holder generic type info into message part info- Parameters:
o-method-
-
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, Method m)
-
bindOperation
protected void bindOperation(org.apache.cxf.service.model.OperationInfo op, 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 final 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, 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, Method method)
-
createInputWrappedMessageParts
protected void createInputWrappedMessageParts(org.apache.cxf.service.model.OperationInfo op, Method method, org.apache.cxf.service.model.MessageInfo inMsg)
-
createOutputWrappedMessageParts
protected void createOutputWrappedMessageParts(org.apache.cxf.service.model.OperationInfo op, Method method, org.apache.cxf.service.model.MessageInfo outMsg)
-
initializeParameter
protected void initializeParameter(org.apache.cxf.service.model.MessagePartInfo part, Class<?> rawClass, Type type)
-
getServiceQName
public QName getServiceQName()
-
getServiceQName
public QName getServiceQName(boolean lookup)
-
getEndpointName
public QName getEndpointName()
-
getEndpointName
public QName getEndpointName(boolean lookup)
-
getEndpointInfo
public org.apache.cxf.service.model.EndpointInfo getEndpointInfo()
-
setEndpointName
public void setEndpointName(QName en)
-
getServiceName
protected String getServiceName()
-
getServiceNamespace
protected String getServiceNamespace()
-
getInterfaceName
public QName getInterfaceName()
-
isValidMethod
protected boolean isValidMethod(Method method)
-
isWrapped
protected boolean isWrapped(Method method)
-
isMatchOperation
protected boolean isMatchOperation(String methodNameInClass, String methodNameInWsdl)
-
isOutParam
protected boolean isOutParam(Method method, int j)
-
isInParam
protected boolean isInParam(Method method, int j)
-
isInOutParam
protected boolean isInOutParam(Method method, int j)
-
getInputMessageName
protected QName getInputMessageName(org.apache.cxf.service.model.OperationInfo op, Method method)
-
createOutputMessageName
protected QName createOutputMessageName(org.apache.cxf.service.model.OperationInfo op, Method method)
-
hasOutMessage
protected boolean hasOutMessage(Method m)
-
initializeFaults
protected void initializeFaults(org.apache.cxf.service.model.InterfaceInfo service, org.apache.cxf.service.model.OperationInfo op, Method method)
-
initializeDefaultInterceptors
protected void initializeDefaultInterceptors()
- Overrides:
initializeDefaultInterceptorsin classorg.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, Class<?> exClass)
-
createFaultForException
protected void createFaultForException(Class<?> exClass, org.apache.cxf.service.model.FaultInfo fi)
-
getFaultName
protected QName getFaultName(org.apache.cxf.service.model.InterfaceInfo service, org.apache.cxf.service.model.OperationInfo o, Class<?> exClass, Class<?> beanClass)
-
isHeader
public boolean isHeader(Method method, int j)
-
getOperationName
protected QName getOperationName(org.apache.cxf.service.model.InterfaceInfo service, 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 nameddoSomething, the first one will have an operation name of "doSomething" and the second "doSomething1".- Parameters:
service-method-
-
isAsync
protected boolean isAsync(Method method)
-
getInPartName
protected QName getInPartName(org.apache.cxf.service.model.OperationInfo op, Method method, int paramNumber)
-
getInParameterName
protected QName getInParameterName(org.apache.cxf.service.model.OperationInfo op, Method method, int paramNumber)
-
getOutParameterName
protected QName getOutParameterName(org.apache.cxf.service.model.OperationInfo op, Method method, int paramNumber)
-
getOutPartName
protected QName getOutPartName(org.apache.cxf.service.model.OperationInfo op, Method method, int paramNumber)
-
isWrapperPartQualified
public Boolean isWrapperPartQualified(org.apache.cxf.service.model.MessagePartInfo mpi)
-
isWrapperPartNillable
public boolean isWrapperPartNillable(org.apache.cxf.service.model.MessagePartInfo mpi)
-
getWrapperPartMaxOccurs
public long getWrapperPartMaxOccurs(org.apache.cxf.service.model.MessagePartInfo mpi)
-
getWrapperPartMinOccurs
public long getWrapperPartMinOccurs(org.apache.cxf.service.model.MessagePartInfo mpi)
-
getMethodDispatcher
public org.apache.cxf.service.invoker.MethodDispatcher getMethodDispatcher()
-
setMethodDispatcher
protected void setMethodDispatcher(org.apache.cxf.service.invoker.MethodDispatcher m)
-
getConfigurations
public List<AbstractServiceConfiguration> getConfigurations()
-
setConfigurations
public void setConfigurations(List<AbstractServiceConfiguration> configurations)
-
getServiceClass
public Class<?> getServiceClass()
-
setServiceType
public void setServiceType(ParameterizedType servicetype)
-
setServiceClass
public void setServiceClass(Class<?> serviceClass)
-
checkServiceClassAnnotations
protected void checkServiceClassAnnotations(Class<?> sc)
-
getWsdlURL
public String getWsdlURL()
-
setWsdlURL
public void setWsdlURL(String wsdlURL)
-
setWsdlURL
public void setWsdlURL(URL wsdlURL)
-
getServiceConfigurations
public List<AbstractServiceConfiguration> getServiceConfigurations()
-
setServiceConfigurations
public void setServiceConfigurations(List<AbstractServiceConfiguration> serviceConfigurations)
-
setServiceName
public void setServiceName(QName serviceName)
-
getInvoker
public org.apache.cxf.service.invoker.Invoker getInvoker()
-
setInvoker
public void setInvoker(org.apache.cxf.service.invoker.Invoker invoker)
-
getExecutor
public Executor getExecutor()
-
setExecutor
public void setExecutor(Executor executor)
-
isWrapped
public boolean isWrapped()
-
getStyle
public String getStyle()
-
isRPC
public boolean isRPC(Method method)
-
setWrapped
public void setWrapped(boolean style)
-
getWrapped
public Boolean getWrapped()
Returns non-null if wrapped mode was explicitely disabled or enabled.
-
getFeatures
public List<org.apache.cxf.feature.Feature> getFeatures()
-
setFeatures
public void setFeatures(List<? extends org.apache.cxf.feature.Feature> features2)
-
setValidate
public void setValidate(boolean validate)
If 'validate' is true, this class will validate the service. It will report problems with the service model and the XML schema for the service.- Parameters:
validate-
-
-