锘??xml version="1.0" encoding="utf-8" standalone="yes"?>日本精品二区,日本二三区不卡,久久精品免费一区二区三区http://www.aygfsteel.com/dongbule/category/47427.html寤洪犻珮鎬ц兘闂ㄦ埛緗?/description>zh-cnTue, 21 Dec 2010 20:41:31 GMTTue, 21 Dec 2010 20:41:31 GMT60鍒跺畾hessian鏈嶅姟绔殑璁塊棶鍒楄〃http://www.aygfsteel.com/dongbule/archive/2010/12/21/341246.html闄堜簬鍠?/dc:creator>闄堜簬鍠?/author>Tue, 21 Dec 2010 08:05:00 GMThttp://www.aygfsteel.com/dongbule/archive/2010/12/21/341246.htmlhttp://www.aygfsteel.com/dongbule/comments/341246.htmlhttp://www.aygfsteel.com/dongbule/archive/2010/12/21/341246.html#Feedback0http://www.aygfsteel.com/dongbule/comments/commentRss/341246.htmlhttp://www.aygfsteel.com/dongbule/services/trackbacks/341246.html
瀵筼rg.springframework.remoting.caucho.HessianServiceExporter榪涜閲嶅啓

/**
 * 閲嶅啓HessianServiceExporter.handleRequest(),鎷︽埅鑾峰彇榪滅璋冪敤淇℃伅
 * 
@author chenyz
 *
 
*/
public class HouseHessianServiceExporter extends HessianServiceExporter {
    
    
private static String[] entryIP = {"192.168.0.1","192.168.0.3","192.168.0.3"};
    
    
private static Log log = LogFactory.getLog("Myremote"); 
    
    @Override
    
public void handleRequest(HttpServletRequest request,
            HttpServletResponse response) 
throws ServletException, IOException {        
        log.info(
"try ==>remote 's IP:"+IpUtil.getIpAddr(request)+"remote 's host: "+request.getRemoteHost());
        
int call = 0;
        
for(String ip:entryIP){
            
if(ip.equals(IpUtil.getIpAddr(request)))
                call
++;
        }
        
if(call>0){
            log.info(
"call ==>remote 's IP:"+IpUtil.getIpAddr(request)+"remote 's host: "+request.getRemoteHost());
            
super.handleRequest(request, response);
        }
    }
}

   <bean id="shineLibWSImpl" class="com.***.shine.remote.ShineLibWSImpl"/>
    
<bean name="/remote/shineinfo" class="com.***.shine.hessian.service.HouseHessianServiceExporter">
        
<property name="service">
            
<ref bean="shineLibWSImpl"/>
        
</property>
        
<property name="serviceInterface">
            
<value>com.***.shine.remote.ShineLibWebService</value>
        
</property>
    
</bean>

閲嶅啓HessianServiceExporter.handleRequest(),鎷︽埅鑾峰彇榪滅璋冪敤淇℃伅,鎻愬彇鍑鴻皟鐢ㄧ鐨刬p淇℃伅涓庢湇鍔$鍒跺畾鐨刬p鍒楄〃榪涜瀵規瘮,騫跺皢鎵鏈夎皟鐢ㄤ俊鎭褰曟棩蹇?br />
濡傛灉鐩存帴浣跨敤hessian鐨刟pi鐨凥essianServlet,鐩存帴瀵笻essianServlet鐨剆ervice()閲嶅啓,鎷︽埅騫舵彁鍙栬繙绔皟鐢ㄤ俊鎭?br />
/**
 * 閲嶅啓HouseHessianServlet.service(),鎷︽埅鑾峰彇榪滅璋冪敤淇℃伅
 * 
@author chenyz
 *
 
*/
public class HouseHessianServlet extends HessianServlet{
    
    
private static String[] entryIP = {"192.168.0.1","192.168.0.3","192.168.0.3"};
    
    
private static Log log = LogFactory.getLog("Myremote"); 
    
    @Override
    
public void service(ServletRequest request, ServletResponse response)
            
throws IOException, ServletException {
        HttpServletRequest req 
= (HttpServletRequest) request;
        log.info(
"try ==>remote 's IP:"+IpUtil.getIpAddr(req)+"remote 's host: "+request.getRemoteHost());
        
int call = 0;
        
for(String ip:entryIP){
            
if(ip.equals(IpUtil.getIpAddr(request)))
                call
++;
        }
        
if(call>0){
            log.info(
"call ==>remote 's IP:"+IpUtil.getIpAddr(req)+"remote 's host: "+request.getRemoteHost());
            
super.service(request, response);
        }
    }
}

web.xml

   <servlet>   
    
<servlet-name>HessianServlet</servlet-name>   
    
<servlet-class>   
        com.***.product.remote.Htest
    
</servlet-class>   
  
</servlet>  

  
<servlet-mapping>   
    
<servlet-name>HessianServlet</servlet-name>   
    
<url-pattern>/service/hession</url-pattern>   
  
</servlet-mapping>  

com.***.product.remote.Htest

public class Htest extends HouseHessianServlet implements IHtest{
    
    
public hello(){
        System.out.println(
"hello");
    }
}




]]>
瑙e喅hessian榪滅▼璋冪敤榪炴帴瓚呮椂鐨勯棶棰?/title><link>http://www.aygfsteel.com/dongbule/archive/2010/12/16/340894.html</link><dc:creator>闄堜簬鍠?/dc:creator><author>闄堜簬鍠?/author><pubDate>Thu, 16 Dec 2010 06:46:00 GMT</pubDate><guid>http://www.aygfsteel.com/dongbule/archive/2010/12/16/340894.html</guid><wfw:comment>http://www.aygfsteel.com/dongbule/comments/340894.html</wfw:comment><comments>http://www.aygfsteel.com/dongbule/archive/2010/12/16/340894.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.aygfsteel.com/dongbule/comments/commentRss/340894.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/dongbule/services/trackbacks/340894.html</trackback:ping><description><![CDATA[鐩墠鍑犲緋葷粺涓富瑕佷嬌鐢ㄧ殑hessian榪涜榪滅▼璋冪敤webservice鏈嶅姟鐨勬湁hessian鐨凥essianProxyFactory(com.caucho.hessian.client.HessianProxyFactory)鍜宻pring鐨凥essianProxyFactoryBean(org.springframework.remoting.caucho.HessianProxyFactoryBean).<br /> <br /> <strong>1.HessianProxyFactory</strong><br /> 鏌ョ湅HessianProxyFactory婧愮爜鍚庡彂鐜?hessian鍦ㄥ垱寤篽ttp璇鋒眰榪炴帴webservice鏈嶅姟騫舵病鏈夊榪炴帴瓚呮椂榪涜鐩稿叧鐨勫弬鏁拌緗?鎵浠ュ綋緗戠粶鍑虹幇闂灝變細閫犳垚鏁翠釜hessian澶勭悊鐨勯樆濉?榪涜岄樆濉炴暣涓嚎紼嬪悗緇殑澶勭悊<br /> 浠ヤ笅鏄疕essianProxyFactory瀵硅繛鎺ュ鐞嗙殑婧愮爜<br /> <br /> <div style="background-color: rgb(238, 238, 238); font-size: 13px; border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 255);">protected</span><span style="color: rgb(0, 0, 0);"> URLConnection openConnection(URL url)<br />     </span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> IOException<br />   {<br />     URLConnection conn </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> url.openConnection();<br /> <br />     conn.setDoOutput(</span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">);<br /> <br />     </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (_readTimeout </span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">) {<br />       </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br />     conn.setReadTimeout((</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">) _readTimeout);<br />       } </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (Throwable e) {<br />       }<br />     }<br /> <br />     conn.setRequestProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Content-Type</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">x-application/hessian</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /> <br />     </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (_basicAuth </span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">)<br />       conn.setRequestProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Authorization</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, _basicAuth);<br />     </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (_user </span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">&&</span><span style="color: rgb(0, 0, 0);"> _password </span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">) {<br />       _basicAuth </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Basic </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> base64(_user </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">:</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> _password);<br />       conn.setRequestProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Authorization</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, _basicAuth);<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> conn;<br />   }</span></div> <br /> 鎵浠ユ垜浠拡瀵規閫昏緫緇ф壙騫墮噸鍐欒openConnection鏂規硶,鍦ㄥ垱寤篽ttp榪炴帴鐨勬椂鍊欓氳繃璁劇疆榪炴帴瓚呮椂鏃墮棿鏉ヨВ鍐沖洜緗戠粶闂闃誨紼嬪簭緇х畫鐨勯棶棰?br /> <br /> <div style="background-color: rgb(238, 238, 238); font-size: 13px; border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> MyHessianProxyFactory </span><span style="color: rgb(0, 0, 255);">extends</span><span style="color: rgb(0, 0, 0);"> HessianProxyFactory {<br /> <br />     </span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> connectTimeOut </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">10000</span><span style="color: rgb(0, 0, 0);">;<br /> <br />     </span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> readTimeOut </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">10000</span><span style="color: rgb(0, 0, 0);">;<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> getConnectTimeOut() {<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> connectTimeOut;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> setConnectTimeOut(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> connectTimeOut) {<br />         </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.connectTimeOut </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> connectTimeOut;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> getReadTimeOut() {<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> readTimeOut;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> setReadTimeOut(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> readTimeOut) {<br />         </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.readTimeOut </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> readTimeOut;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">protected</span><span style="color: rgb(0, 0, 0);"> URLConnection openConnection(URL url) </span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> IOException {<br />         URLConnection conn </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> url.openConnection();<br />         conn.setDoOutput(</span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">);<br />         </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.connectTimeOut </span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">) {<br />             conn.setConnectTimeout(</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.connectTimeOut);<br />         }<br />         </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.readTimeOut </span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">) {<br />             conn.setReadTimeout(</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.readTimeOut);<br />         }<br />         conn.setRequestProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Content-Type</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">x-application/hessian</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />             </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (_basicAuth </span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">)<br />                   conn.setRequestProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Authorization</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, _basicAuth);<br />             </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (_user </span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">&&</span><span style="color: rgb(0, 0, 0);"> _password </span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">) {<br />                   _basicAuth </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Basic </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> base64(_user </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">:</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> _password);<br />                   conn.setRequestProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Authorization</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, _basicAuth);<br />             }<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> conn;<br />     }<br /> }</span></div> <br /> <strong>2.HessianProxyFactoryBean</strong><br /> 鏌ョ湅spring鐨凥essianProxyFactoryBean婧愮爜鍙戠幇,瀹冨湪灝佽hessian鏄洿鎺ュ垱寤轟竴涓狧essianProxyFactory瀹炰緥,鐒跺悗鍒╃敤璇ュ疄渚嬪畬鎴愬垱寤鴻繙紼嬫湇鍔?br /> <br /> <div style="background-color: rgb(238, 238, 238); font-size: 13px; border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> HessianProxyFactoryBean </span><span style="color: rgb(0, 0, 255);">extends</span><span style="color: rgb(0, 0, 0);"> HessianClientInterceptor </span><span style="color: rgb(0, 0, 255);">implements</span><span style="color: rgb(0, 0, 0);"> FactoryBean {<br /> <br />     </span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);"> Object serviceProxy;<br /> <br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> afterPropertiesSet() {<br />         </span><span style="color: rgb(0, 0, 255);">super</span><span style="color: rgb(0, 0, 0);">.afterPropertiesSet();<br />         </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.serviceProxy </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> ProxyFactory.getProxy(getServiceInterface(), </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">);<br />     }<br />     <br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> Object getObject() {<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.serviceProxy;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> Class getObjectType() {<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> getServiceInterface();<br />     }<br />     <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">boolean</span><span style="color: rgb(0, 0, 0);"> isSingleton() {<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">;<br />     }<br /> <br /> }</span></div> <br /> 鎵浠ュ姝ょ殑瑙e喅鏂規硶涓庝笂闈㈠樊涓嶅,緇ф壙HessianProxyFactoryBean鐒跺悗鍔犲叆鐩稿簲鐨勮繛鎺ヨ秴鏃跺拰璇誨彇瓚呮椂鐨勫彉閲?閲嶅啓afterPropertiesSet鏂規硶,騫朵笖鍚屾椂瀹屾垚涓婇潰絎竴姝ュHessianProxyFactory鐨勬敼閫?榪欐牱灝辮兘淇濊瘉榪炴帴榪滅▼webserver鏈嶅姟鍣ㄦ椂涓嶄細鍥犱負緗戠粶鍘熷洜闃誨紼嬪簭鐨勬墽琛?br /> <br /> <div style="background-color: rgb(238, 238, 238); font-size: 13px; border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> MyHessianProxyFactoryBean </span><span style="color: rgb(0, 0, 255);">extends</span><span style="color: rgb(0, 0, 0);"> HessianProxyFactoryBean {<br /> <br />     </span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);"> MyHessianProxyFactory proxyFactory </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> MyHessianProxyFactory();<br /> <br />     </span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> readTimeOut </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">10000</span><span style="color: rgb(0, 0, 0);">;<br /> <br />     </span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> connectTimeOut </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">10000</span><span style="color: rgb(0, 0, 0);">;<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> getReadTimeOut() {<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> readTimeOut;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> setReadTimeOut(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> readTimeOut) {<br />         </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.readTimeOut </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> readTimeOut;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> getConnectTimeOut() {<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> connectTimeOut;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> setConnectTimeOut(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> connectTimeOut) {<br />         </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.connectTimeOut </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> connectTimeOut;<br />     }<br /> <br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> afterPropertiesSet() {<br />         proxyFactory.setReadTimeout(readTimeOut);<br />         proxyFactory.setConnectTimeOut(connectTimeOut);<br />         setProxyFactory(proxyFactory);<br />         </span><span style="color: rgb(0, 0, 255);">super</span><span style="color: rgb(0, 0, 0);">.afterPropertiesSet();<br />     }<br /> }</span></div> <br /> <br /> <img src ="http://www.aygfsteel.com/dongbule/aggbug/340894.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/dongbule/" target="_blank">闄堜簬鍠?/a> 2010-12-16 14:46 <a href="http://www.aygfsteel.com/dongbule/archive/2010/12/16/340894.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> 主站蜘蛛池模板: <a href="http://" target="_blank">哈密市</a>| <a href="http://" target="_blank">巫溪县</a>| <a href="http://" target="_blank">梨树县</a>| <a href="http://" target="_blank">德化县</a>| <a href="http://" target="_blank">华宁县</a>| <a href="http://" target="_blank">益阳市</a>| <a href="http://" target="_blank">永寿县</a>| <a href="http://" target="_blank">长宁县</a>| <a href="http://" target="_blank">容城县</a>| <a href="http://" target="_blank">乌苏市</a>| <a href="http://" target="_blank">南充市</a>| <a href="http://" target="_blank">黄山市</a>| <a href="http://" target="_blank">彩票</a>| <a href="http://" target="_blank">治多县</a>| <a href="http://" target="_blank">获嘉县</a>| <a href="http://" target="_blank">景东</a>| <a href="http://" target="_blank">洞口县</a>| <a href="http://" target="_blank">石景山区</a>| <a href="http://" target="_blank">大姚县</a>| <a href="http://" target="_blank">乌拉特后旗</a>| <a href="http://" target="_blank">通许县</a>| <a href="http://" target="_blank">梁河县</a>| <a href="http://" target="_blank">盐城市</a>| <a href="http://" target="_blank">黄冈市</a>| <a href="http://" target="_blank">大姚县</a>| <a href="http://" target="_blank">中卫市</a>| <a href="http://" target="_blank">阳高县</a>| <a href="http://" target="_blank">新巴尔虎右旗</a>| <a href="http://" target="_blank">岑巩县</a>| <a href="http://" target="_blank">康定县</a>| <a href="http://" target="_blank">荔波县</a>| <a href="http://" target="_blank">南部县</a>| <a href="http://" target="_blank">同仁县</a>| <a href="http://" target="_blank">湄潭县</a>| <a href="http://" target="_blank">泽普县</a>| <a href="http://" target="_blank">罗甸县</a>| <a href="http://" target="_blank">宜春市</a>| <a href="http://" target="_blank">南平市</a>| <a href="http://" target="_blank">维西</a>| <a href="http://" target="_blank">萨嘎县</a>| <a href="http://" target="_blank">当涂县</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>