/**
* @see org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor#read(javax.xml.stream.XMLStreamReader)
*/
public CorbaBinding read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
CorbaBinding binding = factory.createCorbaBinding();
// Read the policies
policyProcessor.readPolicies(binding, reader);
binding.setHost(reader.getAttributeValue(null, "host"));
String port = reader.getAttributeValue(null, "port");
if (port != null) {
binding.setPort(Integer.parseInt(port));
}
// Read the name
String name = reader.getAttributeValue(null, "name");
if (name != null) {
binding.setName(name);
}
// Read binding URI
String uri = reader.getAttributeValue(null, "uri");
if (uri != null) {
binding.setURI(uri);
}
// Read CORBA id
String id = reader.getAttributeValue(null, "id");
if (id != null) {
binding.setId(id);
}
return binding;
}