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

META-INF.tesb.agent-osgi.xml Maven / Gradle / Ivy

There is a newer version: 8.0.1.R2024-05-RT
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  Service Activity Monitoring :: Agent
  %%
  Copyright (C) 2011 - 2012 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:osgix="http://www.springframework.org/schema/osgi-compendium"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:task="http://www.springframework.org/schema/task"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.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.xsd
        http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd">

    <context:annotation-config/>

    <!-- Configuration Admin entry -->
    <osgix:cm-properties id="sam-agent-props" persistent-id="org.talend.esb.sam.agent">
        <prop key="collector.scheduler.interval">500</prop>
        <prop key="collector.maxEventsPerCall">10</prop>
	    <prop key="collector.lifecycleEvent">false</prop>
        <prop key="log.messageContent">true</prop>
        <prop key="log.maxContentLength">-1</prop>
        <prop key="log.enforceMessageIDTransfer">true</prop>
        <prop key="service.url">http://localhost:8040/services/MonitoringServiceSOAP</prop>
        <prop key="service.retry.number">3</prop>
        <prop key="service.retry.delay">5000</prop>
        <prop key="executor.pool.size">20</prop>
    </osgix:cm-properties>

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

	<bean id="samQueue" class="java.util.concurrent.ConcurrentLinkedQueue"/>

    <bean id="eventFeature" class="org.talend.esb.sam.agent.feature.EventFeatureImpl">
        <property name="logMessageContent" value="$sam{log.messageContent}" />	
        <property name="maxContentLength" value="$sam{log.maxContentLength}"/>
        <property name="enforceMessageIDTransfer" value="$sam{log.enforceMessageIDTransfer}"/>
        <property name="queue" ref="samQueue"/>
    </bean>

    <bean id="eventCollector" class="org.talend.esb.sam.agent.collector.EventCollector">
        <property name="bus" ref="cxf" />
        <property name="queue" ref="samQueue" />
        <property name="monitoringServiceClient" ref="monitoringServceV1Wrapper" />		
        <property name="defaultInterval" value="$sam{collector.scheduler.interval}" />
        <property name="eventsPerMessageCall" value="$sam{collector.maxEventsPerCall}" />
		<property name="sendLifecycleEvent" value="$sam{collector.lifecycleEvent}" />
        <property name="executor" ref="defaultExecutor" />
        <property name="scheduler" ref="defaultScheduler" />
    </bean>

    <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="$sam{executor.pool.size}" />

    <jaxws:client id="monitoringServiceV1Client"
        serviceClass="org.talend.esb.sam.monitoringservice.v1.MonitoringService"
        address="$sam{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" />
        <property name="numberOfRetries" value="$sam{service.retry.number}" />
        <property name="delayBetweenRetry" value="$sam{service.retry.delay}" />
    </bean>

	<bean id="clientListener" class="org.talend.esb.sam.agent.lifecycle.ClientListenerImpl">
	    <property name="sendLifecycleEvent" value="$sam{collector.lifecycleEvent}" />
	    <property name="queue" ref="samQueue"/>
		<property name="monitoringServiceClient" ref="monitoringServceV1Wrapper"/>
	</bean>
	
	<bean id="serviceListener" class="org.talend.esb.sam.agent.lifecycle.ServiceListenerImpl">
	    <property name="sendLifecycleEvent" value="$sam{collector.lifecycleEvent}" />
	    <property name="queue" ref="samQueue"/>
		<property name="monitoringServiceClient" ref="monitoringServceV1Wrapper"/>
	</bean>	
</beans>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy