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.
相关阅读
应用服务器的大家占有,使用率的How to make a jar file in JBuilder?文件是要放在同目录下的吗?How to write a file to the same directory of the class file?急! 如何用eclipse编辑lucenepuzzles about load balancing and failover of JBoss clusterthanks everyone.java 源代码搜索引擎 www.codase.comJava程序员认证模拟题及详细分析(2)可以从.jar文件中删除一些class吗? (EOM)用jdbc从oracle pull out的row data怎么分页显示一篇学习心得 help!What's your habit to document this?一个想不明白的编码问题update for cookxml/cookswing/cookswtjava的进度条中间能够显示进度百分比吗?where to download servlet.jar?Please recommend one introductory Java bookA regular expression question