Author: rezan
Date: Mon Jul 28 22:11:58 2014
New Revision: 1614204

URL: http://svn.apache.org/r1614204
Log:
servlet example trimming

Modified:
    incubator/devicemap/trunk/examples/servlet/pom.xml
    
incubator/devicemap/trunk/examples/servlet/src/main/java/org/apache/devicemap/servlet/Classify.java
    incubator/devicemap/trunk/examples/spring/pom.xml
    
incubator/devicemap/trunk/examples/spring/src/main/java/org/apache/devicemap/spring/Classifier.java

Modified: incubator/devicemap/trunk/examples/servlet/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/devicemap/trunk/examples/servlet/pom.xml?rev=1614204&r1=1614203&r2=1614204&view=diff
==============================================================================
--- incubator/devicemap/trunk/examples/servlet/pom.xml (original)
+++ incubator/devicemap/trunk/examples/servlet/pom.xml Mon Jul 28 22:11:58 2014
@@ -42,11 +42,6 @@
             <version>1.1.0-SNAPSHOT</version>
         </dependency>
         <dependency>
-            <groupId>org.apache.devicemap</groupId>
-            <artifactId>devicemap-data</artifactId>
-            <version>1.0.1-SNAPSHOT</version>
-        </dependency>
-        <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
             <version>2.5</version>

Modified: 
incubator/devicemap/trunk/examples/servlet/src/main/java/org/apache/devicemap/servlet/Classify.java
URL: 
http://svn.apache.org/viewvc/incubator/devicemap/trunk/examples/servlet/src/main/java/org/apache/devicemap/servlet/Classify.java?rev=1614204&r1=1614203&r2=1614204&view=diff
==============================================================================
--- 
incubator/devicemap/trunk/examples/servlet/src/main/java/org/apache/devicemap/servlet/Classify.java
 (original)
+++ 
incubator/devicemap/trunk/examples/servlet/src/main/java/org/apache/devicemap/servlet/Classify.java
 Mon Jul 28 22:11:58 2014
@@ -26,6 +26,7 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 import org.apache.devicemap.DeviceMapFactory;
 import org.apache.devicemap.data.Device;
+import org.apache.devicemap.loader.LoaderOption;
 
 /**
  *
@@ -43,7 +44,7 @@ public class Classify extends HttpServle
     
     long start = System.nanoTime();
     
-    Device device = DeviceMapFactory.getInstance().classifyDevice(ua);
+    Device device = 
DeviceMapFactory.getInstance(LoaderOption.URL).classifyDevice(ua);
     
     long diff = (System.nanoTime() - start) / 1000;
 

Modified: incubator/devicemap/trunk/examples/spring/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/devicemap/trunk/examples/spring/pom.xml?rev=1614204&r1=1614203&r2=1614204&view=diff
==============================================================================
Binary files - no diff available.

Modified: 
incubator/devicemap/trunk/examples/spring/src/main/java/org/apache/devicemap/spring/Classifier.java
URL: 
http://svn.apache.org/viewvc/incubator/devicemap/trunk/examples/spring/src/main/java/org/apache/devicemap/spring/Classifier.java?rev=1614204&r1=1614203&r2=1614204&view=diff
==============================================================================
--- 
incubator/devicemap/trunk/examples/spring/src/main/java/org/apache/devicemap/spring/Classifier.java
 (original)
+++ 
incubator/devicemap/trunk/examples/spring/src/main/java/org/apache/devicemap/spring/Classifier.java
 Mon Jul 28 22:11:58 2014
@@ -30,9 +30,11 @@ public class Classifier {
     private DeviceMapClient client;
     
     public synchronized void init() throws Exception {
+        long start = System.nanoTime();
         client = new DeviceMapClient();
-        client.initDeviceData(LoaderOption.URL);
-        log.info("DeviceMap Classifier loaded " + client.getDeviceCount() + " 
devices and " + client.getPatternCount() + " patterns");
+        client.initDeviceData(LoaderOption.JAR);
+        long diff = (System.nanoTime() - start) / (1000*1000);
+        log.info("DeviceMap Classifier loaded " + client.getDeviceCount() + " 
devices and " + client.getPatternCount() + " patterns in " + diff + "ms");
     }
     
     public Device classify(String text) {


Reply via email to