KARAF-1780 Solve serialization issues in log plugin
authorŁukasz Dywicki <ldywicki@apache.org>
Thu, 30 Aug 2012 19:58:03 +0000 (19:58 +0000)
committerŁukasz Dywicki <ldywicki@apache.org>
Thu, 30 Aug 2012 19:58:03 +0000 (19:58 +0000)
git-svn-id: https://svn.apache.org/repos/asf/karaf/webconsole/trunk@1379099 13f79535-47bb-0310-9956-ffa450edef68

osgi/log/src/main/java/org/apache/karaf/webconsole/osgi/log/LogEntriesDataProvider.java
osgi/log/src/main/java/org/apache/karaf/webconsole/osgi/log/LogsPage.java
osgi/log/src/main/resources/OSGI-INF/blueprint/log.xml

index 755e85e..1e61090 100644 (file)
@@ -40,7 +40,7 @@ final class LogEntriesDataProvider extends SortableDataProvider<LogEntry> {
 
     private Options options;
 
-    private transient List<Matcher> matchers;
+    private List<Matcher> matchers;
 
     public LogEntriesDataProvider(LogReaderService logReader, Options options, List<Matcher> matchers) {
         this.logReader = logReader;
index f7420c5..838d8f5 100644 (file)
@@ -23,12 +23,7 @@ import java.util.List;
 
 import org.apache.karaf.webconsole.core.table.PropertyColumnExt;
 import org.apache.karaf.webconsole.osgi.core.shared.OsgiPage;
-import org.apache.karaf.webconsole.osgi.log.search.BundleMatcher;
-import org.apache.karaf.webconsole.osgi.log.search.DateFromMatcher;
-import org.apache.karaf.webconsole.osgi.log.search.DateToMatcher;
 import org.apache.karaf.webconsole.osgi.log.search.Matcher;
-import org.apache.karaf.webconsole.osgi.log.search.MessageMatcher;
-import org.apache.karaf.webconsole.osgi.log.search.PriorityMatcher;
 import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
@@ -55,6 +50,9 @@ public class LogsPage extends OsgiPage {
     @PaxWicketBean(name = "logReader")
     private LogReaderService logReader;
 
+    @PaxWicketBean(name = "matchers")
+    private List<Matcher> matchers;
+
     private Options options = new Options();
 
     @SuppressWarnings("serial")
@@ -84,14 +82,6 @@ public class LogsPage extends OsgiPage {
 
         OptionsForm form = new OptionsForm("filters", model);
 
-        List<Matcher> matchers = Arrays.asList(
-            new PriorityMatcher(),
-            new MessageMatcher(),
-            new BundleMatcher(),
-            new DateFromMatcher(),
-            new DateToMatcher()
-        );
-
         LogEntriesDataProvider provider = new LogEntriesDataProvider(logReader, options, matchers);
         DefaultDataTable<LogEntry> table = new DefaultDataTable<LogEntry>("logs", Arrays.asList(columns), provider, 20);
 
index bedf3cf..84450f0 100644 (file)
 
     <reference id="logReader" interface="org.osgi.service.log.LogReaderService" />
 
+    <reference-list id="matchers" interface="org.apache.karaf.webconsole.osgi.log.search.Matcher" availability="optional" />
+
+    <service auto-export="interfaces">
+        <bean class="org.apache.karaf.webconsole.osgi.log.search.PriorityMatcher" />
+    </service>
+    <service auto-export="interfaces">
+        <bean class="org.apache.karaf.webconsole.osgi.log.search.MessageMatcher" />
+    </service>
+    <service auto-export="interfaces">
+        <bean class="org.apache.karaf.webconsole.osgi.log.search.BundleMatcher" />
+    </service>
+    <service auto-export="interfaces">
+        <bean class="org.apache.karaf.webconsole.osgi.log.search.DateFromMatcher" />
+    </service>
+    <service auto-export="interfaces">
+        <bean class="org.apache.karaf.webconsole.osgi.log.search.DateToMatcher" />
+    </service>
+
 </blueprint>