我正试图在osgi捆绑包中使用apache aries进行依赖项注入。这个bundle有一个servlet,它在bundle激活器中注册为服务。我们如何在blueprint config xml中将servlet配置为bean和/或服务?
例如:
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0
http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0/blueprint-cm-1.0.0.xsd">
<bean id="whiteBoardServlet" class="org.ops4j.pax.web.extender.samples.whiteboard.internal.WhiteboardServlet">
<argument type="java.lang.String" value="/whiteboard"/>
</bean>
<service id="whiteBoardServletService" ref="whiteBoardServlet" interface="javax.servlet.Servlet">
<service-properties>
<entry key="alias" value="/whiteboard"/>
</service-properties>
</service>
有关更多详细信息,请访问帕克斯网站示例。