Chapter 4. Application Basics
Figure 4.1. Composite
switchyard.xml configuration file as designed in the SwitchYard graphical editor and the corresponding source XML which is automatically generated from the visual design.
4.1. Composite Copy linkLink copied to clipboard!
name and a targetNamespace. The targetNamespace value is important as it allows names defined locally in the application (for example, service names) to be qualified and unique within a SwitchYard runtime.
Figure 4.2. Composite
Example 4.1. Sample Corresponding XML
<sca:composite name="example" targetNamespace="urn:example:switchyard:1.0">
</sca:composite>
4.2. Component Copy linkLink copied to clipboard!
- 0 or 1 component service definitions
- 0 to many component reference definitions
- 1 implementation
Figure 4.3. Component
Example 4.2. Sample Corresponding XML
<sca:component name="Routing">
</sca:component>
4.3. Implementation Copy linkLink copied to clipboard!
- Bean : allows a CDI Bean to consume or provide services using annotations
- Camel : EIP-style routing and service composition using the XML or Java DSL in Apache Camel
- BPMN 2 : service orchestration and human task integration expressed as BPMN 2 and executed using jBPM
- BPEL Process : web service orchestration using the OASIS Business Process Execution Language
- Rules : decision services based on Drools
Figure 4.4. Implementation
Example 4.3. Sample Corresponding XML
<sca:component name="Routing">
<camel:implementation.camel>
<camel:xml path="RoutingService.xml"/>
</camel:implementation.camel>
</sca:component>
4.4. Component Service Copy linkLink copied to clipboard!
Figure 4.5. Component Service
Example 4.4. Sample Corresponding XML
<sca:component name="Routing">
<camel:implementation.camel>
<camel:xml path="route.xml"/>
</camel:implementation.camel>
<sca:service name="ServiceA">
<sca:interface.java interface="org.example.ServiceA"/>
</sca:service>
</sca:component>
4.5. Composite Service Copy linkLink copied to clipboard!
Figure 4.6. Composite Service
Example 4.5. Sample Corresponding XML
<sca:composite name="example" targetNamespace="urn:example:switchyard:1.0">
<sca:service name="ServiceA" promote="Routing/ServiceA">
<sca:interface.wsdl interface="ServiceA.wsdl#wsdl.porttype(ServiceAPortType)"/>
</sca:service>
</sca:composite>
4.6. Service Binding Copy linkLink copied to clipboard!
Figure 4.7. Service Binding
Example 4.6. Sample Corresponding XML
<sca:composite name="example" targetNamespace="urn:example:switchyard:1.0">
<sca:service name="ServiceA" promote="Routing/ServiceA">
<sca:interface.wsdl interface="ServiceA.wsdl#wsdl.porttype(ServiceAPortType)"/>
<soap:binding.soap>
<soap:wsdl>ServiceA.wsdl</soap:wsdl>
</soap:binding.soap>
</sca:service>
</sca:composite>
4.7. Component Reference Copy linkLink copied to clipboard!
Figure 4.8. Component Reference
Example 4.7. Sample Corresponding XML
<sca:component name="Routing">
<camel:implementation.camel>
<camel:xml path="route.xml"/>
</camel:implementation.camel>
<sca:service name="ServiceA">
<sca:interface.java interface="org.example.ServiceA"/>
</sca:service>
<sca:reference name="ServiceC">
<sca:interface.java interface="org.example.ServiceC"/>
</sca:reference>
</sca:component>
4.8. Composite Reference Copy linkLink copied to clipboard!
Figure 4.9. Composite Reference
Example 4.8. Sample Corresponding XML
<sca:composite name="example" targetNamespace="urn:example:switchyard:1.0">
<sca:reference name="ReferenceB" multiplicity="0..1" promote="Routing/ServiceB">
<sca:interface.java interface="org.example.ServiceB"/>
</sca:reference>
</sca:composite>
4.9. Reference Bindings Copy linkLink copied to clipboard!
Figure 4.10. Reference Bindings
Example 4.9. Sample Corresponding XML
<sca:composite name="example" targetNamespace="urn:example:switchyard:1.0">
<sca:reference name="ReferenceB" multiplicity="0..1" promote="Routing/ServiceB">
<sca:interface.java interface="org.example.ServiceB"/>
<jms:binding.jms>
<jms:queue>MyQueue</jms:queue>
<jms:connectionFactory>#ConnectionFactory</jms:connectionFactory>
</jms:binding.jms>
</sca:reference>
</sca:composite>
Note