/**
* Represents an interface provided by a component.
+ * Different component objects should never share ProvidedInterface instances!
*
* @author Erik Brakkee
*/
Class[] getInterfaceTypes();
/**
- * Publish an implementation of the interface.
- * @param aImplementation
+ * Sets a unique id of the provided interface to identify it within a given scope.
+ * Will be called by the container as part of calling {@link #publish(Object, Scope)}.
+ * @param aId Unique id.
*/
- void publish(Object aImplementation);
-
+ void setUniqueId(String aId);
+
+ /**
+ * Gets the unique if of the provided interface. This is set by the container
+ * using {@link #setUniqueId(String)}.
+ */
+ String getUniqueId();
+
/**
- * Gets the implementation.
- * @return Implementation or null if not started.
+ * Publishes an implementation of the interface. The implementation must
+ * call {@link Scope#publishInterface(ProvidedInterface, Object)} to publish the
+ * interface implementation in a given scope.
+ * @param aImplementation Implementation to publish.
+ * @param aScope Scope in which to publish the implementation.
*/
- Object getImplementation();
+ void publish(Object aImplementation, Scope aScope);
}