z*h
2 楼
our application needs to access an external webservice, we want the
webservice client can be configurable to use a proxy server or not and which
proxy server/port to use.
Is there a good way to set/change the proxy settings dynamically?
Using the command line -D options doens't look good.
Using the System.properties is acceptable but it requires restart of JVM too
after each setting.
The weird thing is setting System.properties in our application server doesn
't seem take any affect.
Our applica
webservice client can be configurable to use a proxy server or not and which
proxy server/port to use.
Is there a good way to set/change the proxy settings dynamically?
Using the command line -D options doens't look good.
Using the System.properties is acceptable but it requires restart of JVM too
after each setting.
The weird thing is setting System.properties in our application server doesn
't seem take any affect.
Our applica
g*g
4 楼
I used System.properties and it worked, don't know about the
dynamic part.
which
too
doesn
【在 z***h 的大作中提到】
: our application needs to access an external webservice, we want the
: webservice client can be configurable to use a proxy server or not and which
: proxy server/port to use.
: Is there a good way to set/change the proxy settings dynamically?
: Using the command line -D options doens't look good.
: Using the System.properties is acceptable but it requires restart of JVM too
: after each setting.
: The weird thing is setting System.properties in our application server doesn
: 't seem take any affect.
: Our applica
dynamic part.
which
too
doesn
【在 z***h 的大作中提到】
: our application needs to access an external webservice, we want the
: webservice client can be configurable to use a proxy server or not and which
: proxy server/port to use.
: Is there a good way to set/change the proxy settings dynamically?
: Using the command line -D options doens't look good.
: Using the System.properties is acceptable but it requires restart of JVM too
: after each setting.
: The weird thing is setting System.properties in our application server doesn
: 't seem take any affect.
: Our applica
z*h
8 楼
In case anybody is interested, here is the solution for this.
try {
Class c = TransportClientPropertiesFactory.class;
Field field = c.getDeclaredField("cache");
field.setAccessible(true);
Map map = (Map) field.get(c);
map.clear();
} catch (Exception e) {
//you should never get here unless jar file is not in the
classpath or a new version of axis jar file doesn't have these class/methods
log.error(
try {
Class c = TransportClientPropertiesFactory.class;
Field field = c.getDeclaredField("cache");
field.setAccessible(true);
Map map = (Map) field.get(c);
map.clear();
} catch (Exception e) {
//you should never get here unless jar file is not in the
classpath or a new version of axis jar file doesn't have these class/methods
log.error(
m*t
10 楼
Interesting, thanks for sharing.
I would open an enhancement request with the axis team to provide a public
interface for clearing the properties. You seem to have a legitimate use
case right here.
I would open an enhancement request with the axis team to provide a public
interface for clearing the properties. You seem to have a legitimate use
case right here.
g*g
11 楼
Dynamic proxy is not a common practice, Java made it into system properties
maybe for performance.
【在 m******t 的大作中提到】
: Interesting, thanks for sharing.
: I would open an enhancement request with the axis team to provide a public
: interface for clearing the properties. You seem to have a legitimate use
: case right here.
maybe for performance.
【在 m******t 的大作中提到】
: Interesting, thanks for sharing.
: I would open an enhancement request with the axis team to provide a public
: interface for clearing the properties. You seem to have a legitimate use
: case right here.
z*h
12 楼
this proxy setting is for Axis only, it won't affect any other applications
on the same JVM. System properties will affect all applications on the same
JVM and requires a restart of JVM.
sometimes you want different proxy to different URL, sometimes you want to
change the proxy, a restart of JVM is not acceptable for most of cases.
JDK 1.5 or later has a Proxy class, you can use it in URLConnection.
openConnection(Proxy) method. It's dynamically le.
properties
【在 g*****g 的大作中提到】
: Dynamic proxy is not a common practice, Java made it into system properties
: maybe for performance.
on the same JVM. System properties will affect all applications on the same
JVM and requires a restart of JVM.
sometimes you want different proxy to different URL, sometimes you want to
change the proxy, a restart of JVM is not acceptable for most of cases.
JDK 1.5 or later has a Proxy class, you can use it in URLConnection.
openConnection(Proxy) method. It's dynamically le.
properties
【在 g*****g 的大作中提到】
: Dynamic proxy is not a common practice, Java made it into system properties
: maybe for performance.
相关阅读
另一个入门问题。关于 connectionPool 和 dataSource 的问题Simple question[合集] Weiqi Gao: The Number One ill of JavaIntelliJ IDEA 7.01 is out命令行编译java程序[合集] Is there any free java PDF viewer?爪哇的铜锈们新年好!EJBGenHTTP Status 404 The requested resource (/abc/index.jsp) is not available.关于Runtime.getRuntime().exec的问题想给程序加个最简单的窗口界面,请帮忙EJB bookJava Swing -- autohide panel widgets?Anyone have experience with a Java Installer-generator ?Simple question: delete element from collection on condition?问2个java问题 (转载)问一下关于load image的servlet请推荐两本学习java的书Help: how to use Eclipse as C++ IDE in XP? (转载)