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.
相关阅读
现在哪个IDE比较流行好用?parse a number from html string with Jsoup学习Core Java的资源求讨论:怎样用非Spring的方法实现singleton bean load 大量数据到Hadoop 上有什么好办法吗?请问用ftp安装java环境的办法如何提高设计能力要去onsite一个做global consumer payments的team,java应该怎么准备呢safari在线书库半折了, 11/30和12/1两天 (转载)Cousera 里面有没有哪个java课程比较经典?谢谢!Dan Liang Introducing to JAVA中哪些章节是初学者优先学习的?有个阿三来电面,求面试题奔腾年代j2ee可能速成吗Find maximum palindrome项目找合伙人Re: 做了婊子还要立牌坊装良家 装贤良淑德 (转载)诚心找个男朋友access control within RESTful service找人一起学习Java EE