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:jaxws="http://cxf.apache.org/jaxws"
	xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:task="http://www.springframework.org/schema/task"
	xsi:schemaLocation="
		http://www.springframework.org/schema/beans 
		http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
		http://cxf.apache.org/jaxws 
		http://cxf.apache.org/schemas/jaxws.xsd 
		http://www.springframework.org/schema/context 
		http://www.springframework.org/schema/context/spring-context-3.0.xsd 
		http://www.springframework.org/schema/aop 
		http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 
		http://www.springframework.org/schema/task
		http://www.springframework.org/schema/task/spring-task-3.0.xsd">

    <import resource="classpath:META-INF/cxf/cxf.xml" />

	<context:annotation-config/>
	
    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    	<property name="ignoreUnresolvablePlaceholders" value="true" />    	
        <property name="location" value="classpath:agent.properties"/>
    </bean>
	   
    <bean id="eventFeature" class="org.talend.esb.sam.agent.feature.EventFeature">
        <property name="mapper" ref="eventMapper" />
        <property name="eventSender" ref="queueSender" />
        <property name="logMessageContent" value="${log.messageContent}" />
    </bean>
    
    <bean id="eventMapper" class="org.talend.esb.sam.agent.eventproducer.MessageToEventMapperImpl">
        <property name="maxContentLength" value="${log.maxContentLength}"/>
    </bean>
    
    <bean id="queueSender" class="org.talend.esb.sam.agent.collector.QueueSender">
        <property name="queue" ref="queue"/>
    </bean>

	<bean id="eventCollector" class="org.talend.esb.sam.agent.collector.EventCollectorImpl" >
		<!-- Default interval for scheduler. Start every X milliseconds a new scheduler -->
		<property name="defaultInterval" value="${collector.scheduler.interval}" />
		<!-- Number of events within one service call. This is a maximum number. 
			If there are events in the queue, the events will be processed. -->
		<property name="eventsPerMessageCall" value="${collector.maxEventsPerCall}" />
		<property name="monitoringServiceClient" ref="monitoringServceV1Wrapper" />
		<property name="executor" ref="defaultExecutor" />
		<property name="scheduler" ref="defaultScheduler" />
        <property name="bus" ref="cxf" />
        <property name="queue" ref="queue" />
	</bean>
	
	<bean id="queue" class="java.util.concurrent.ConcurrentLinkedQueue"/>

	<task:annotation-driven executor="defaultExecutor"
		scheduler="defaultScheduler" />
	<!-- Scheduler starts in the interval of defaultInterval property. Within 
		the execution of the scheduler new tasks will be created. This tasks will 
		be managed by executor. Change this parameters only for performance tuning. -->
	<task:scheduler id="defaultScheduler" pool-size="2" />
	<task:executor id="defaultExecutor" pool-size="10" />

	<jaxws:client id="monitoringServiceV1Client"
		serviceClass="org.talend.esb.sam.monitoringservice.v1.MonitoringService"
		address="${service.url}">
        <jaxws:properties>
            <entry key="mtom-enabled" value="true"/>
        </jaxws:properties>
    </jaxws:client>

	<bean id="monitoringServceV1Wrapper" class="org.talend.esb.sam.agent.serviceclient.MonitoringServiceWrapper">
		<property name="monitoringService" ref="monitoringServiceV1Client" />
		<!-- Number of retries Default: 5 -->
		<property name="numberOfRetries" value="${service.retry.number}" />
		<!-- Delay in milliseconds between the next attemp to send. Thread is blocked 
			for this time. Default: 1000 -->
		<property name="delayBetweenRetry" value="${service.retry.delay}" />
	</bean>

</beans>
New to GrepCode? Check out our FAQ X