<commit_before><?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
  xmlns:tx="http://www.springframework.org/schema/tx"
  xmlns:context="http://www.springframework.org/schema/context"
  xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
      http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
    
  <bean id="activeMQConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="${opengamma.bloomberg.jms.brokerurl}" />
    <property name="transportListener" ref="activeMqTransportListener" />
    <property name="sendTimeout" value="${opengamma.bloomberg.jms.sendtimeout}" />
  </bean>
  
  <bean id="jmsConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory">
    <constructor-arg ref="activeMQConnectionFactory"/>          
  </bean>
  
  <bean id="jmsConnector" class="com.opengamma.util.jms.JmsConnectorFactoryBean"> 
    <property name="name" value="LiveDataServerContext"/>
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
  </bean>
  
  <bean id="jmsSenderFactory" class="com.opengamma.livedata.server.distribution.JmsSenderFactory">
    <property name="jmsConnector" ref="jmsConnector"/>
  </bean>
    
  <bean id="activeMqTransportListener" class="com.opengamma.livedata.server.distribution.ActiveMQTransportListener">
    <constructor-arg index="0" ref="jmsSenderFactory"/>
  </bean>
      
  <bean id="subscriptionRequestDispatcher" class="com.opengamma.transport.FudgeRequestDispatcher">
    <constructor-arg index="0" ref="subscriptionRequestReceiver"/>
  </bean>
  
  <bean id="subscriptionRequestJmsReceiver" class="com.opengamma.transport.jms.JmsByteArrayRequestDispatcher">
    <constructor-arg index="0" ref="subscriptionRequestDispatcher"/>  
  </bean>

  <bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer" init-method="start">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="destination">
      <bean class="org.apache.activemq.command.ActiveMQTopic">
        <constructor-arg value="${opengamma.bloomberg.live.request.topic}" />
      </bean>
    </property>
    <property name="messageListener" ref="subscriptionRequestJmsReceiver" />
  </bean>
  
  <bean id="activeSecurityPublicationManager" class="com.opengamma.livedata.server.ExpirationManager">
    <constructor-arg ref="liveDataServer"/>
  </bean>
  
  <bean id="heartbeatReceiver" class="com.opengamma.livedata.server.HeartbeatReceiver">
    <constructor-arg ref="activeSecurityPublicationManager"/>
  </bean>
  
  <bean id="heartbeatJmsReceiver" class="com.opengamma.transport.jms.JmsByteArrayMessageDispatcher">
    <constructor-arg index="0" ref="heartbeatReceiver"/>  
  </bean>

  <bean id="heartbeatJmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer" init-method="start">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="destination">
      <bean class="org.apache.activemq.command.ActiveMQTopic">
        <constructor-arg value="${opengamma.bloomberg.live.heartbeat.topic}" />
      </bean>
    </property>
    <property name="messageListener" ref="heartbeatJmsReceiver" />
  </bean>

  <bean id="entitlementJmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer" init-method="start">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="destination">
      <bean class="org.apache.activemq.command.ActiveMQTopic">
        <constructor-arg value="${opengamma.bloomberg.live.entitlement.topic}" />
      </bean>
    </property>
    <property name="messageListener" ref="entitlementRequestJmsReceiver" />
  </bean>
    
  <bean id="entitlementRequestJmsReceiver" class="com.opengamma.transport.jms.JmsByteArrayRequestDispatcher">
    <constructor-arg index="0" ref="entitlementRequestDispatcher"/> 
  </bean>
    
  <bean id="entitlementRequestDispatcher" class="com.opengamma.transport.FudgeRequestDispatcher">
    <constructor-arg index="0" ref="entitlementServer"/>
  </bean>
    
  <bean id="entitlementServer" class="com.opengamma.livedata.entitlement.EntitlementServer">
    <constructor-arg index="0" ref="entitlementChecker"/>
  </bean>


  <bean id="reconnectManager" class="com.opengamma.livedata.server.ReconnectManager"
        depends-on="liveDataServer" init-method="start">
    <constructor-arg index="0" ref="liveDataServer"/>
  </bean>

  <bean id="jmxAttributeSource" class="org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource"/>

  <bean id="jmxAssembler" class="org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler">
    <property name="attributeSource" ref="jmxAttributeSource"/>
  </bean>

  <bean id="jmxNamingStrategy" class="org.springframework.jmx.export.naming.MetadataNamingStrategy">
    <property name="attributeSource" ref="jmxAttributeSource"/>
  </bean>

  <bean id="jmxExporter" class="org.springframework.jmx.export.MBeanExporter">
    <property name="assembler" ref="jmxAssembler"/>
    <property name="namingStrategy" ref="jmxNamingStrategy"/>
    <property name="autodetect" value="true"/>
  </bean>

  <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
    <property name="locateExistingServerIfPossible" value="true" />
  </bean>

  <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
    <property name="shared" value="true"/>
  </bean>
  <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    <property name="staticMethod" value="net.sf.ehcache.management.ManagementService.registerMBeans"/>
    <property name="arguments">
      <list>
        <ref bean="cacheManager" />
        <ref bean="mbeanServer" />
        <value>true</value>
        <value>true</value>
        <value>true</value>
        <value>true</value>
      </list>
    </property>
  </bean>

  <bean id="serverMBean" class="com.opengamma.livedata.server.LiveDataServerMBean">
    <constructor-arg ref="liveDataServer"/>
  </bean>
  
  <!-- BLOOMBERG SPECIFIC -->
  
  <!-- Common -->
  
  <bean id="fudgeContext" class="com.opengamma.util.fudgemsg.OpenGammaFudgeContext" factory-method="getInstance" />
  
  <bean id="sessionOptions" class="com.bloomberglp.blpapi.SessionOptions">
    <property name="serverHost" value="${opengamma.bloomberg.sapi.host}" />
    <property name="serverPort" value="${opengamma.bloomberg.sapi.port}" />
  </bean>
  
  <bean id="bloombergConnector" class="com.opengamma.bbg.BloombergConnector">
    <constructor-arg value="FullStack"/>
    <constructor-arg ref="sessionOptions"/>
  </bean>
  
  <!-- Reference data -->   
  <bean id="refDataProvider" class="com.opengamma.bbg.BloombergReferenceDataProvider" init-method="start" destroy-method="stop">
    <constructor-arg index="0" ref="bloombergConnector" />
  </bean>
  
  <bean id="bbgReferenceDataProvider" class="com.opengamma.bbg.EHCachingReferenceDataProvider">
    <constructor-arg ref="refDataProvider"/>
    <constructor-arg ref="cacheManager"/>
  </bean>   
  
  <bean id="refDataRequestReceiver" class="com.opengamma.bbg.server.ReferenceDataProviderRequestReceiver">
    <constructor-arg ref="bbgReferenceDataProvider" />
  </bean>
  
  <bean id="refDataRequestDispatcher" class="com.opengamma.transport.FudgeRequestDispatcher">
    <constructor-arg ref="refDataRequestReceiver" />
    <constructor-arg ref="fudgeContext" />
  </bean>
  
  <bean id="refDataJmsReceiver" class="com.opengamma.transport.jms.JmsByteArrayRequestDispatcher">
    <constructor-arg ref="refDataRequestDispatcher" />
  </bean>
  
  <bean id="refDataMessageListenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="destination">
      <bean class="org.apache.activemq.command.ActiveMQTopic">
        <constructor-arg value="${opengamma.bloomberg.reference.request.topic}" />
      </bean>
    </property>
    <property name="messageListener" ref="refDataJmsReceiver" />
  </bean>
  
  <!-- Bloomberg-backed HTS Source -->
  
  <bean id="bbgTimeSeriesStatistics" class="com.opengamma.bbg.referencedata.statistics.DailyBloombergReferenceDataStatistics" />
  
  <bean id="historicalTimeSeriesSource" class="com.opengamma.bbg.BloombergHistoricalTimeSeriesSource" init-method="start">
    <constructor-arg ref="bloombergConnector" />
    <constructor-arg ref="bbgTimeSeriesStatistics" />
  </bean>
  
  <bean id="historicalTimeSeriesSourceRestBean" class="com.opengamma.core.historicaltimeseries.impl.DataHistoricalTimeSeriesSourceResource">
    <constructor-arg ref="historicalTimeSeriesSource" />
  </bean>
  
  <!-- Live data -->

  <bean id="distributionSpecificationResolver" factory-bean="bloombergLiveDataServer" factory-method="getDefaultDistributionSpecificationResolver" />

  <bean id="entitlementChecker" class="com.opengamma.livedata.entitlement.PermissiveLiveDataEntitlementChecker">    
  </bean>
  
  <bean id="bloombergLiveDataServer" class="com.opengamma.bbg.livedata.BloombergLiveDataServer" init-method="start">
    <constructor-arg index="0" ref="sessionOptions" />
    <constructor-arg index="1" ref="bbgReferenceDataProvider" />
    
    <property name="distributionSpecificationResolver" ref="distributionSpecificationResolver"/><commit_msg>Fix config<commit_after><?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
  xmlns:tx="http://www.springframework.org/schema/tx"
  xmlns:context="http://www.springframework.org/schema/context"
  xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
      http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
    
  <bean id="activeMQConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="${opengamma.bloomberg.jms.brokerurl}" />
    <property name="transportListener" ref="activeMqTransportListener" />
    <property name="sendTimeout" value="${opengamma.bloomberg.jms.sendtimeout}" />
  </bean>
  
  <bean id="jmsConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory">
    <constructor-arg ref="activeMQConnectionFactory"/>          
  </bean>
  
  <bean id="jmsConnector" class="com.opengamma.util.jms.JmsConnectorFactoryBean"> 
    <property name="name" value="LiveDataServerContext"/>
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
  </bean>
  
  <bean id="jmsSenderFactory" class="com.opengamma.livedata.server.distribution.JmsSenderFactory">
    <property name="jmsConnector" ref="jmsConnector"/>
  </bean>
    
  <bean id="activeMqTransportListener" class="com.opengamma.livedata.server.distribution.ActiveMQTransportListener">
    <constructor-arg index="0" ref="jmsSenderFactory"/>
  </bean>
      
  <bean id="subscriptionRequestDispatcher" class="com.opengamma.transport.FudgeRequestDispatcher">
    <constructor-arg index="0" ref="subscriptionRequestReceiver"/>
  </bean>
  
  <bean id="subscriptionRequestJmsReceiver" class="com.opengamma.transport.jms.JmsByteArrayRequestDispatcher">
    <constructor-arg index="0" ref="subscriptionRequestDispatcher"/>  
  </bean>

  <bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer" init-method="start">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="destination">
      <bean class="org.apache.activemq.command.ActiveMQTopic">
        <constructor-arg value="${opengamma.bloomberg.live.request.topic}" />
      </bean>
    </property>
    <property name="messageListener" ref="subscriptionRequestJmsReceiver" />
  </bean>
  
  <bean id="activeSecurityPublicationManager" class="com.opengamma.livedata.server.ExpirationManager">
    <constructor-arg ref="liveDataServer"/>
  </bean>
  
  <bean id="heartbeatReceiver" class="com.opengamma.livedata.server.HeartbeatReceiver">
    <constructor-arg ref="activeSecurityPublicationManager"/>
  </bean>
  
  <bean id="heartbeatJmsReceiver" class="com.opengamma.transport.jms.JmsByteArrayMessageDispatcher">
    <constructor-arg index="0" ref="heartbeatReceiver"/>  
  </bean>

  <bean id="heartbeatJmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer" init-method="start">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="destination">
      <bean class="org.apache.activemq.command.ActiveMQTopic">
        <constructor-arg value="${opengamma.bloomberg.live.heartbeat.topic}" />
      </bean>
    </property>
    <property name="messageListener" ref="heartbeatJmsReceiver" />
  </bean>

  <bean id="entitlementJmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer" init-method="start">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="destination">
      <bean class="org.apache.activemq.command.ActiveMQTopic">
        <constructor-arg value="${opengamma.bloomberg.live.entitlement.topic}" />
      </bean>
    </property>
    <property name="messageListener" ref="entitlementRequestJmsReceiver" />
  </bean>
    
  <bean id="entitlementRequestJmsReceiver" class="com.opengamma.transport.jms.JmsByteArrayRequestDispatcher">
    <constructor-arg index="0" ref="entitlementRequestDispatcher"/> 
  </bean>
    
  <bean id="entitlementRequestDispatcher" class="com.opengamma.transport.FudgeRequestDispatcher">
    <constructor-arg index="0" ref="entitlementServer"/>
  </bean>
    
  <bean id="entitlementServer" class="com.opengamma.livedata.entitlement.EntitlementServer">
    <constructor-arg index="0" ref="entitlementChecker"/>
  </bean>


  <bean id="reconnectManager" class="com.opengamma.livedata.server.ReconnectManager"
        depends-on="liveDataServer" init-method="start">
    <constructor-arg index="0" ref="liveDataServer"/>
  </bean>

  <bean id="jmxAttributeSource" class="org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource"/>

  <bean id="jmxAssembler" class="org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler">
    <property name="attributeSource" ref="jmxAttributeSource"/>
  </bean>

  <bean id="jmxNamingStrategy" class="org.springframework.jmx.export.naming.MetadataNamingStrategy">
    <property name="attributeSource" ref="jmxAttributeSource"/>
  </bean>

  <bean id="jmxExporter" class="org.springframework.jmx.export.MBeanExporter">
    <property name="assembler" ref="jmxAssembler"/>
    <property name="namingStrategy" ref="jmxNamingStrategy"/>
    <property name="autodetect" value="true"/>
  </bean>

  <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
    <property name="locateExistingServerIfPossible" value="true" />
  </bean>

  <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
    <property name="shared" value="true"/>
  </bean>
  <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    <property name="staticMethod" value="net.sf.ehcache.management.ManagementService.registerMBeans"/>
    <property name="arguments">
      <list>
        <ref bean="cacheManager" />
        <ref bean="mbeanServer" />
        <value>true</value>
        <value>true</value>
        <value>true</value>
        <value>true</value>
      </list>
    </property>
  </bean>

  <bean id="serverMBean" class="com.opengamma.livedata.server.LiveDataServerMBean">
    <constructor-arg ref="liveDataServer"/>
  </bean>
  
  <!-- BLOOMBERG SPECIFIC -->
  
  <!-- Common -->
  
  <bean id="fudgeContext" class="com.opengamma.util.fudgemsg.OpenGammaFudgeContext" factory-method="getInstance" />
  
  <bean id="sessionOptions" class="com.bloomberglp.blpapi.SessionOptions">
    <property name="serverHost" value="${opengamma.bloomberg.sapi.host}" />
    <property name="serverPort" value="${opengamma.bloomberg.sapi.port}" />
  </bean>
  
  <bean id="bloombergConnector" class="com.opengamma.bbg.BloombergConnector">
    <constructor-arg value="FullStack"/>
    <constructor-arg ref="sessionOptions"/>
  </bean>
  
  <!-- Reference data -->   
  <bean id="refDataProvider" class="com.opengamma.bbg.BloombergReferenceDataProvider" init-method="start" destroy-method="stop">
    <constructor-arg index="0" ref="bloombergConnector" />
  </bean>
  
  <bean id="bbgReferenceDataProvider" class="com.opengamma.bbg.EHCachingReferenceDataProvider">
    <constructor-arg ref="refDataProvider"/>
    <constructor-arg ref="cacheManager"/>
  </bean>   
  
  <bean id="refDataRequestReceiver" class="com.opengamma.bbg.server.ReferenceDataProviderRequestReceiver">
    <constructor-arg ref="bbgReferenceDataProvider" />
  </bean>
  
  <bean id="refDataRequestDispatcher" class="com.opengamma.transport.FudgeRequestDispatcher">
    <constructor-arg ref="refDataRequestReceiver" />
    <constructor-arg ref="fudgeContext" />
  </bean>
  
  <bean id="refDataJmsReceiver" class="com.opengamma.transport.jms.JmsByteArrayRequestDispatcher">
    <constructor-arg ref="refDataRequestDispatcher" />
  </bean>
  
  <bean id="refDataMessageListenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="destination">
      <bean class="org.apache.activemq.command.ActiveMQTopic">
        <constructor-arg value="${opengamma.bloomberg.reference.request.topic}" />
      </bean>
    </property>
    <property name="messageListener" ref="refDataJmsReceiver" />
  </bean>
  
  <!-- Bloomberg-backed HTS Source -->
  
  <bean id="bbgTimeSeriesStatistics" class="com.opengamma.bbg.referencedata.statistics.DailyBloombergReferenceDataStatistics" />
  
  <bean id="historicalTimeSeriesSource" class="com.opengamma.bbg.BloombergHistoricalTimeSeriesSource" init-method="start">
    <constructor-arg ref="bloombergConnector" />
    <constructor-arg ref="bbgTimeSeriesStatistics" />
  </bean>
  
  <bean id="historicalTimeSeriesSourceRestBean" class="com.opengamma.core.historicaltimeseries.impl.DataHistoricalTimeSeriesSourceResource">
    <constructor-arg ref="historicalTimeSeriesSource" />
  </bean>
  
  <!-- Live data -->

  <bean id="distributionSpecificationResolver" factory-bean="bloombergLiveDataServer" factory-method="getDefaultDistributionSpecificationResolver" />

  <bean id="entitlementChecker" class="com.opengamma.livedata.entitlement.PermissiveLiveDataEntitlementChecker">    
  </bean>
  
  <bean id="bloombergLiveDataServer" class="com.opengamma.bbg.livedata.BloombergLiveDataServer" init-method="start">
    <constructor-arg index="0" ref="bloombergConnector" />
    <constructor-arg index="1" ref="bbgReferenceDataProvider" />
    
    <property name="distributionSpecificationResolver" ref="distributionSpecificationResolver"/>
{'fraction_non_alphanumeric': 0.14740975683431506, 'fraction_numerical': 0.002718622564567286, 'mean_word_length': 5.093251533742332, 'pattern_counts': {'":': 0, '<': 337, '<?xml version=': 2, '>': 337, 'https://': 0, 'lorem ipsum': 0, 'www.': 26, 'xml': 12}, 'pii_count': 0, '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': '7594856', 'n_tokens_mistral': 6104, 'n_tokens_neox': 5996, 'n_words': 752}