public class ClientProxyFeature extends WebServiceFeature implements Serializable
The WebServiceFeature is used to set proxy information for the per-connection
proxy feature. It is designed for sevice client.
It can be used when getting Port or reseting proxy for an existing Port.
Here are two typical usages on the Feature:
Case 1: Getting port with the ClientProxyFeature
Service myService = ... //get the Service //set proxy info to the ClientProxyFeature ClientProxyFeature cpf = new ClientProxyFeature(); cpf.setProxyHost("localhost"); cpf.setProxyPort(8888); cpf.setProxyUserName("proxyu"); cpf.setProxyPassword("proxyp"); //get the port with the Feature MyPort port = myService.getPort(cpf); //invoke operations with the port, it will using the proxy setting ...Case 2: Reseting port with the ClientProxyFeature
MyPort port = ... // the port is get with or without ClientProxyFeature ClientProxyFeature cpf = ... // set proxy info cpf.setProxyPort(8888); //attach the feature to port cpf.attachsPort(port); //invoke operations ... //upate the feature with new proxy port cpf.setProxyPort(9999); //reset the port with new proxy info cpf.attachsPort(port); //invoke operations with new proxy ...
ClientProxyFeature cpf = ... // set proxy info cpf.setProxyPort(-1); cpf.attachsPort(port);Note: This feature could be used in Service Creation, but it need wait JAX-WS 2.2 fully supported.
Modifier and Type | Field and Description |
---|---|
static String |
ID |
enabled
Modifier and Type | Method and Description |
---|---|
void |
attachsPort(Object port)
Attachs current ClientProxyFeature to an existing port (override the old proxy
info)
|
String |
getID() |
String |
getProxyHost() |
String |
getProxyPassword() |
int |
getProxyPort() |
String |
getProxyUserName() |
Proxy.Type |
getType() |
boolean |
isIgnoreSystemNonProxyHosts() |
boolean |
isUsedInPort() |
boolean |
isUseSunHttpHandler() |
void |
setIgnoreSystemNonProxyHosts(boolean ignoreSystemNonProxyHosts)
To allow the current proxy defined in the feature to ignore the
system property -Dhttp.nonProxyHosts
|
void |
setProxyHost(String proxyHost) |
void |
setProxyPassword(String proxyPassword) |
void |
setProxyPort(int proxyPort) |
void |
setProxyUserName(String proxyUserName) |
void |
setType(Proxy.Type type)
Set Proxy Type.
|
void |
setUseSunHttpHandler(boolean useSunHttpHandler) |
isEnabled
public static final String ID
public String getProxyHost()
public void setProxyHost(String proxyHost)
public String getProxyPassword()
public void setProxyPassword(String proxyPassword)
public int getProxyPort()
public void setProxyPort(int proxyPort)
public String getProxyUserName()
public void setProxyUserName(String proxyUserName)
public Proxy.Type getType()
public void setType(Proxy.Type type)
type
- public String getID()
getID
in class WebServiceFeature
public boolean isUsedInPort()
public boolean isUseSunHttpHandler()
public void setUseSunHttpHandler(boolean useSunHttpHandler)
public void attachsPort(Object port)
port
- public void setIgnoreSystemNonProxyHosts(boolean ignoreSystemNonProxyHosts)
public boolean isIgnoreSystemNonProxyHosts()