<commit_before><?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:batch="http://www.springframework.org/schema/batch" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:sec="http://www.springframework.org/schema/security"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:jee="http://www.springframework.org/schema/jee"
	xmlns:amq="http://activemq.apache.org/schema/core"
	xmlns:jms="http://www.springframework.org/schema/jms"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
	                    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		                http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
		                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
		                http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.4.xsd
		                http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
		                http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.0.xsd
		                http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
		                
	<context:property-placeholder location="classpath:application.properties"/>
    <context:annotation-config/>
    <context:component-scan base-package="org.emonocot.service.impl">
      <context:exclude-filter type="assignable" expression="org.emonocot.api.JobInstanceService"/>
	  <context:exclude-filter type="assignable" expression="org.emonocot.api.JobExecutionService"/>
    </context:component-scan>
    <context:component-scan base-package="org.emonocot.persistence.dao.hibernate"/>
    
    <tx:annotation-driven/>
    	
	<bean id="validator"
      class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/>
      
      <bean id="conversionService"
		class="org.springframework.context.support.ConversionServiceFactoryBean">
		<property name="converters">
			<list>
				<bean class="org.emonocot.model.geography.GeographyConverter" />
				<bean class="org.emonocot.model.reference.ReferenceTypeConverter" />
				<bean class="org.emonocot.model.taxon.RankConverter" />
				<!-- Required due to SPR-6564 Spring ConversionService breaks String-to-Resource resolution -->
				<bean class="org.emonocot.harvest.common.FileConverter" />
			</list>
		</property>
	</bean>
	
    
    <bean name="hibernateSearchIndexPurger"
		class="org.emonocot.persistence.hibernate.HibernateSearchIndexPurger"
		init-method="purgeIndices" depends-on="transactionManager">
	  <property name="purgeOnInit" value="${hibernate.search.purge.indexes.on.init}"/>
	  <property name="indexedClasses">
	    <list>
	      <value>org.emonocot.model.description.Distribution</value>
	      <value>org.emonocot.model.description.TextContent</value>
	      <value>org.emonocot.model.media.Image</value>
	      <value>org.emonocot.model.reference.Reference</value>
	      <value>org.emonocot.model.source.Source</value>
	      <value>org.emonocot.model.taxon.Taxon</value>
	    </list>
	  </property>
	</bean>
    
    <bean name="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
      <property name="sessionFactory" ref="sessionFactory"/>
    </bean>
    
    <bean name="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
      <property name="dataSource" ref="dataSource"/>
      <property name="hibernateProperties">
        <value>
          hibernate.dialect=${hibernate.dialect}
          hibernate.hbm2ddl.auto=validate
          hibernate.search.default.directory_provider=filesystem-master
          hibernate.search.default.refresh=${hibernate.search.default.refresh}
          hibernate.search.default.sourceBase=${hibernate.search.default.sourceBase}
		  hibernate.search.default.indexBase=${hibernate.search.default.indexBase}
        </value>
      </property>
      <property name="configLocation" value="classpath:org/emonocot/model/hibernate.cfg.xml"/>
      <property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration"/>
    </bean>

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
      <property name="driverClassName" value="${jdbc.driver.classname}"/>
      <property name="url" value="${jdbc.driver.url}"/>
      <property name="username" value="${jdbc.driver.username}"/>
      <property name="password" value="${<PASSWORD>}"/>
      <property name="initialSize" value="8"/>
      <property name="maxActive" value="20"/>
      <property name="maxIdle" value="10"/>
      <property name="minIdle" value="1"/>
      <property name="maxWait" value="10000"/>
      <property name="removeAbandoned" value="true"/>
      <property name="removeAbandonedTimeout" value="300"/>
      <property name="logAbandoned" value="true"/>
      <property name="defaultAutoCommit" value="true"/>
      <property name="defaultReadOnly" value="false"/>
      <property name="validationQuery" value="SELECT 1"/>
      <property name="timeBetweenEvictionRunsMillis" value="60000"/>
      <property name="minEvictableIdleTimeMillis" value="30000"/>
      <property name="numTestsPerEvictionRun" value="3"/>
      <property name="testWhileIdle" value="true"/>
      <property name="testOnReturn" value="true"/>
      <property name="testOnBorrow" value="true"/>
      <property name="defaultTransactionIsolation" value="2"/>
    </bean>
    
     <sec:authentication-manager alias="authenticationManager">
      <sec:authentication-provider>
        <sec:user-service>
          <sec:user name="admin" password="${<PASSWORD>}" authorities="ROLE_ADMIN" />
        </sec:user-service>
      </sec:authentication-provider>
    </sec:authentication-manager>
    
    <sec:http auto-config='true' use-expressions="true">
       <sec:intercept-url pattern="/jobs" access="permitAll"/>
       <sec:intercept-url pattern="/**" access="hasRole('ROLE_ADMIN')" />
    </sec:http>
    
   <amq:broker id="broker" brokerName="${amq.broker.name}" useJmx="false" persistent="false">
        <amq:transportConnectors>
            <amq:transportConnector uri="${amq.broker.uri}"/>
        </amq:transportConnectors>
    </amq:broker>
    
    <jee:jndi-lookup id="connectionFactory" jndi-name="java:comp/env/${amq.connectionFactory.jndi_name}" />
    <jee:jndi-lookup id="eMonocotLuceneQueue" jndi-name="java:comp/env/${amq.queue.jndi_name}" />
   
    
    <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
       <constructor-arg ref="connectionFactory"/>
    </bean>
    
    <bean id="messageDrivenSearchController" class="org.emonocot.harvest.common.index.MessageDrivenSearchController">
      <property name="sessionFactory" ref="sessionFactory"/>
    </bean>
    
    <jms:listener-container connection-factory="connectionFactory" concurrency="10" transaction-manager="transactionManager">
        <jms:listener destination="eMonocotLuceneQueue" ref="messageDrivenSearchController"/>
    </jms:listener-container>
</beans><commit_msg>IN_DEVELOPMENT - bug 167: Update Architecture documents http://1172.16.17.32/bugzilla/show_bug.cgi?id=167<commit_after><?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:batch="http://www.springframework.org/schema/batch" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:sec="http://www.springframework.org/schema/security"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:jee="http://www.springframework.org/schema/jee"
	xmlns:amq="http://activemq.apache.org/schema/core"
	xmlns:jms="http://www.springframework.org/schema/jms"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
	                    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		                http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
		                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
		                http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.4.xsd
		                http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
		                http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.0.xsd
		                http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
		                
	<context:property-placeholder location="classpath:application.properties"/>
    <context:annotation-config/>
    <context:component-scan base-package="org.emonocot.service.impl">
      <context:exclude-filter type="assignable" expression="org.emonocot.api.JobInstanceService"/>
	  <context:exclude-filter type="assignable" expression="org.emonocot.api.JobExecutionService"/>
    </context:component-scan>
    <context:component-scan base-package="org.emonocot.persistence.dao.hibernate"/>
    
    <tx:annotation-driven/>
    	
	<bean id="validator"
      class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/>
      
      <bean id="conversionService"
		class="org.springframework.context.support.ConversionServiceFactoryBean">
		<property name="converters">
			<list>
				<bean class="org.emonocot.model.geography.GeographyConverter" />
				<bean class="org.emonocot.model.reference.ReferenceTypeConverter" />
				<bean class="org.emonocot.model.taxon.RankConverter" />
				<!-- Required due to SPR-6564 Spring ConversionService breaks String-to-Resource resolution -->
				<bean class="org.emonocot.harvest.common.FileConverter" />
			</list>
		</property>
	</bean>
	
    
    <bean name="hibernateSearchIndexPurger"
		class="org.emonocot.persistence.hibernate.HibernateSearchIndexPurger"
		init-method="purgeIndices" depends-on="transactionManager">
	  <property name="purgeOnInit" value="${hibernate.search.purge.indexes.on.init}"/>
	  <property name="indexedClasses">
	    <list>
	      <value>org.emonocot.model.description.Distribution</value>
	      <value>org.emonocot.model.description.TextContent</value>
	      <value>org.emonocot.model.media.Image</value>
	      <value>org.emonocot.model.reference.Reference</value>
	      <value>org.emonocot.model.source.Source</value>
	      <value>org.emonocot.model.taxon.Taxon</value>
	    </list>
	  </property>
	</bean>
    
    <bean name="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
      <property name="sessionFactory" ref="sessionFactory"/>
    </bean>
    
    <bean name="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
      <property name="dataSource" ref="dataSource"/>
      <property name="hibernateProperties">
        <value>
          hibernate.dialect=${hibernate.dialect}
          hibernate.hbm2ddl.auto=validate
          hibernate.search.default.directory_provider=filesystem-master
          hibernate.search.default.refresh=${hibernate.search.default.refresh}
          hibernate.search.default.sourceBase=${hibernate.search.default.sourceBase}
		  hibernate.search.default.indexBase=${hibernate.search.default.indexBase}
        </value>
      </property>
      <property name="configLocation" value="classpath:org/emonocot/model/hibernate.cfg.xml"/>
      <property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration"/>
    </bean>

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
      <property name="driverClassName" value="${jdbc.driver.classname}"/>
      <property name="url" value="${jdbc.driver.url}"/>
      <property name="username" value="${jdbc.driver.username}"/>
      <property name="password" value="${jdbc.driver.password}"/>
      <property name="initialSize" value="8"/>
      <property name="maxActive" value="20"/>
      <property name="maxIdle" value="10"/>
      <property name="minIdle" value="1"/>
      <property name="maxWait" value="10000"/>
      <property name="removeAbandoned" value="true"/>
      <property name="removeAbandonedTimeout" value="300"/>
      <property name="logAbandoned" value="true"/>
      <property name="defaultAutoCommit" value="true"/>
      <property name="defaultReadOnly" value="false"/>
      <property name="validationQuery" value="SELECT 1"/>
      <property name="timeBetweenEvictionRunsMillis" value="60000"/>
      <property name="minEvictableIdleTimeMillis" value="30000"/>
      <property name="numTestsPerEvictionRun" value="3"/>
      <property name="testWhileIdle" value="true"/>
      <property name="testOnReturn" value="true"/>
      <property name="testOnBorrow" value="true"/>
      <property name="defaultTransactionIsolation" value="2"/>
    </bean>
    
     <sec:authentication-manager alias="authenticationManager">
      <sec:authentication-provider>
        <sec:user-service>
          <sec:user name="admin" password="${<PASSWORD>}" authorities="ROLE_ADMIN" />
        </sec:user-service>
      </sec:authentication-provider>
    </sec:authentication-manager>
    
    <sec:http auto-config='true' use-expressions="true">
       <sec:intercept-url pattern="/jobs" access="permitAll"/>
       <sec:intercept-url pattern="/**" access="hasRole('ROLE_ADMIN')" />
    </sec:http>
    
   <amq:broker id="broker" brokerName="${amq.broker.name}" useJmx="false" persistent="false">
        <amq:transportConnectors>
            <amq:transportConnector uri="${amq.broker.uri}"/>
        </amq:transportConnectors>
    </amq:broker>
    
    <jee:jndi-lookup id="connectionFactory" jndi-name="java:comp/env/${amq.connectionFactory.jndi_name}" />
    <jee:jndi-lookup id="eMonocotLuceneQueue" jndi-name="java:comp/env/${amq.queue.jndi_name}" />
   
    
    <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
       <constructor-arg ref="connectionFactory"/>
    </bean>
    
    <bean id="messageDrivenSearchController" class="org.emonocot.harvest.common.index.MessageDrivenSearchController">
      <property name="sessionFactory" ref="sessionFactory"/>
    </bean>
    
    <jms:listener-container connection-factory="connectionFactory" concurrency="10" transaction-manager="transactionManager">
        <jms:listener destination="${amq.queue.physical_name}" ref="messageDrivenSearchController"/>
    </jms:listener-container>
</beans>
{'fraction_non_alphanumeric': 0.15648276316656778, 'fraction_numerical': 0.008305319359303936, 'mean_word_length': 3.96303565587177, 'pattern_counts': {'":': 0, '<': 216, '<?xml version=': 2, '>': 216, 'https://': 0, 'lorem ipsum': 0, 'www.': 46, 'xml': 24}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6722570', 'n_tokens_mistral': 4769, 'n_tokens_neox': 4470, 'n_words': 517}