*/
package org.wamblee.system.core;
-public interface RequiredInterface {
-
+public interface RequiredInterface extends NamedInterface {
+
/**
- * Name for the interface.
+ * @return True iff the required interface is optional.
*/
- public String getName();
+ boolean isOptional();
+
/**
* Checks if the service is provided by a given provided interface.
* Gets the provider interface.
* @return Provider or null if not set.
*/
- ProvidedInterface getProvider();
+ ProvidedInterface getProvider();
/**
- * Gets the implementation of the required interface.
- * @param <T>
- * @param aClass Interface type.
- * @return Interface implementation or null if not known yet.
+ * Determines if the requirements of the current interface are at least those
+ * of the given required interface.
*/
- <T> T getImplementation(Class<T> aClass);
+ boolean covers(RequiredInterface aInterface);
}