private List<Scope> _parents;
private Map<String, Object> _properties;
private Map<String, Object> _runtimes;
- private Map<String, ProvidedInterfaceImplementation> _provided;
+ private Map<ProvidedInterface, ProvidedInterfaceImplementation> _provided;
private ProvidedInterface[] _externallyProvided;
public DefaultScope(ProvidedInterface[] aExternallyProvided) {
_parents = new ArrayList<Scope>(aParent);
_properties = new HashMap<String, Object>();
_runtimes = new HashMap<String, Object>();
- _provided = new HashMap<String, ProvidedInterfaceImplementation>();
+ _provided = new HashMap<ProvidedInterface, ProvidedInterfaceImplementation>();
_externallyProvided = aExternallyProvided;
}
@Override
synchronized public void publishInterface(ProvidedInterface aInterface,
Object aImplementation) {
- String id = UUID.randomUUID().toString();
- _provided.put(id, new ProvidedInterfaceImplementation(aInterface,
+ _provided.put(aInterface, new ProvidedInterfaceImplementation(aInterface,
aImplementation));
- aInterface.setUniqueId(id);
}
@Override
Class<T> aType) {
if ( aInterface == null ) {
return null;
- }
- String id = aInterface.getUniqueId();
- if ( id == null ) {
- // optional interface that was not published.
- return null;
- }
- ProvidedInterfaceImplementation provided = _provided.get(id);
+ }
+ ProvidedInterfaceImplementation provided = _provided.get(aInterface);
if (provided == null) {
for (Scope parent : _parents) {
T impl = parent.getInterfaceImplementation(aInterface, aType);