All Downloads are FREE. Search and download functionalities are using the official Maven repository.

spring.spring-http-common.xml Maven / Gradle / Ivy

<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ Copyright (c) 2012. JSpringBot. All Rights Reserved.
  ~
  ~ See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The JSpringBot licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                           http://www.springframework.org/schema/beans/spring-beans.xsd">

  <description>jSpringBot Common Beans</description>

  <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="ignoreUnresolvablePlaceholders" value="true"/>
    <property name="locations">
      <list>
        <value>classpath:jspringbot.properties</value>
      </list>
    </property>
  </bean>

  <bean name="schemeRegistry" class="org.apache.http.conn.scheme.SchemeRegistry"/>

  <bean class="org.jspringbot.keyword.http.SchemeRegistryBean">
    <constructor-arg ref="schemeRegistry"/>
    <property name="allowUntrusted" value="${http.allow.untrusted:true}"/>
  </bean>

  <bean name="connectionManager" class="org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager">
    <constructor-arg ref="schemeRegistry"/>
    <property name="defaultMaxPerRoute" value="${http.max.connection.per.route:5}"/>
    <property name="maxTotal" value="${http.max.connection.total:10}"/>
  </bean>

  <bean name="httpParams" class="org.apache.http.params.BasicHttpParams"/>

  <bean class="org.apache.http.params.HttpConnectionParamBean">
    <constructor-arg ref="httpParams"/>
    <property name="connectionTimeout" value="${http.connection.timeout:10000}"/>
    <property name="soTimeout" value="${http.socket.timeout:30000}"/>
    <property name="linger" value="${http.socket.linger:-1}"/>
    <property name="socketBufferSize" value="${http.socket.buffer-size:8192}"/>
    <property name="tcpNoDelay" value="${http.tcp.nodelay:true}"/>
  </bean>

  <bean class="org.apache.http.client.params.ClientParamBean">
    <constructor-arg ref="httpParams"/>
    <property name="allowCircularRedirects" value="${http.allow.circular.redirect:true}"/>
    <property name="handleRedirects" value="${http.handle.redirects:true}"/>
  </bean>

  <bean name="httpClient" class="org.apache.http.impl.client.DefaultHttpClient">
    <constructor-arg ref="connectionManager"/>
    <constructor-arg ref="httpParams"/>
  </bean>

  <bean name="httpLifeCycle" class="org.jspringbot.lifecycle.LifeCycleHandlerRegistryBean">
    <constructor-arg>
      <bean class="org.jspringbot.keyword.http.HTTPLifeCycleHandler">
        <property name="newSessionOnStartSuite" value="${http.start.suite.new.session:false}"/>
        <property name="newSessionOnStartTest" value="${http.start.test.new.session:false}"/>
      </bean>
    </constructor-arg>
  </bean>
</beans>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy