The idea is to provide a similar functionality as the actual Bean Component, Initially I'm planning to implement a custom namespace, that will allow me to declare a switchyard service in a spring application context, first version would look like this:
<swyd:service id="myService" service-interface="org.jboss.switchyard.MyService"/>
This will assume a default location of the configuration file switcyrad.xml, else you will also be able to set by:
<swyd:service id="myService" service-interface="org.jboss.switchyard.MyService">
<property name="conf-file" value="my-switchyard.xml"/>
</swyd:service>
By creating the custom namespace and handlers I should be able to inject, the service in a spring bean (any pojo) by either using annotation:
@Autowired MyService myService;
or as a reference in the spring application context
<bean id="mySpringPojo" class="org.jboss.spring.MethodInvokingFactoryBean">
<property name="staticMethod" ref="myService">
</bean>
As the core concept is the same as the bean component let me know if I'm missing something, possibly at the service definition I should add more properties or something else..
In further version I have been thinking about make possible to declare transformers at application context.