tags:

views:

33

answers:

1

Hello.

I have a bean, say manager, which is used all over my application for remoting. The bean is using httpclient which in turn can be configured with or without proxy. But this configuration can be only one. What i want in my application is: when the application started, the user is asked does she want to use a proxy or not? And depending on the user's answer the bean is properly configured and only then started. Some sort of dynamic configuration during runtime.

Is it possible or maybe I should achieve this some other way?

Thank you.

+1  A: 

Why can't you call setProxy() on httpclient configuration depending on user's input?

Alternatively you can configure httpclient as bean in Spring context (either directly or create a simple wrapper) two times - one with proxy and one without. Then manager can choose which one to use depending on user's input (both can be injected into manager).

maximdim