Author: dkulp
Date: Thu Nov 11 19:35:12 2010
New Revision: 1034066
URL: http://svn.apache.org/viewvc?rev=1034066&view=rev
Log:
Merged revisions 1026681 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1026681 | bimargulies | 2010-10-23 17:35:45 -0400 (Sat, 23 Oct 2010) | 1 line
Add new convenience API for creating proxies.
........
Modified:
cxf/branches/2.3.x-fixes/ (props changed)
cxf/branches/2.3.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
Propchange: cxf/branches/2.3.x-fixes/
('svn:mergeinfo' removed)
Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Nov 11 19:35:12 2010
@@ -1 +1 @@
-/cxf/trunk:1-1022129,1022154,1022194,1022401-1022402,1022599-1022884,1022911,1023068,1023121,1023597-1026352,1026549,1026551,1027244,1027269,1027274,1027462,1027509,1027553,1027599,1028170,1029943,1030053,1030189,1032296,1032833,1034035,1034052
+/cxf/trunk:1-1022129,1022154,1022194,1022401-1022402,1022599-1022884,1022911,1023068,1023121,1023597-1026352,1026549,1026551,1026681,1027244,1027269,1027274,1027462,1027509,1027553,1027599,1028170,1029943,1030053,1030189,1032296,1032833,1034035,1034052
Modified:
cxf/branches/2.3.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java?rev=1034066&r1=1034065&r2=1034066&view=diff
==============================================================================
---
cxf/branches/2.3.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
(original)
+++
cxf/branches/2.3.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
Thu Nov 11 19:35:12 2010
@@ -60,21 +60,33 @@ public class ClientProxyFactoryBean exte
private Bus bus;
private List<AbstractFeature> features = new ArrayList<AbstractFeature>();
private DataBinding dataBinding;
-
+
public ClientProxyFactoryBean() {
this(new ClientFactoryBean());
}
public ClientProxyFactoryBean(ClientFactoryBean fact) {
super();
- this.clientFactoryBean = fact;
+ this.clientFactoryBean = fact;
}
-
+
public void initFeatures() {
this.clientFactoryBean.setFeatures(features);
this.getServiceFactory().setFeatures(features);
}
/**
+ * Create a proxy object that implements a specified Service Endpoint
Interface. This
+ * method is a combination of {...@link #setServiceClass(Class)} and
{...@link #create()}.
+ * @param <ProxyServiceType> The type for the SEI.
+ * @param serviceClass The Java class object representing the interface
you want.
+ * @return the proxy.
+ */
+ public <ProxyServiceType> ProxyServiceType create(Class<ProxyServiceType>
serviceClass) {
+ setServiceClass(serviceClass);
+ return serviceClass.cast(create());
+ }
+
+ /**
* Creates a proxy object that can be used to make remote invocations.
*
* @return the proxy. You must cast the returned object to the appropriate
class before using it.
@@ -83,17 +95,17 @@ public class ClientProxyFactoryBean exte
if (properties == null) {
properties = new HashMap<String, Object>();
}
-
+
if (username != null) {
AuthorizationPolicy authPolicy = new AuthorizationPolicy();
authPolicy.setUserName(username);
authPolicy.setPassword(password);
properties.put(AuthorizationPolicy.class.getName(), authPolicy);
}
-
- initFeatures();
+
+ initFeatures();
clientFactoryBean.setProperties(properties);
-
+
if (bus != null) {
clientFactoryBean.setBus(bus);
}
@@ -101,7 +113,7 @@ public class ClientProxyFactoryBean exte
if (dataBinding != null) {
clientFactoryBean.setDataBinding(dataBinding);
}
-
+
Client c = clientFactoryBean.create();
if (getInInterceptors() != null) {
c.getInInterceptors().addAll(getInInterceptors());
@@ -119,8 +131,8 @@ public class ClientProxyFactoryBean exte
ClientProxy handler = clientClientProxy(c);
Class classes[] = getImplementingClasses();
- Object obj =
Proxy.newProxyInstance(clientFactoryBean.getServiceClass().getClassLoader(),
- classes,
+ Object obj =
Proxy.newProxyInstance(clientFactoryBean.getServiceClass().getClassLoader(),
+ classes,
handler);
this.getServiceFactory().sendEvent(FactoryBeanListener.Event.PROXY_CREATED,
@@ -173,13 +185,13 @@ public class ClientProxyFactoryBean exte
public void setUsername(String username) {
this.username = username;
}
-
+
public String getWsdlLocation() {
return getWsdlURL();
}
-
+
/**
- * Specifies the URL where the proxy can find the WSDL defining the
+ * Specifies the URL where the proxy can find the WSDL defining the
* service the proxy implements.
*
* @param wsdlURL a string containing the WSDL's URL
@@ -193,7 +205,7 @@ public class ClientProxyFactoryBean exte
}
/**
- * Specifies the URL where the proxy can find the WSDL defining the
+ * Specifies the URL where the proxy can find the WSDL defining the
* service the proxy implements.
*
* @param wsdlURL a string containing the WSDL's URL
@@ -212,7 +224,7 @@ public class ClientProxyFactoryBean exte
/**
* Returns the QName of the WSDL service the proxy implements
- *
+ *
* @return the WSDL service's QName
*/
public QName getServiceName() {
@@ -220,7 +232,7 @@ public class ClientProxyFactoryBean exte
}
/**
- * Specifies the QName of the WSDL service the proxy implements. The
+ * Specifies the QName of the WSDL service the proxy implements. The
* service must exist or an error will result.
*
* @param serviceName the QName of the service for the proxy
@@ -244,19 +256,19 @@ public class ClientProxyFactoryBean exte
public void setConduitSelector(ConduitSelector selector) {
clientFactoryBean.setConduitSelector(selector);
}
-
+
public void setBindingId(String bind) {
clientFactoryBean.setBindingId(bind);
}
-
+
public String getBindingId() {
return clientFactoryBean.getBindingId();
}
-
+
public void setTransportId(String transportId) {
clientFactoryBean.setTransportId(transportId);
}
-
+
public String getTransportId() {
return clientFactoryBean.getTransportId();
}
@@ -264,11 +276,11 @@ public class ClientProxyFactoryBean exte
public ReflectionServiceFactoryBean getServiceFactory() {
return clientFactoryBean.getServiceFactory();
}
-
+
public void setServiceFactory(ReflectionServiceFactoryBean sf) {
clientFactoryBean.setServiceFactory(sf);
}
-
+
public Bus getBus() {
return bus;
}
@@ -288,8 +300,8 @@ public class ClientProxyFactoryBean exte
}
/**
- * Specifies a set of properties used to configure the proxies
- * provided by the factory. These properties include things like
+ * 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.
*
* @param properties the property map
@@ -305,7 +317,7 @@ public class ClientProxyFactoryBean exte
public void setFeatures(List<AbstractFeature> f) {
this.features = f;
}
-
+
public DataBinding getDataBinding() {
return dataBinding;
}
@@ -317,7 +329,7 @@ public class ClientProxyFactoryBean exte
public void setBindingConfig(BindingConfiguration config) {
getClientFactoryBean().setBindingConfig(config);
}
-
+
public BindingConfiguration getBindingConfig() {
return getClientFactoryBean().getBindingConfig();
}