ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r813624 - in /websites/staging/ace/trunk/content: ./ dev-doc/design/ace-deployment-strategies.html
Date Thu, 19 Apr 2012 08:50:50 GMT
Author: buildbot
Date: Thu Apr 19 08:50:50 2012
New Revision: 813624

Log:
Staging update by buildbot for ace

Modified:
    websites/staging/ace/trunk/content/   (props changed)
    websites/staging/ace/trunk/content/dev-doc/design/ace-deployment-strategies.html

Propchange: websites/staging/ace/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Apr 19 08:50:50 2012
@@ -1 +1 @@
-1327865
+1327872

Modified: websites/staging/ace/trunk/content/dev-doc/design/ace-deployment-strategies.html
==============================================================================
--- websites/staging/ace/trunk/content/dev-doc/design/ace-deployment-strategies.html (original)
+++ websites/staging/ace/trunk/content/dev-doc/design/ace-deployment-strategies.html Thu Apr 19 08:50:50 2012
@@ -187,20 +187,20 @@ The (stub) code for our update task look
 11
 12
 13
-14</pre></div></td><td class="code"><div class="codehilite"><pre><span class="nb">package</span> <span class="n">net</span><span class="o">.</span><span class="n">luminis</span><span class="o">.</span><span class="n">ace</span><span class="o">.</span><span class="n">updatetask</span><span class="p">;</span>
+14</pre></div></td><td class="code"><div class="codehilite"><pre><span class="kn">package</span> <span class="n">net</span><span class="o">.</span><span class="na">luminis</span><span class="o">.</span><span class="na">ace</span><span class="o">.</span><span class="na">updatetask</span><span class="o">;</span>
 
-<span class="nb">import</span> <span class="n">org</span><span class="o">.</span><span class="n">apache</span><span class="o">.</span><span class="n">ace</span><span class="o">.</span><span class="n">deployment</span><span class="o">.</span><span class="n">service</span><span class="o">.</span><span class="n">DeploymentService</span><span class="p">;</span>
-<span class="nb">import</span> <span class="n">org</span><span class="o">.</span><span class="n">osgi</span><span class="o">.</span><span class="n">service</span><span class="o">.</span><span class="nb">log</span><span class="o">.</span><span class="n">LogService</span><span class="p">;</span>
+<span class="kn">import</span> <span class="nn">org.apache.ace.deployment.service.DeploymentService</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.osgi.service.log.LogService</span><span class="o">;</span>
 
-<span class="n">public</span><span class="err"> </span><span class="n">class</span> <span class="n">MyUpdateTask</span> <span class="n">implements</span> <span class="n">Runnable</span> <span class="p">{</span>
-    <span class="sr">//</span> <span class="n">injected</span> <span class="n">by</span> <span class="n">DependencyManager</span>
-<span class="err">   </span> <span class="n">private</span> <span class="n">DeploymentService</span> <span class="n">m_service</span><span class="p">;</span> 
-<span class="err">   </span> <span class="n">private</span> <span class="n">LogService</span> <span class="n">m_logService</span><span class="p">;</span>
-
-<span class="err">   </span> <span class="n">public</span><span class="err"> </span><span class="n">void</span> <span class="n">run</span><span class="p">()</span> <span class="p">{</span>
-<span class="err">       </span> <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;Hello from MyUpdateTask: &quot;</span> <span class="o">+</span> <span class="k">new</span> <span class="n">java</span><span class="o">.</span><span class="n">util</span><span class="o">.</span><span class="n">Date</span><span class="p">());</span>
-<span class="err">   </span> <span class="p">}</span>
-<span class="p">}</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">MyUpdateTask</span> <span class="kd">implements</span> <span class="n">Runnable</span> <span class="o">{</span>
+    <span class="c1">// injected by DependencyManager</span>
+    <span class="kd">private</span> <span class="n">DeploymentService</span> <span class="n">m_service</span><span class="o">;</span> 
+    <span class="kd">private</span> <span class="n">LogService</span> <span class="n">m_logService</span><span class="o">;</span>
+
+    <span class="kd">public</span> <span class="kt">void</span> <span class="nf">run</span><span class="o">()</span> <span class="o">{</span>
+        <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Hello from MyUpdateTask: &quot;</span> <span class="o">+</span> <span class="k">new</span> <span class="n">java</span><span class="o">.</span><span class="na">util</span><span class="o">.</span><span class="na">Date</span><span class="o">());</span>
+    <span class="o">}</span>
+<span class="o">}</span>
 </pre></div>
 </td></tr></table>
 
@@ -240,42 +240,42 @@ The (stub) code for our update task look
 33
 34
 35
-36</pre></div></td><td class="code"><div class="codehilite"><pre><span class="nb">package</span> <span class="n">net</span><span class="o">.</span><span class="n">luminis</span><span class="o">.</span><span class="n">ace</span><span class="o">.</span><span class="n">updatetask</span><span class="p">;</span>
+36</pre></div></td><td class="code"><div class="codehilite"><pre><span class="kn">package</span> <span class="n">net</span><span class="o">.</span><span class="na">luminis</span><span class="o">.</span><span class="na">ace</span><span class="o">.</span><span class="na">updatetask</span><span class="o">;</span>
 
-<span class="nb">import</span> <span class="n">java</span><span class="o">.</span><span class="n">util</span><span class="o">.</span><span class="n">Properties</span><span class="p">;</span>
+<span class="kn">import</span> <span class="nn">java.util.Properties</span><span class="o">;</span>
 
-<span class="nb">import</span> <span class="n">org</span><span class="o">.</span><span class="n">apache</span><span class="o">.</span><span class="n">ace</span><span class="o">.</span><span class="n">deployment</span><span class="o">.</span><span class="n">service</span><span class="o">.</span><span class="n">DeploymentService</span><span class="p">;</span>
-<span class="nb">import</span> <span class="n">org</span><span class="o">.</span><span class="n">apache</span><span class="o">.</span><span class="n">ace</span><span class="o">.</span><span class="n">scheduler</span><span class="o">.</span><span class="n">constants</span><span class="o">.</span><span class="n">SchedulerConstants</span><span class="p">;</span>
-<span class="nb">import</span> <span class="n">org</span><span class="o">.</span><span class="n">apache</span><span class="o">.</span><span class="n">felix</span><span class="o">.</span><span class="n">dm</span><span class="o">.</span><span class="n">DependencyActivatorBase</span><span class="p">;</span>
-<span class="nb">import</span> <span class="n">org</span><span class="o">.</span><span class="n">apache</span><span class="o">.</span><span class="n">felix</span><span class="o">.</span><span class="n">dm</span><span class="o">.</span><span class="n">DependencyManager</span><span class="p">;</span>
-<span class="nb">import</span> <span class="n">org</span><span class="o">.</span><span class="n">osgi</span><span class="o">.</span><span class="n">framework</span><span class="o">.</span><span class="n">BundleContext</span><span class="p">;</span>
-<span class="nb">import</span> <span class="n">org</span><span class="o">.</span><span class="n">osgi</span><span class="o">.</span><span class="n">service</span><span class="o">.</span><span class="nb">log</span><span class="o">.</span><span class="n">LogService</span><span class="p">;</span>
-
-<span class="n">public</span><span class="err"> </span><span class="n">class</span> <span class="n">Activator</span> <span class="n">extends</span> <span class="n">DependencyActivatorBase</span> <span class="p">{</span>
-  <span class="n">public</span> <span class="n">void</span> <span class="n">init</span><span class="p">(</span><span class="n">BundleContext</span> <span class="n">context</span><span class="p">,</span> <span class="n">DependencyManager</span> <span class="n">manager</span><span class="p">)</span> <span class="n">throws</span> <span class="n">Exception</span> <span class="p">{</span>
-    <span class="n">Properties</span> <span class="n">props</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Properties</span><span class="p">();</span>
-    <span class="n">props</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">SchedulerConstants</span><span class="o">.</span><span class="n">SCHEDULER_NAME_KEY</span><span class="p">,</span> <span class="n">MyUpdateTask</span><span class="o">.</span><span class="n">class</span><span class="o">.</span><span class="n">getName</span><span class="p">());</span>
-    <span class="n">props</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">SchedulerConstants</span><span class="o">.</span><span class="n">SCHEDULER_DESCRIPTION_KEY</span><span class="p">,</span> <span class="s">&quot;My own deployment update service.&quot;</span><span class="p">);</span>
-    <span class="n">props</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">SchedulerConstants</span><span class="o">.</span><span class="n">SCHEDULER_RECIPE</span><span class="p">,</span> <span class="s">&quot;5000&quot;</span><span class="p">);</span>
-
-    <span class="n">manager</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">createComponent</span><span class="p">()</span>
-      <span class="o">.</span><span class="n">setInterface</span><span class="p">(</span><span class="n">Runnable</span><span class="o">.</span><span class="n">class</span><span class="o">.</span><span class="n">getName</span><span class="p">(),</span> <span class="n">props</span><span class="p">)</span>
-      <span class="o">.</span><span class="n">setImplementation</span><span class="p">(</span><span class="k">new</span> <span class="n">MyUpdateTask</span><span class="p">())</span>
-      <span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">createServiceDependency</span><span class="p">()</span>
-        <span class="o">.</span><span class="n">setService</span><span class="p">(</span><span class="n">DeploymentService</span><span class="o">.</span><span class="n">class</span><span class="p">)</span>
-        <span class="o">.</span><span class="n">setRequired</span><span class="p">(</span><span class="n">true</span><span class="p">)</span>
-      <span class="p">)</span>
-      <span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">createServiceDependency</span><span class="p">()</span>
-        <span class="o">.</span><span class="n">setService</span><span class="p">(</span><span class="n">LogService</span><span class="o">.</span><span class="n">class</span><span class="p">)</span>
-        <span class="o">.</span><span class="n">setRequired</span><span class="p">(</span><span class="n">false</span><span class="p">)</span>
-      <span class="p">)</span>
-    <span class="p">);</span>
-  <span class="p">}</span>
-
-  <span class="n">public</span> <span class="n">void</span> <span class="n">destroy</span><span class="p">(</span><span class="n">BundleContext</span> <span class="n">context</span><span class="p">,</span> <span class="n">DependencyManager</span> <span class="n">manager</span><span class="p">)</span> <span class="n">throws</span> <span class="n">Exception</span> <span class="p">{</span>
-    <span class="sr">//</span> <span class="n">Nothing</span>
-  <span class="p">}</span>
-<span class="p">}</span>
+<span class="kn">import</span> <span class="nn">org.apache.ace.deployment.service.DeploymentService</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.apache.ace.scheduler.constants.SchedulerConstants</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.apache.felix.dm.DependencyActivatorBase</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.apache.felix.dm.DependencyManager</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.osgi.framework.BundleContext</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.osgi.service.log.LogService</span><span class="o">;</span>
+
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">Activator</span> <span class="kd">extends</span> <span class="n">DependencyActivatorBase</span> <span class="o">{</span>
+  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">init</span><span class="o">(</span><span class="n">BundleContext</span> <span class="n">context</span><span class="o">,</span> <span class="n">DependencyManager</span> <span class="n">manager</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
+    <span class="n">Properties</span> <span class="n">props</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Properties</span><span class="o">();</span>
+    <span class="n">props</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">SchedulerConstants</span><span class="o">.</span><span class="na">SCHEDULER_NAME_KEY</span><span class="o">,</span> <span class="n">MyUpdateTask</span><span class="o">.</span><span class="na">class</span><span class="o">.</span><span class="na">getName</span><span class="o">());</span>
+    <span class="n">props</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">SchedulerConstants</span><span class="o">.</span><span class="na">SCHEDULER_DESCRIPTION_KEY</span><span class="o">,</span> <span class="s">&quot;My own deployment update service.&quot;</span><span class="o">);</span>
+    <span class="n">props</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">SchedulerConstants</span><span class="o">.</span><span class="na">SCHEDULER_RECIPE</span><span class="o">,</span> <span class="s">&quot;5000&quot;</span><span class="o">);</span>
+
+    <span class="n">manager</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="n">createComponent</span><span class="o">()</span>
+      <span class="o">.</span><span class="na">setInterface</span><span class="o">(</span><span class="n">Runnable</span><span class="o">.</span><span class="na">class</span><span class="o">.</span><span class="na">getName</span><span class="o">(),</span> <span class="n">props</span><span class="o">)</span>
+      <span class="o">.</span><span class="na">setImplementation</span><span class="o">(</span><span class="k">new</span> <span class="n">MyUpdateTask</span><span class="o">())</span>
+      <span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="n">createServiceDependency</span><span class="o">()</span>
+        <span class="o">.</span><span class="na">setService</span><span class="o">(</span><span class="n">DeploymentService</span><span class="o">.</span><span class="na">class</span><span class="o">)</span>
+        <span class="o">.</span><span class="na">setRequired</span><span class="o">(</span><span class="kc">true</span><span class="o">)</span>
+      <span class="o">)</span>
+      <span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="n">createServiceDependency</span><span class="o">()</span>
+        <span class="o">.</span><span class="na">setService</span><span class="o">(</span><span class="n">LogService</span><span class="o">.</span><span class="na">class</span><span class="o">)</span>
+        <span class="o">.</span><span class="na">setRequired</span><span class="o">(</span><span class="kc">false</span><span class="o">)</span>
+      <span class="o">)</span>
+    <span class="o">);</span>
+  <span class="o">}</span>
+
+  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">destroy</span><span class="o">(</span><span class="n">BundleContext</span> <span class="n">context</span><span class="o">,</span> <span class="n">DependencyManager</span> <span class="n">manager</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
+    <span class="c1">// Nothing</span>
+  <span class="o">}</span>
+<span class="o">}</span>
 </pre></div>
 </td></tr></table>
 
@@ -338,30 +338,30 @@ If everything went well, one of the firs
 21
 22
 23
-24</pre></div></td><td class="code"><div class="codehilite"><pre><span class="err"> </span> <span class="err">  </span><span class="n">public</span><span class="err"> </span><span class="n">void</span> <span class="n">run</span><span class="p">()</span> <span class="p">{</span>
-<span class="err">       </span> <span class="n">try</span> <span class="p">{</span>
-<span class="err">           </span> <span class="n">Version</span> <span class="nb">local</span> <span class="o">=</span> <span class="n">m_service</span><span class="o">.</span><span class="n">getHighestLocalVersion</span><span class="p">();</span>
-<span class="err">           </span> <span class="n">Version</span> <span class="n">remote</span> <span class="o">=</span> <span class="n">m_service</span><span class="o">.</span><span class="n">getHighestRemoteVersion</span><span class="p">();</span>
-
-<span class="err">           </span> <span class="k">if</span> <span class="p">((</span><span class="n">remote</span> <span class="o">!=</span> <span class="n">null</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">((</span><span class="nb">local</span> <span class="o">==</span> <span class="n">null</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="n">remote</span><span class="o">.</span><span class="n">compareTo</span><span class="p">(</span><span class="nb">local</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)))</span> <span class="p">{</span>
-<span class="err">               </span> <span class="sr">//</span> <span class="n">Ask</span> <span class="n">user</span> <span class="n">whether</span> <span class="n">this</span> <span class="n">update</span> <span class="n">should</span> <span class="n">proceed</span><span class="o">...</span>
-<span class="err">               </span> <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;Update available! Upgrade from &quot;</span> <span class="o">+</span> <span class="nb">local</span> <span class="o">+</span> <span class="s">&quot; to &quot;</span> <span class="o">+</span> <span class="n">remote</span> <span class="o">+</span> <span class="s">&quot; [Y/N]?&quot;</span><span class="p">);</span>
-
-<span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="n">BufferedReader</span> <span class="n">reader</span> <span class="o">=</span> <span class="k">new</span> <span class="n">BufferedReader</span><span class="p">(</span><span class="k">new</span> <span class="n">InputStreamReader</span><span class="p">(</span><span class="n">System</span><span class="o">.</span><span class="n">in</span><span class="p">));</span>
-<span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="n">String</span> <span class="n">result</span> <span class="o">=</span> <span class="n">reader</span><span class="o">.</span><span class="n">readLine</span><span class="p">();</span>
-
-<span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err">  </span><span class="k">if</span> <span class="p">(</span><span class="s">&quot;y&quot;</span><span class="o">.</span><span class="n">equalsIgnoreCase</span><span class="p">(</span><span class="n">result</span><span class="p">))</span> <span class="p">{</span>
-<span class="err">                   </span> <span class="sr">//</span> <span class="n">Ask</span> <span class="n">the</span> <span class="n">deployer</span> <span class="n">service</span> <span class="n">to</span> <span class="n">install</span> <span class="n">this</span> <span class="n">update</span><span class="o">...</span>
-<span class="err">                   </span> <span class="n">m_service</span><span class="o">.</span><span class="n">installVersion</span><span class="p">(</span><span class="n">remote</span><span class="p">,</span> <span class="nb">local</span><span class="p">);</span>
-
-<span class="err">                   </span> <span class="n">m_logService</span><span class="o">.</span><span class="nb">log</span><span class="p">(</span><span class="n">LogService</span><span class="o">.</span><span class="n">LOG_INFO</span><span class="p">,</span> <span class="s">&quot;Update installed!&quot;</span><span class="p">);</span>
-<span class="err">               </span> <span class="p">}</span>
-<span class="err">           </span> <span class="p">}</span>
-<span class="err">       </span> <span class="p">}</span> <span class="n">catch</span> <span class="p">(</span><span class="n">IOException</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
-<span class="err">           </span> <span class="n">m_logService</span><span class="o">.</span><span class="nb">log</span><span class="p">(</span><span class="n">LogService</span><span class="o">.</span><span class="n">LOG_WARNING</span><span class="p">,</span> <span class="s">&quot;Update failed!&quot;</span><span class="p">,</span> <span class="n">e</span><span class="p">);</span>
-<span class="err">       </span> <span class="p">}</span> <span class="n">catch</span> <span class="p">(</span><span class="n">Exception</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
-<span class="err">           </span> <span class="n">m_logService</span><span class="o">.</span><span class="nb">log</span><span class="p">(</span><span class="n">LogService</span><span class="o">.</span><span class="n">LOG_WARNING</span><span class="p">,</span> <span class="s">&quot;Update failed!&quot;</span><span class="p">,</span> <span class="n">e</span><span class="p">);</span>
-<span class="err">       </span> <span class="p">}</span>
+24</pre></div></td><td class="code"><div class="codehilite"><pre><span class="kd">public</span> <span class="kt">void</span> <span class="nf">run</span><span class="o">()</span> <span class="o">{</span>
+    <span class="k">try</span> <span class="o">{</span>
+        <span class="n">Version</span> <span class="n">local</span> <span class="o">=</span> <span class="n">m_service</span><span class="o">.</span><span class="na">getHighestLocalVersion</span><span class="o">();</span>
+        <span class="n">Version</span> <span class="n">remote</span> <span class="o">=</span> <span class="n">m_service</span><span class="o">.</span><span class="na">getHighestRemoteVersion</span><span class="o">();</span>
+
+        <span class="k">if</span> <span class="o">((</span><span class="n">remote</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">((</span><span class="n">local</span> <span class="o">==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="n">remote</span><span class="o">.</span><span class="na">compareTo</span><span class="o">(</span><span class="n">local</span><span class="o">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="o">)))</span> <span class="o">{</span>
+            <span class="c1">// Ask user whether this update should proceed...</span>
+            <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Update available! Upgrade from &quot;</span> <span class="o">+</span> <span class="n">local</span> <span class="o">+</span> <span class="s">&quot; to &quot;</span> <span class="o">+</span> <span class="n">remote</span> <span class="o">+</span> <span class="s">&quot; [Y/N]?&quot;</span><span class="o">);</span>
+
+            <span class="n">BufferedReader</span> <span class="n">reader</span> <span class="o">=</span> <span class="k">new</span> <span class="n">BufferedReader</span><span class="o">(</span><span class="k">new</span> <span class="n">InputStreamReader</span><span class="o">(</span><span class="n">System</span><span class="o">.</span><span class="na">in</span><span class="o">));</span>
+            <span class="n">String</span> <span class="n">result</span> <span class="o">=</span> <span class="n">reader</span><span class="o">.</span><span class="na">readLine</span><span class="o">();</span>
+
+            <span class="k">if</span> <span class="o">(</span><span class="s">&quot;y&quot;</span><span class="o">.</span><span class="na">equalsIgnoreCase</span><span class="o">(</span><span class="n">result</span><span class="o">))</span> <span class="o">{</span>
+                <span class="c1">// Ask the deployer service to install this update...</span>
+                <span class="n">m_service</span><span class="o">.</span><span class="na">installVersion</span><span class="o">(</span><span class="n">remote</span><span class="o">,</span> <span class="n">local</span><span class="o">);</span>
+
+                <span class="n">m_logService</span><span class="o">.</span><span class="na">log</span><span class="o">(</span><span class="n">LogService</span><span class="o">.</span><span class="na">LOG_INFO</span><span class="o">,</span> <span class="s">&quot;Update installed!&quot;</span><span class="o">);</span>
+            <span class="o">}</span>
+        <span class="o">}</span>
+    <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">IOException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
+        <span class="n">m_logService</span><span class="o">.</span><span class="na">log</span><span class="o">(</span><span class="n">LogService</span><span class="o">.</span><span class="na">LOG_WARNING</span><span class="o">,</span> <span class="s">&quot;Update failed!&quot;</span><span class="o">,</span> <span class="n">e</span><span class="o">);</span>
+    <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">Exception</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
+        <span class="n">m_logService</span><span class="o">.</span><span class="na">log</span><span class="o">(</span><span class="n">LogService</span><span class="o">.</span><span class="na">LOG_WARNING</span><span class="o">,</span> <span class="s">&quot;Update failed!&quot;</span><span class="o">,</span> <span class="n">e</span><span class="o">);</span>
+<span class="o">}</span>
 </pre></div>
 </td></tr></table>
 
@@ -407,44 +407,46 @@ Let's explore this method a bit more int
 35
 36
 37
-38</pre></div></td><td class="code"><div class="codehilite"><pre><span class="err"> </span> <span class="err">  </span><span class="sr">//</span> <span class="n">injected</span> <span class="n">by</span> <span class="n">Felix</span><span class="err">&#39; </span><span class="n">dependency</span> <span class="n">manager</span>
-<span class="err"> </span> <span class="err">  </span><span class="n">volatile</span> <span class="n">Deployment</span> <span class="n">m_deployer</span><span class="p">;</span>
-<span class="err"> </span> <span class="err">  </span><span class="n">volatile</span> <span class="n">EventAdmin</span> <span class="n">m_eventAdmin</span><span class="p">;</span>
-<span class="err"> </span> <span class="err">  </span><span class="n">volatile</span> <span class="n">Identification</span> <span class="n">m_identification</span><span class="p">;</span>
-<span class="err"> </span> <span class="err">  </span><span class="sr">//</span> <span class="n">denotes</span> <span class="n">the</span> <span class="n">host</span> <span class="o">+</span> <span class="n">port</span> <span class="n">where</span> <span class="n">ACE</span> <span class="n">is</span> <span class="n">listening</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">g</span><span class="o">.</span> <span class="n">http:</span><span class="sr">//</span><span class="mf">192.168.1.1</span><span class="p">:</span><span class="mi">8080</span><span class="o">/</span>
-<span class="err"> </span> <span class="err"> </span> <span class="n">final</span><span class="err"> </span><span class="n">String</span><span class="err"> </span><span class="n">m_host</span><span class="p">;</span>
-
-<span class="err"> </span> <span class="err">  </span><span class="o">/**</span>
-<span class="err">    </span> <span class="o">*</span> <span class="nv">@see</span> <span class="n">org</span><span class="o">.</span><span class="n">apache</span><span class="o">.</span><span class="n">ace</span><span class="o">.</span><span class="n">deployment</span><span class="o">.</span><span class="n">service</span><span class="o">.</span><span class="n">impl</span><span class="o">.</span><span class="n">DeploymentServiceImpl</span><span class="c1">#installVersion</span>
-<span class="err">    </span> <span class="o">*/</span>
-<span class="err">   </span> <span class="n">public</span><span class="err"> </span><span class="n">void</span> <span class="n">installVersion</span><span class="p">(</span><span class="n">Version</span> <span class="n">highestRemoteVersion</span><span class="p">,</span> <span class="n">Version</span> <span class="n">highestLocalVersion</span><span class="p">)</span> <span class="n">throws</span><span class="err"> </span><span class="n">Exception</span> <span class="p">{</span>
-<span class="err">       </span> <span class="n">InputStream</span> <span class="n">inputStream</span> <span class="o">=</span> <span class="n">null</span><span class="p">;</span>
-<span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err">  </span>
-<span class="err">       </span> <span class="n">try</span> <span class="p">{</span>
-<span class="err">           </span> <span class="n">String</span> <span class="n">version</span> <span class="o">=</span> <span class="n">highestRemoteVersion</span><span class="o">.</span><span class="n">toString</span><span class="p">();</span>
-<span class="err">           </span> <span class="n">URL</span> <span class="n">baseURL</span> <span class="o">=</span><span class="err"> </span><span class="k">new</span> <span class="n">URL</span><span class="p">(</span><span class="n">m_host</span><span class="p">,</span> <span class="s">&quot;deployment/&quot;</span> <span class="o">+</span> <span class="n">m_identification</span><span class="o">.</span><span class="n">getID</span><span class="p">()</span> <span class="o">+</span> <span class="s">&quot;/versions/&quot;</span><span class="p">);</span>
-<span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err">  </span><span class="k">if</span> <span class="p">(</span><span class="n">highestLocalVersion</span> <span class="o">!=</span> <span class="n">null</span><span class="p">)</span> <span class="p">{</span>
-<span class="err">               </span> <span class="n">version</span> <span class="o">+=</span> <span class="s">&quot;?current=&quot;</span> <span class="o">+</span> <span class="n">highestLocalVersion</span><span class="o">.</span><span class="n">toString</span><span class="p">();</span>
-<span class="err">           </span> <span class="p">}</span>
-<span class="err">          </span>  <span class="n">URL</span> <span class="n">dataURL</span> <span class="o">=</span> <span class="k">new</span> <span class="n">URL</span><span class="p">(</span><span class="n">baseURL</span><span class="p">,</span> <span class="n">version</span><span class="p">);</span>
-<span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="n">inputStream</span> <span class="o">=</span> <span class="n">dataURL</span><span class="o">.</span><span class="n">openStream</span><span class="p">();</span>
-
-<span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err">  </span><span class="sr">//</span> <span class="n">Post</span> <span class="n">event</span> <span class="k">for</span> <span class="n">audit</span> <span class="nb">log</span>
-<span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="err"> </span> <span class="n">String</span> <span class="n">topic</span><span class="err"> </span><span class="o">=</span> <span class="s">&quot;org/apache/ace/deployment/INSTALL&quot;</span><span class="p">;</span>
-<span class="err">           </span> <span class="n">m_eventAdmin</span><span class="o">.</span><span class="n">postEvent</span><span class="p">(</span><span class="n">createEvent</span><span class="p">(</span><span class="n">topic</span><span class="p">,</span> <span class="n">version</span><span class="p">,</span> <span class="n">dataURL</span><span class="p">));</span>
-
-<span class="err">           </span> <span class="n">m_deployer</span><span class="o">.</span><span class="n">install</span><span class="p">(</span><span class="n">inputStream</span><span class="p">);</span>
-<span class="err">       </span> <span class="p">}</span>
-<span class="err">       </span> <span class="n">finally</span> <span class="p">{</span>
-<span class="err">           </span> <span class="k">if</span> <span class="p">(</span><span class="n">inputStream</span> <span class="o">!=</span> <span class="n">null</span><span class="p">)</span> <span class="p">{</span>
-<span class="err">               </span> <span class="n">try</span> <span class="p">{</span>
-<span class="err">                   </span> <span class="n">inputStream</span><span class="o">.</span><span class="nb">close</span><span class="p">();</span>
-<span class="err">               </span> <span class="p">}</span>
-<span class="err">               </span> <span class="n">catch</span> <span class="p">(</span><span class="n">Exception</span> <span class="n">ex</span><span class="p">)</span> <span class="p">{</span>
-<span class="err">                   </span> <span class="sr">//</span> <span class="n">Not</span> <span class="n">much</span> <span class="n">we</span> <span class="n">can</span> <span class="k">do</span><span class="o">.</span>
-<span class="err">               </span> <span class="p">}</span>
-<span class="err">           </span> <span class="p">}</span>
-<span class="err">       </span> <span class="p">}</span>
+38
+39</pre></div></td><td class="code"><div class="codehilite"><pre><span class="c1">// injected by Felix&#39; dependency manager</span>
+<span class="kd">volatile</span> <span class="n">Deployment</span> <span class="n">m_deployer</span><span class="o">;</span>
+<span class="kd">volatile</span> <span class="n">EventAdmin</span> <span class="n">m_eventAdmin</span><span class="o">;</span>
+<span class="kd">volatile</span> <span class="n">Identification</span> <span class="n">m_identification</span><span class="o">;</span>
+<span class="c1">// denotes the host + port where ACE is listening, e.g. http://192.168.1.1:8080/</span>
+<span class="kd">final</span> <span class="n">String</span> <span class="n">m_host</span><span class="o">;</span>
+
+<span class="cm">/**</span>
+<span class="cm"> * @see org.apache.ace.deployment.service.impl.DeploymentServiceImpl#installVersion</span>
+<span class="cm">*/</span>
+<span class="kd">public</span> <span class="kt">void</span> <span class="nf">installVersion</span><span class="o">(</span><span class="n">Version</span> <span class="n">highestRemoteVersion</span><span class="o">,</span> <span class="n">Version</span> <span class="n">highestLocalVersion</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
+    <span class="n">InputStream</span> <span class="n">inputStream</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
+
+    <span class="k">try</span> <span class="o">{</span>
+        <span class="n">String</span> <span class="n">version</span> <span class="o">=</span> <span class="n">highestRemoteVersion</span><span class="o">.</span><span class="na">toString</span><span class="o">();</span>
+        <span class="n">URL</span> <span class="n">baseURL</span> <span class="o">=</span> <span class="k">new</span> <span class="n">URL</span><span class="o">(</span><span class="n">m_host</span><span class="o">,</span> <span class="s">&quot;deployment/&quot;</span> <span class="o">+</span> <span class="n">m_identification</span><span class="o">.</span><span class="na">getID</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot;/versions/&quot;</span><span class="o">);</span>
+        <span class="k">if</span> <span class="o">(</span><span class="n">highestLocalVersion</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
+            <span class="n">version</span> <span class="o">+=</span> <span class="s">&quot;?current=&quot;</span> <span class="o">+</span> <span class="n">highestLocalVersion</span><span class="o">.</span><span class="na">toString</span><span class="o">();</span>
+        <span class="o">}</span>
+        <span class="n">URL</span> <span class="n">dataURL</span> <span class="o">=</span> <span class="k">new</span> <span class="n">URL</span><span class="o">(</span><span class="n">baseURL</span><span class="o">,</span> <span class="n">version</span><span class="o">);</span>
+        <span class="n">inputStream</span> <span class="o">=</span> <span class="n">dataURL</span><span class="o">.</span><span class="na">openStream</span><span class="o">();</span>
+
+        <span class="c1">// Post event for audit log</span>
+        <span class="n">String</span> <span class="n">topic</span> <span class="o">=</span> <span class="s">&quot;org/apache/ace/deployment/INSTALL&quot;</span><span class="o">;</span>
+        <span class="n">m_eventAdmin</span><span class="o">.</span><span class="na">postEvent</span><span class="o">(</span><span class="n">createEvent</span><span class="o">(</span><span class="n">topic</span><span class="o">,</span> <span class="n">version</span><span class="o">,</span> <span class="n">dataURL</span><span class="o">));</span>
+
+        <span class="n">m_deployer</span><span class="o">.</span><span class="na">install</span><span class="o">(</span><span class="n">inputStream</span><span class="o">);</span>
+    <span class="o">}</span>
+    <span class="k">finally</span> <span class="o">{</span>
+        <span class="k">if</span> <span class="o">(</span><span class="n">inputStream</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
+            <span class="k">try</span> <span class="o">{</span>
+                <span class="n">inputStream</span><span class="o">.</span><span class="na">close</span><span class="o">();</span>
+            <span class="o">}</span>
+            <span class="k">catch</span> <span class="o">(</span><span class="n">Exception</span> <span class="n">ex</span><span class="o">)</span> <span class="o">{</span>
+                <span class="c1">// Not much we can do.</span>
+            <span class="o">}</span>
+        <span class="o">}</span>
+    <span class="o">}</span>
+<span class="o">}</span>
 </pre></div>
 </td></tr></table>
 



Mime
View raw message