Hi,
I think the SPI models for SCDL service/reference/binding are now becoming
out of sync with the SCA spec. The introduction of BindlessServiceDefinition
(I view it as a service with NullBinding) also worries me.
Here's the SCDL syntax extracted from the SCA spec 0.96 draft.
<service name="xs:NCName" multiplicity="0..1 or 1..1 or 0..n or 1..n"?>*
<interface/>
<binding uri="xs:anyURI"?/>*
<reference>wire-target-URI</reference>+
</service>
<reference name="xs:NCName" override="sca:OverrideOptions"?
multiplicity="0..1 or 1..1 or 0..n or 1..n"?>*
<interface/>
<binding uri="xs:anyURI"?/>*
</reference>
I plan to some changes to the models to reflect the spec as attached below.
With the updated model, the BindingBuilder could simply deal with the
binding contained by either the ServiceDefinition or ReferenceDefinition.
What do you guys think?
Thanks,
Raymond
public class ServiceDefinition extends ModelObject {
private String name;
private ServiceContract serviceContract;
private boolean remotable;
private String callbackRefName;
private Multiplicity multiplicity;
private List<Binding<ServiceDefinition>> bindings = new
ArrayList<Binding<ServiceDefinition>>(); // 0 or more bindings
private List<URI> references = new ArrayList<URI>(); // 1 or more
references depending on the mulitplicity
public ServiceDefinition() {
}
public ServiceDefinition(String name, ServiceContract serviceContract,
boolean remotable) {
this.name = name;
this.serviceContract = serviceContract;
this.remotable = remotable;
}
public ServiceDefinition(String name, ServiceContract serviceContract,
boolean remotable, String callbackRefName) {
this.name = name;
this.serviceContract = serviceContract;
this.remotable = remotable;
this.callbackRefName = callbackRefName;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public ServiceContract getServiceContract() {
return serviceContract;
}
public void setServiceContract(ServiceContract serviceContract) {
this.serviceContract = serviceContract;
}
public boolean isRemotable() {
return remotable;
}
public void setRemotable(boolean remotable) {
this.remotable = remotable;
}
/**
* Returns the callback name.
*/
public String getCallbackReferenceName() {
return callbackRefName;
}
public void setCallbackReferenceName(String callbackRefName) {
this.callbackRefName = callbackRefName;
}
public Multiplicity getMultiplicity() {
return multiplicity;
}
public void setMultiplicity(Multiplicity multiplicity) {
this.multiplicity = multiplicity;
}
public List<Binding<ServiceDefinition>> getBindings() {
return bindings;
}
public List<URI> getReferences() {
return references;
}
}
public class ReferenceDefinition extends ModelObject {
private String name;
private ServiceContract serviceContract;
private Multiplicity multiplicity;
private boolean autowire;
private boolean required;
private List<Binding<ReferenceDefinition>> bindings = new
ArrayList<Binding<ReferenceDefinition>>();
public ReferenceDefinition() {
}
public ReferenceDefinition(String name, ServiceContract serviceContract) {
this.name = name;
this.serviceContract = serviceContract;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public ServiceContract<?> getServiceContract() {
return serviceContract;
}
public void setServiceContract(ServiceContract serviceContract) {
this.serviceContract = serviceContract;
}
public Multiplicity getMultiplicity() {
return multiplicity;
}
public void setMultiplicity(Multiplicity multiplicity) {
this.multiplicity = multiplicity;
}
public boolean isAutowire() {
return autowire;
}
public void setAutowire(boolean autowire) {
this.autowire = autowire;
}
public boolean isRequired() {
return required;
}
public void setRequired(boolean required) {
this.required = required;
}
public List<Binding<ReferenceDefinition>> getBindings() {
return bindings;
}
}
public abstract class Binding<T> extends ModelObject {
protected T parent; // Either the ServiceDefinition or
ReferenceDefinition that owns this binding
protected URI uri;
URI getUri() {
return uri;
}
void setUri(URI uri) {
this.uri = uri;
}
public T getParent() {
return parent;
}
void setParent(T parent) {
this.parent = parent;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]