[#ftl attributes={"generated.type":"blueprint"}]
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">

    <bean id="inConnectorCollector" class="ru.entaxy.esb.system.profile.commons.InConnectorCollector"/>

    <bean id="system-profile" class="ru.entaxy.esb.system.registry.systems.profile.impl.defaults.DefaultSystemProfile"
          activation="eager">
        <property name="systemName" value="[=systemName]"/>
        <property name="profileOutput" ref="profileOutput"/>
    </bean>

    <bean id="profileOutput" class="ru.entaxy.esb.system.profile.commons.profile_output.ProfileOutputImpl"
          activation="eager">
        <property name="systemName" value="[=systemName]"/>
    </bean>

    <service activation="eager" auto-export="interfaces" ref="system-profile"/>

    <reference id="pooledConnectionFactory" interface="javax.jms.ConnectionFactory"/>

    <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
        <property name="connectionFactory" ref="pooledConnectionFactory"/>
    </bean>

    <camelContext id="profile-[=systemName]" xmlns="http://camel.apache.org/schema/blueprint">
        <route>
            <from uri="direct-vm:profile-[=systemName]-enter-point"/>
            <log message="Message ${headers} send to bridge" loggingLevel="TRACE"/>
            <toD uri="permission:checkSystemAccessException?objectId=${headers.X-SystemId}&amp;subjectId=[=systemName]"/>
            <setHeader name="NTX_DestinationPointAfterBridge">
                <simple>system:[=systemName]</simple>
            </setHeader>
            <to uri="jms:queue:entaxy.local.out.[=origin]"/>
        </route>
    </camelContext>
</blueprint>
