aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r1013145 - in /websites/staging/aries/trunk/content: ./ modules/containers.html
Date Tue, 30 May 2017 11:06:30 GMT
Author: buildbot
Date: Tue May 30 11:06:30 2017
New Revision: 1013145

Log:
Staging update by buildbot for aries

Modified:
    websites/staging/aries/trunk/content/   (props changed)
    websites/staging/aries/trunk/content/modules/containers.html

Propchange: websites/staging/aries/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue May 30 11:06:30 2017
@@ -1 +1 @@
-1796653
+1796830

Modified: websites/staging/aries/trunk/content/modules/containers.html
==============================================================================
--- websites/staging/aries/trunk/content/modules/containers.html (original)
+++ websites/staging/aries/trunk/content/modules/containers.html Tue May 30 11:06:30 2017
@@ -325,6 +325,28 @@ from the service registry, they need to
 The servlet provides a simple UI to perform some of the management operations.</p>
 <p>The servlet is written using OSGi Declarative Service annotations and OSGi Http
Whiteboard annotations and can be found here: 
 <a href="https://git-wip-us.apache.org/repos/asf?p=aries-containers.git;a=blob;f=containers-examples/containers-example-osgiservlet/src/main/java/org/apache/aries/containers/examples/osgiservlet/ServiceManagerServlet.java;h=5783718d0ba80a612cf44a331a45aefeb6e71ebf;hb=HEAD">ServiceManagerServlet.java</a></p>
+<p>Main part of the functionality of the servlet can be summarized as follows:</p>
+<div class="codehilite"><pre>@Component(service = Servlet.class,
+    property = {HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN + &quot;=/manager&quot;})
+public class ServiceManagerServlet extends HttpServlet {
+
+@Reference
+ServiceManager serviceManager;
+
+@Override
+protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
IOException {
+    PrintWriter pw = resp.getWriter();
+    pw.println(&quot;<span class="nt">&lt;BODY&gt;&lt;H1&gt;</span>Service
Deployments<span class="nt">&lt;/H1&gt;</span>&quot;);
+
+    pw.println(&quot;<span class="nt">&lt;UL&gt;</span>&quot;);
+    for (String dep : serviceManager.listServices()) {
+        pw.println(&quot;<span class="nt">&lt;LI&gt;</span>&quot;
+ dep);
+    }
+</pre></div>
+
+
+<p>In short - an OSGi Declarative Service Component is registered as a HTTP Whiteboard
Servet. The Aries Containers Service Manager is
+injected into the <code>serviceManager</code> field and then used in the servlet
to manage the deployment.</p>
 <p>TODO: Describe how to run the servlet using a small Felix setup.</p>
 <h2 id="plain-java-example">Plain Java example<a class="headerlink" href="#plain-java-example"
title="Permanent link">&para;</a></h2>
 <p>This example launches a small Java Application to create a service deployment. Initially
a single container is deployed. The user can 



Mime
View raw message