<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="
           http://www.osgi.org/xmlns/blueprint/v1.0.0
           http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">

    <ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]"/>

    <bean id="camelServlet" class="org.apache.camel.component.servlet.CamelHttpTransportServlet">
    </bean>

    <reference id="httpService" interface="org.osgi.service.http.HttpService" />

    <bean id="httpRegistry" class="org.apache.camel.component.servlet.DefaultHttpRegistry">
        <property name="servlets">
            <list>
                <ref component-id="camelServlet"/>
            </list>
        </property>
    </bean>

    <bean class="org.apache.camel.component.servlet.osgi.OsgiServletRegisterer"
          init-method="register"
          destroy-method="unregister">
        <property name="alias" value="/camel/services" />
        <property name="servletName" value="CamelServlet" />
        <property name="httpService" ref="httpService" />
        <property name="servlet" ref="camelServlet" />
    </bean>

    <service ref="httpRegistry" interface="org.apache.camel.component.servlet.HttpRegistry">
        <service-properties>
            <entry key="url" value="${zk:$[karaf.name]/http}/camel/services"/>
        </service-properties>
    </service>

</blueprint>
