Package org.apache.cxf.frontend
Class ClientProxyFactoryBean
- java.lang.Object
-
- org.apache.cxf.interceptor.AbstractBasicInterceptorProvider
-
- org.apache.cxf.frontend.ClientProxyFactoryBean
-
- All Implemented Interfaces:
InterceptorProvider
- Direct Known Subclasses:
ClientProxyFactoryBeanDefinitionParser.SpringClientProxyFactoryBean,JaxWsProxyFactoryBean
public class ClientProxyFactoryBean extends AbstractBasicInterceptorProvider
This class will create a client for you which implements the specified service class. Example:ClientProxyFactoryBean factory = new ClientProxyFactoryBean(); factory.setServiceClass(YourServiceInterface.class); YourServiceInterface client = (YourServiceInterface) factory.create();
To access the underlying Client object:Client cxfClient = ClientProxy.getClient(client);
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanconfigured
-
Constructor Summary
Constructors Constructor Description ClientProxyFactoryBean()ClientProxyFactoryBean(ClientFactoryBean fact)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ClientProxyclientClientProxy(Client c)Objectcreate()Creates a proxy object that can be used to make remote invocations.<ProxyServiceType>
ProxyServiceTypecreate(Class<ProxyServiceType> serviceClass)Create a proxy object that implements a specified Service Endpoint Interface.StringgetAddress()BindingConfigurationgetBindingConfig()StringgetBindingId()BusgetBus()ClientFactoryBeangetClientFactoryBean()ConduitSelectorgetConduitSelector()protected StringgetConfiguredName()DataBindinggetDataBinding()QNamegetEndpointName()List<Feature>getFeatures()protected Class<?>[]getImplementingClasses()StringgetPassword()Map<String,Object>getProperties()Returns the property map for the proxy factory.Class<?>getServiceClass()ReflectionServiceFactoryBeangetServiceFactory()QNamegetServiceName()Returns the QName of the WSDL service the proxy implementsStringgetTransportId()StringgetUsername()StringgetWsdlLocation()StringgetWsdlURL()voidinitFeatures()voidsetAddress(String add)voidsetBindingConfig(BindingConfiguration config)voidsetBindingId(String bind)voidsetBus(Bus bus)voidsetClientFactoryBean(ClientFactoryBean clientFactoryBean)voidsetConduitSelector(ConduitSelector selector)voidsetDataBinding(DataBinding dataBinding)voidsetEndpointName(QName endpointName)voidsetFeatures(List<? extends Feature> f)voidsetPassword(String password)voidsetProperties(Map<String,Object> properties)Specifies a set of properties used to configure the proxies provided by the factory.voidsetServiceClass(Class<?> serviceClass)Specifies the class representing the SEI the proxy implements.voidsetServiceFactory(ReflectionServiceFactoryBean sf)voidsetServiceName(QName serviceName)Specifies the QName of the WSDL service the proxy implements.voidsetTransportId(String transportId)voidsetUsername(String username)voidsetWsdlLocation(String wsdlURL)Specifies the URL where the proxy can find the WSDL defining the service the proxy implements.voidsetWsdlURL(String wsdlURL)Specifies the URL where the proxy can find the WSDL defining the service the proxy implements.-
Methods inherited from class org.apache.cxf.interceptor.AbstractBasicInterceptorProvider
getInFaultInterceptors, getInInterceptors, getOutFaultInterceptors, getOutInterceptors, setInFaultInterceptors, setInInterceptors, setOutFaultInterceptors, setOutInterceptors
-
-
-
-
Constructor Detail
-
ClientProxyFactoryBean
public ClientProxyFactoryBean()
-
ClientProxyFactoryBean
public ClientProxyFactoryBean(ClientFactoryBean fact)
-
-
Method Detail
-
initFeatures
public void initFeatures()
-
create
public <ProxyServiceType> ProxyServiceType create(Class<ProxyServiceType> serviceClass)
Create a proxy object that implements a specified Service Endpoint Interface. This method is a combination ofsetServiceClass(Class)andcreate().- Type Parameters:
ProxyServiceType- The type for the SEI.- Parameters:
serviceClass- The Java class object representing the interface you want.- Returns:
- the proxy.
-
getConfiguredName
protected String getConfiguredName()
-
create
public Object create()
Creates a proxy object that can be used to make remote invocations.- Returns:
- the proxy. You must cast the returned object to the appropriate class before using it.
-
getImplementingClasses
protected Class<?>[] getImplementingClasses()
-
clientClientProxy
protected ClientProxy clientClientProxy(Client c)
-
getClientFactoryBean
public ClientFactoryBean getClientFactoryBean()
-
setClientFactoryBean
public void setClientFactoryBean(ClientFactoryBean clientFactoryBean)
-
getPassword
public String getPassword()
-
setPassword
public void setPassword(String password)
-
getServiceClass
public Class<?> getServiceClass()
-
setServiceClass
public void setServiceClass(Class<?> serviceClass)
Specifies the class representing the SEI the proxy implements.- Parameters:
serviceClass- the SEI's class
-
getUsername
public String getUsername()
-
setUsername
public void setUsername(String username)
-
getWsdlLocation
public String getWsdlLocation()
-
setWsdlLocation
public void setWsdlLocation(String wsdlURL)
Specifies the URL where the proxy can find the WSDL defining the service the proxy implements.- Parameters:
wsdlURL- a string containing the WSDL's URL
-
getWsdlURL
public String getWsdlURL()
-
setWsdlURL
public void setWsdlURL(String wsdlURL)
Specifies the URL where the proxy can find the WSDL defining the service the proxy implements.- Parameters:
wsdlURL- a string containing the WSDL's URL
-
getEndpointName
public QName getEndpointName()
-
setEndpointName
public void setEndpointName(QName endpointName)
-
getServiceName
public QName getServiceName()
Returns the QName of the WSDL service the proxy implements- Returns:
- the WSDL service's QName
-
setServiceName
public void setServiceName(QName serviceName)
Specifies the QName of the WSDL service the proxy implements. The service must exist or an error will result.- Parameters:
serviceName- the QName of the service for the proxy
-
getAddress
public String getAddress()
-
setAddress
public void setAddress(String add)
-
getConduitSelector
public ConduitSelector getConduitSelector()
-
setConduitSelector
public void setConduitSelector(ConduitSelector selector)
-
setBindingId
public void setBindingId(String bind)
-
getBindingId
public String getBindingId()
-
setTransportId
public void setTransportId(String transportId)
-
getTransportId
public String getTransportId()
-
getServiceFactory
public ReflectionServiceFactoryBean getServiceFactory()
-
setServiceFactory
public void setServiceFactory(ReflectionServiceFactoryBean sf)
-
getBus
public Bus getBus()
-
setBus
public void setBus(Bus bus)
-
getProperties
public Map<String,Object> getProperties()
Returns the property map for the proxy factory.- Returns:
- the property map
-
setProperties
public void setProperties(Map<String,Object> properties)
Specifies a set of properties used to configure the proxies provided by the factory. These properties include things like adding a namespace map to the JAXB databinding.- Parameters:
properties- the property map
-
getDataBinding
public DataBinding getDataBinding()
-
setDataBinding
public void setDataBinding(DataBinding dataBinding)
-
setBindingConfig
public void setBindingConfig(BindingConfiguration config)
-
getBindingConfig
public BindingConfiguration getBindingConfig()
-
-