org.apache.cxf.wsdl.service.factory
Class ReflectionServiceFactoryBean
java.lang.Object
org.apache.cxf.service.factory.AbstractServiceFactoryBean
org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean
- Direct Known Subclasses:
- JaxWsServiceFactoryBean
public class ReflectionServiceFactoryBean
- extends 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.
Method Summary |
protected FaultInfo |
addFault(InterfaceInfo service,
OperationInfo op,
Class<?> exClass)
|
protected void |
bindOperation(OperationInfo op,
Method m)
|
protected void |
buildServiceFromClass()
|
protected void |
buildServiceFromWSDL(String url)
|
protected void |
checkForElement(ServiceInfo serviceInfo,
MessagePartInfo mpi)
|
protected void |
checkServiceClassAnnotations(Class<?> sc)
|
Service |
create()
|
protected void |
createBareMessage(ServiceInfo serviceInfo,
OperationInfo opInfo,
boolean isOut)
|
protected DataBinding |
createDefaultDataBinding()
|
Endpoint |
createEndpoint(EndpointInfo ei)
|
protected void |
createEndpoints()
|
protected void |
createFaultForException(Class<?> exClass,
FaultInfo fi)
|
protected void |
createInputWrappedMessageParts(OperationInfo op,
Method method,
MessageInfo inMsg)
|
protected InterfaceInfo |
createInterface(ServiceInfo serviceInfo)
|
protected Invoker |
createInvoker()
|
protected void |
createMessageParts(InterfaceInfo intf,
OperationInfo op,
Method method)
|
protected OperationInfo |
createOperation(ServiceInfo serviceInfo,
InterfaceInfo intf,
Method m)
|
protected QName |
createOutputMessageName(OperationInfo op,
Method method)
|
protected void |
createOutputWrappedMessageParts(OperationInfo op,
Method method,
MessageInfo outMsg)
|
protected ServiceInfo |
createServiceInfo(InterfaceInfo intf)
|
protected void |
createWrappedSchema(ServiceInfo serviceInfo,
AbstractMessageContainer wrappedMessage,
AbstractMessageContainer unwrappedMessage,
QName wrapperBeanName)
|
protected String |
getAction(OperationInfo op,
Method method)
|
boolean |
getAnonymousWrapperTypes()
|
protected Class<?> |
getBeanClass(Class<?> exClass)
|
List<AbstractServiceConfiguration> |
getConfigurations()
|
EndpointInfo |
getEndpointInfo()
|
QName |
getEndpointName()
|
QName |
getEndpointName(boolean lookup)
|
Executor |
getExecutor()
|
protected Set<Class<?>> |
getExtraClass()
|
protected QName |
getFaultName(InterfaceInfo service,
OperationInfo o,
Class<?> exClass,
Class<?> beanClass)
|
List<Feature> |
getFeatures()
|
Type |
getHolderType(Class<?> cls,
Type type)
|
List<String> |
getIgnoredClasses()
|
List<Method> |
getIgnoredMethods()
|
protected QName |
getInParameterName(OperationInfo op,
Method method,
int paramNumber)
|
protected QName |
getInPartName(OperationInfo op,
Method method,
int paramNumber)
|
protected QName |
getInputMessageName(OperationInfo op,
Method method)
|
protected InterfaceInfo |
getInterfaceInfo()
|
QName |
getInterfaceName()
|
Invoker |
getInvoker()
|
MethodDispatcher |
getMethodDispatcher()
|
protected QName |
getOperationName(InterfaceInfo service,
Method method)
Creates a name for the operation from the method name. |
protected QName |
getOutParameterName(OperationInfo op,
Method method,
int paramNumber)
|
protected QName |
getOutPartName(OperationInfo op,
Method method,
int paramNumber)
|
Map<String,Object> |
getProperties()
|
boolean |
getQualifyWrapperSchema()
|
protected Class<?> |
getRequestWrapper(Method selected)
|
protected String |
getRequestWrapperClassName(Method selected)
|
protected Class<?> |
getResponseWrapper(Method selected)
|
protected String |
getResponseWrapperClassName(Method selected)
|
Class<?> |
getServiceClass()
|
List<AbstractServiceConfiguration> |
getServiceConfigurations()
|
protected String |
getServiceName()
|
protected String |
getServiceNamespace()
|
QName |
getServiceQName()
|
QName |
getServiceQName(boolean lookup)
|
String |
getStyle()
|
Boolean |
getWrapped()
Returns non-null if wrapped mode was explicitely disabled or enabled. |
long |
getWrapperPartMaxOccurs(MessagePartInfo mpi)
|
long |
getWrapperPartMinOccurs(MessagePartInfo mpi)
|
String |
getWsdlURL()
|
protected boolean |
hasOutMessage(Method m)
|
boolean |
hasWrappedMethods(InterfaceInfo interfaceInfo)
|
protected boolean |
initializeClassInfo(OperationInfo o,
Method method,
List<String> paramOrder)
set the holder generic type info into message part info |
protected void |
initializeDefaultInterceptors()
|
protected void |
initializeFaultInterceptors()
|
protected void |
initializeFaults(InterfaceInfo service,
OperationInfo op,
Method method)
|
protected void |
initializeParameter(MessagePartInfo part,
Class<?> rawClass,
Type type)
|
protected void |
initializeServiceConfigurations()
|
protected void |
initializeServiceModel()
|
protected void |
initializeWrappedSchema(ServiceInfo serviceInfo)
|
protected void |
initializeWSDLOperation(InterfaceInfo intf,
OperationInfo o,
Method method)
|
protected void |
initializeWSDLOperations()
|
boolean |
isAnonymousWrapperTypes()
|
protected boolean |
isAsync(Method method)
|
protected boolean |
isFromWsdl()
|
boolean |
isHeader(Method method,
int j)
|
boolean |
isHolder(Class<?> cls,
Type type)
|
protected boolean |
isInParam(Method method,
int j)
|
protected boolean |
isMatchOperation(String methodNameInClass,
String methodNameInWsdl)
|
protected boolean |
isOutParam(Method method,
int j)
|
boolean |
isPopulateFromClass()
|
boolean |
isQualifyWrapperSchema()
|
boolean |
isRPC(Method method)
|
protected boolean |
isValidMethod(Method method)
|
boolean |
isWrapped()
|
protected boolean |
isWrapped(Method method)
|
boolean |
isWrapperPartNillable(MessagePartInfo mpi)
|
boolean |
isWrapperPartQualified(MessagePartInfo mpi)
|
protected void |
processTypes(Class<?> sc,
Type tp)
|
void |
reset()
|
void |
setAnonymousWrapperTypes(boolean b)
|
void |
setConfigurations(List<AbstractServiceConfiguration> configurations)
|
void |
setEndpointName(QName en)
|
void |
setExecutor(Executor executor)
|
void |
setFeatures(List<? extends Feature> features2)
|
void |
setIgnoredClasses(List<String> ignoredClasses)
|
void |
setIgnoredMethods(List<Method> ignoredMethods)
|
void |
setInvoker(Invoker invoker)
|
protected void |
setMethodDispatcher(MethodDispatcher m)
|
void |
setPopulateFromClass(boolean fomClass)
|
void |
setProperties(Map<String,Object> properties)
|
void |
setQualifyWrapperSchema(boolean b)
|
void |
setSchemaLocations(List<String> schemaLocations)
|
void |
setServiceClass(Class<?> serviceClass)
|
void |
setServiceConfigurations(List<AbstractServiceConfiguration> serviceConfigurations)
|
void |
setServiceName(QName serviceName)
|
protected void |
setServiceProperties()
|
void |
setServiceType(ParameterizedType servicetype)
|
void |
setValidate(boolean validate)
If 'validate' is true, this class will validate the service. |
void |
setWrapped(boolean style)
|
void |
setWsdlURL(String wsdlURL)
|
void |
setWsdlURL(URL wsdlURL)
|
void |
updateBindingOperation(BindingOperationInfo boi)
|
void |
validateServiceModel()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
parameterizedTypes
protected Map<Type,Map<String,Class<?>>> parameterizedTypes
schemaLocationMapping
protected final Map<String,String> schemaLocationMapping
ReflectionServiceFactoryBean
public ReflectionServiceFactoryBean()
createDefaultDataBinding
protected DataBinding createDefaultDataBinding()
- Overrides:
createDefaultDataBinding
in class AbstractServiceFactoryBean
reset
public void reset()
create
public Service create()
- Specified by:
create
in class AbstractServiceFactoryBean
createEndpoints
protected void createEndpoints()
updateBindingOperation
public void updateBindingOperation(BindingOperationInfo boi)
createEndpoint
public Endpoint createEndpoint(EndpointInfo ei)
throws EndpointException
- Throws:
EndpointException
initializeServiceConfigurations
protected void initializeServiceConfigurations()
setServiceProperties
protected void setServiceProperties()
buildServiceFromWSDL
protected void buildServiceFromWSDL(String url)
buildServiceFromClass
protected void buildServiceFromClass()
hasWrappedMethods
public boolean hasWrappedMethods(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 InterfaceInfo getInterfaceInfo()
initializeWSDLOperations
protected void initializeWSDLOperations()
initializeWSDLOperation
protected void initializeWSDLOperation(InterfaceInfo intf,
OperationInfo o,
Method method)
initializeClassInfo
protected boolean initializeClassInfo(OperationInfo o,
Method method,
List<String> paramOrder)
- set the holder generic type info into message part info
- Parameters:
o
- method
-
createInvoker
protected Invoker createInvoker()
createServiceInfo
protected ServiceInfo createServiceInfo(InterfaceInfo intf)
createInterface
protected InterfaceInfo createInterface(ServiceInfo serviceInfo)
createOperation
protected OperationInfo createOperation(ServiceInfo serviceInfo,
InterfaceInfo intf,
Method m)
bindOperation
protected void bindOperation(OperationInfo op,
Method m)
initializeWrappedSchema
protected void initializeWrappedSchema(ServiceInfo serviceInfo)
checkForElement
protected void checkForElement(ServiceInfo serviceInfo,
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(ServiceInfo serviceInfo,
AbstractMessageContainer wrappedMessage,
AbstractMessageContainer unwrappedMessage,
QName wrapperBeanName)
createBareMessage
protected void createBareMessage(ServiceInfo serviceInfo,
OperationInfo opInfo,
boolean isOut)
createMessageParts
protected void createMessageParts(InterfaceInfo intf,
OperationInfo op,
Method method)
createInputWrappedMessageParts
protected void createInputWrappedMessageParts(OperationInfo op,
Method method,
MessageInfo inMsg)
createOutputWrappedMessageParts
protected void createOutputWrappedMessageParts(OperationInfo op,
Method method,
MessageInfo outMsg)
initializeParameter
protected void initializeParameter(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 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)
isHolder
public boolean isHolder(Class<?> cls,
Type type)
getHolderType
public Type getHolderType(Class<?> cls,
Type type)
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)
getInputMessageName
protected QName getInputMessageName(OperationInfo op,
Method method)
createOutputMessageName
protected QName createOutputMessageName(OperationInfo op,
Method method)
hasOutMessage
protected boolean hasOutMessage(Method m)
initializeFaults
protected void initializeFaults(InterfaceInfo service,
OperationInfo op,
Method method)
initializeDefaultInterceptors
protected void initializeDefaultInterceptors()
- Overrides:
initializeDefaultInterceptors
in class AbstractServiceFactoryBean
initializeFaultInterceptors
protected void initializeFaultInterceptors()
addFault
protected FaultInfo addFault(InterfaceInfo service,
OperationInfo op,
Class<?> exClass)
createFaultForException
protected void createFaultForException(Class<?> exClass,
FaultInfo fi)
getBeanClass
protected Class<?> getBeanClass(Class<?> exClass)
getFaultName
protected QName getFaultName(InterfaceInfo service,
OperationInfo o,
Class<?> exClass,
Class<?> beanClass)
getAction
protected String getAction(OperationInfo op,
Method method)
isHeader
public boolean isHeader(Method method,
int j)
getOperationName
protected QName getOperationName(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 named
doSomething
, 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(OperationInfo op,
Method method,
int paramNumber)
getInParameterName
protected QName getInParameterName(OperationInfo op,
Method method,
int paramNumber)
getOutParameterName
protected QName getOutParameterName(OperationInfo op,
Method method,
int paramNumber)
getOutPartName
protected QName getOutPartName(OperationInfo op,
Method method,
int paramNumber)
getResponseWrapper
protected Class<?> getResponseWrapper(Method selected)
getResponseWrapperClassName
protected String getResponseWrapperClassName(Method selected)
getRequestWrapper
protected Class<?> getRequestWrapper(Method selected)
getRequestWrapperClassName
protected String getRequestWrapperClassName(Method selected)
isWrapperPartQualified
public boolean isWrapperPartQualified(MessagePartInfo mpi)
isWrapperPartNillable
public boolean isWrapperPartNillable(MessagePartInfo mpi)
getWrapperPartMaxOccurs
public long getWrapperPartMaxOccurs(MessagePartInfo mpi)
getWrapperPartMinOccurs
public long getWrapperPartMinOccurs(MessagePartInfo mpi)
getMethodDispatcher
public MethodDispatcher getMethodDispatcher()
setMethodDispatcher
protected void setMethodDispatcher(MethodDispatcher m)
getConfigurations
public List<AbstractServiceConfiguration> getConfigurations()
setConfigurations
public void setConfigurations(List<AbstractServiceConfiguration> configurations)
getServiceClass
public Class<?> getServiceClass()
processTypes
protected void processTypes(Class<?> sc,
Type tp)
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 Invoker getInvoker()
setInvoker
public void setInvoker(Invoker invoker)
getExecutor
public Executor getExecutor()
setExecutor
public void setExecutor(Executor executor)
getIgnoredClasses
public List<String> getIgnoredClasses()
setIgnoredClasses
public void setIgnoredClasses(List<String> ignoredClasses)
getExtraClass
protected Set<Class<?>> getExtraClass()
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.
getProperties
public Map<String,Object> getProperties()
setProperties
public void setProperties(Map<String,Object> properties)
getIgnoredMethods
public List<Method> getIgnoredMethods()
setIgnoredMethods
public void setIgnoredMethods(List<Method> ignoredMethods)
getFeatures
public List<Feature> getFeatures()
setFeatures
public void setFeatures(List<? extends 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
-
setSchemaLocations
public void setSchemaLocations(List<String> schemaLocations)
Apache CXF