There are two JBI components for InOnly and InOut which create dynamic proxies which when methods are invoked they are dispatched into the JBI container.

For input the JBI components attach the reflection method invocation proxy, method name and arguments to the inbound MessageExchange for the JBI container to route. For output, the attached Marshaler is used to turn the response into a POJO.

InOnly

This example shows an InOnly reflection component being configured. This component then creates a dynamic proxy which when a method is invoked it will be passed into the JBI container.

<sm:activationSpec componentName="proxyCounter"
      endpoint="proxyCounter" 
      service="foo:proxyCounter" 
      destinationService="foo:reflectionCounter">
  <sm:component><bean class="org.apache.servicemix.components.reflection.ProxyInOnlyBinding">
    <property name="target" ref="counter"/>
  </bean></sm:component>
</sm:activationSpec>

 

InOut

This example performs an InOut. So the dynamic proxy will call into the JBI container, block until a response is available and then return the unmarshalled value to the caller of the dynamic proxy's method.

<sm:activationSpec componentName="reflectionCounter"
           service="foo:reflectionCounter" 
           endpoint="reflectionCounter">
  <sm:component><bean class="org.apache.servicemix.components.reflection.ReflectionOutBinding">
    <property name="target" ref="counter"/>
  </bean></sm:component>
</sm:activationSpec>