[ 
https://issues.apache.org/jira/browse/HTTPCORE-37?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12469785
 ] 

Oleg Kalnichevski commented on HTTPCORE-37:
-------------------------------------------

How about this?

(1) Create a number of plain old java beans such as

class HttpProtocolParamBean {

  HttpVersion getProtocolVersion();

  void setProtocolVersion(HttpVersion ver);

  String getUserAgent();

  void setUserAgent(String useragent);

}

class HttpConnectionParamBean {

  int getSocketTimeout();

  void setSocketTimeout(int timeout);

  int getConnectTimeout();

  void setConnectTimeout(int timeout);

}

Use Spring to create singletons for these classes in the application context. 
This will solve the greatest part of the puzzle and will give us typed values 
we need to populate HttpParams

(2) Devise an adapter class that can be used to reflect on properties of an 
arbitrary bean and shove them into HttpParams using a simple naming convention:

HttpConnectionParamBean#getSocketTimeout() -> http.connection.socket.timeout

(3) Go out and have a few drinks

Oleg

> Spring integration for HttpParams
> ---------------------------------
>
>                 Key: HTTPCORE-37
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-37
>             Project: HttpComponents Core
>          Issue Type: Improvement
>          Components: HttpCore Spring
>         Environment: Spring 2.0
>            Reporter: Stojce Dimski
>             Fix For: 4.0-alpha4
>
>         Attachments: springHttpParams.zip
>
>
> I quickly prototyped a simple spring integration trough HttpParamsFactoryBean 
> which load parameters from external .properties file and decodes them into 
> HttpParams.
> Approach at solving this issue is pretty 'pragmatic' as would tell Roland, 
> but works like charm for me ;-)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to