You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cz...@apache.org on 2016/08/08 12:18:06 UTC
svn commit: r1755500 -
/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java
Author: cziegeler
Date: Mon Aug 8 12:18:05 2016
New Revision: 1755500
URL: http://svn.apache.org/viewvc?rev=1755500&view=rev
Log:
FELIX-5321 : Include service.ranking of servlet context helpers in web console output
Modified:
felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java
Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java?rev=1755500&r1=1755499&r2=1755500&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java (original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java Mon Aug 8 12:18:05 2016
@@ -413,6 +413,17 @@ public class HttpServicePlugin extends H
pw.println("<th class=\"header\">${Value)}</th>");
pw.println("</tr></thead>");
odd = printRow(pw, odd, "${Path}", getContextPath(dto.contextPath));
+ final ServiceReference<?> ref = this.getServiceReference(dto.serviceId);
+ if ( ref != null )
+ {
+ int ranking = 0;
+ final Object obj = ref.getProperty(Constants.SERVICE_RANKING);
+ if ( obj instanceof Integer)
+ {
+ ranking = (Integer)obj;
+ }
+ odd = printRow(pw, odd, "${ranking}", String.valueOf(ranking));
+ }
odd = printRow(pw, odd, "${service.id}", String.valueOf(dto.serviceId));
pw.println("</table>");
@@ -1057,6 +1068,18 @@ public class HttpServicePlugin extends H
pw.print("Path : ");
pw.println(getContextPath(ctxDto.contextPath));
+ final ServiceReference<?> ref = this.getServiceReference(ctxDto.serviceId);
+ if ( ref != null )
+ {
+ int ranking = 0;
+ final Object obj = ref.getProperty(Constants.SERVICE_RANKING);
+ if ( obj instanceof Integer)
+ {
+ ranking = (Integer)obj;
+ }
+ pw.print("Ranking : ");
+ pw.println(String.valueOf(ranking));
+ }
pw.print("service.id : ");
pw.println(String.valueOf(ctxDto.serviceId));
pw.println();
Re: svn commit: r1755500 - /felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java
Posted by Chetan Mehrotra <ch...@gmail.com>.
On Tue, Aug 9, 2016 at 1:54 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> There is no unget service reference, the code is just getting the
> reference, not the service
Ah missed that part. Makes sense
Chetan Mehrotra
Re: svn commit: r1755500 -
/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java
Posted by Carsten Ziegeler <cz...@apache.org>.
> On Mon, Aug 8, 2016 at 5:48 PM, <cz...@apache.org> wrote:
>> + final ServiceReference<?> ref = this.getServiceReference(dto.serviceId);
>
> Probably an unget would also need to be done?
>
There is no unget service reference, the code is just getting the
reference, not the service
Carsten
--
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org
Re: svn commit: r1755500 - /felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java
Posted by Chetan Mehrotra <ch...@gmail.com>.
On Mon, Aug 8, 2016 at 5:48 PM, <cz...@apache.org> wrote:
> + final ServiceReference<?> ref = this.getServiceReference(dto.serviceId);
Probably an unget would also need to be done?
Chetan Mehrotra