Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
Service Activity Monitoring :: Agent
%%
Copyright (C) 2011 Talend Inc.
%%
Licensed 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.
#L%
-->

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/osgi-compendium http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd 
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd" >

    <context:annotation-config />
    <tx:annotation-driven />

	<!-- Configuration Admin entry -->
    <osgix:cm-properties id="locator-server-props" persistent-id="org.talend.esb.locator">
        <prop key="locator.endpoints">localhost:2181</prop>
        <prop key="endpoint.prefix"></prop>
        <prop key="locator.strategy">defaultSelectionStrategy</prop>
        <prop key="locator.reloadAdressesCount">10</prop>
        <prop key="connection.timeout">5000</prop>
        <prop key="session.timeout">5000</prop>
   </osgix:cm-properties>

    <!-- placeholder configurer -->
    <!-- context:property-placeholder properties-ref="locator-server-props" /-->
    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="properties" ref="locator-server-props" />
        <property name="placeholderPrefix" value="$sl{" />
    </bean>

    <bean id="serviceLocator"
          class="org.talend.esb.servicelocator.client.internal.ServiceLocatorImpl"
          init-method="connect" destroy-method="disconnect" lazy-init="true">
        <property name="locatorEndpoints" value="$sl{locator.endpoints}"/>
        <property name="connectionTimeout" value="$sl{connection.timeout}"/>
        <property name="sessionTimeout" value="$sl{session.timeout}"/>
    </bean>

    <bean id="locatorRegistrar" class="org.talend.esb.servicelocator.cxf.internal.LocatorRegistrar" lazy-init="true">
        <property name="bus" ref="cxf" />
        <property name="serviceLocator" ref="serviceLocator" />
        <property name="endpointPrefix" value="$sl{endpoint.prefix}"/>
    </bean>

    <bean id="defaultSelectionStrategy" class="org.talend.esb.servicelocator.cxf.internal.DefaultSelectionStrategy">
    </bean>

    <bean id="evenDistributionSelectionStrategy" class="org.talend.esb.servicelocator.cxf.internal.EvenDistributionSelectionStrategy">
        <property name="reloadAdressesCount" value="$sl{locator.reloadAdressesCount}"/>
    </bean>

    <bean id="randomSelectionStrategy" class="org.talend.esb.servicelocator.cxf.internal.RandomSelectionStrategy">
        <property name="reloadAdressesCount" value="$sl{locator.reloadAdressesCount}"/>
    </bean>

    <bean id="locatorClientEnabler" class="org.talend.esb.servicelocator.cxf.internal.LocatorClientEnabler" lazy-init="true">
      	<property name="locatorSelectionStrategies">
            <map>
                <entry key="defaultSelectionStrategy" value-ref="defaultSelectionStrategy" />
                <entry key="randomSelectionStrategy" value-ref="randomSelectionStrategy" />
                <entry key="evenDistributionSelectionStrategy" value-ref="evenDistributionSelectionStrategy" />
            </map>
        </property>
        <property name="bus" ref="cxf" />
        <property name="serviceLocator" ref="serviceLocator" />
        <property name="defaultLocatorSelectionStrategy" value="$sl{locator.strategy}" />
    </bean>

    <bean id="locatorManager" class="org.talend.esb.servicelocator.cxf.internal.ServiceLocatorManager" lazy-init="true">
        <property name="bus" ref="cxf" />
        <property name="locatorRegistrar" ref="locatorRegistrar" />
        <property name="locatorClientEnabler" ref="locatorClientEnabler" />
    </bean>
</beans>
New to GrepCode? Check out our FAQ X