![]() |
| <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://sample/echo" xmlns:se="http://sample/echo" xmlns:e="http://echo" name="EchoBinding"> <service name="EchoService" promote="EchoComponent"> <interface.java interface="echo.Echo"/> <e:binding.echo uri="http://tempuri.org" /> </service> <component name="EchoComponent"> <implementation.java class="echo.EchoComponentImpl"/> </component> <reference name="EchoReference" promote="EchoComponent/echoReference"> <interface.java interface="echo.Echo"/> <e:binding.echo uri="http://tempuri.org" /> </reference> </composite> |
| <element name=“binding.echo" type="sca:EchoBinding" substitutionGroup="sca:binding" /> <complexType name=“EchoBinding"> <complexContent> <extension base="sca:Binding“/> </complexContent> </complexType> |
| /** *AmodelforthesampleEchobinding. */ publicinterface EchoBinding extends Binding { } |
| publicinterface EchoBindingFactory { /** *CreatesanewEchobinding. * *@returnanewEchobinding */ EchoBinding createEchoBinding(); } |
| /** *ImplementationoftheEchobindingmodel. */ publicclass EchoBindingImpl implements EchoBinding { private String name; private String uri; public String getName() { returnname; } public String getURI() { returnuri; } publicvoid setName(String name) { this.name = name; } publicvoid setURI(String uri) { this.uri = uri; } public List<PolicySet> getPolicySets() { // The sample binding does not support policies return Collections.emptyList(); } public List<Intent> getRequiredIntents() { // The sample binding does not support policies return Collections.emptyList(); } public List<Object> getExtensions() { // The sample binding does not support extensions return Collections.emptyList(); } publicboolean isUnresolved() { // The sample binding is always resolved returnfalse; } publicvoid setUnresolved(boolean unresolved) { // The sample binding is always resolved } } |
| publicclass DefaultEchoBindingFactory implements EchoBindingFactory { public EchoBinding createEchoBinding() { returnnew EchoBindingImpl(); } } |