package com.example.authentication;
public interface Authentication {
boolean authenticate(String username, String password);
}
package com.example.requesthandler;
public interface RequestHandler {
void handleRequest(String url);
}
package com.example.webapp;
public interface WebPageRenderer {
String renderPage(String pageName);
}
<component xmlns="http://www.osgi.org/xmlns/scr/v1.3.0" name="com.example.authentication.AuthenticationComponent">
<implementation class="com.example.authentication.AuthenticationImpl"/>
<service>
<provide interface="com.example.authentication.Authentication"/>
</service>
</component>
<component xmlns="http://www.osgi.org/xmlns/scr/v1.3.0" name="com.example.requesthandler.RequestHandlerComponent">
<implementation class="com.example.requesthandler.RequestHandlerImpl"/>
<reference bind="setAuthentication" interface="com.example.authentication.Authentication"/>
<service>
<provide interface="com.example.requesthandler.RequestHandler"/>
</service>
</component>
<component xmlns="http://www.osgi.org/xmlns/scr/v1.3.0" name="com.example.webapp.WebPageRendererComponent">
<implementation class="com.example.webapp.WebPageRendererImpl"/>
<reference bind="setRequestHandler" interface="com.example.requesthandler.RequestHandler"/>
<service>
<provide interface="com.example.webapp.WebPageRenderer"/>
</service>
</component>