updated jetty
diff --git a/apps/fpcagent/BUCK b/apps/fpcagent/BUCK
index 0569ee0..c4f1565 100644
--- a/apps/fpcagent/BUCK
+++ b/apps/fpcagent/BUCK
@@ -13,13 +13,13 @@
'//apps/restconf/api:onos-apps-restconf-api',
'//models/fpcagent:onos-models-fpcagent',
'//models/common:onos-models-common',
- '//lib:jetty-http',
':jetty-servlet',
':jetty-annotations',
- '//lib:jetty-server',
- '//lib:jetty-util',
+ ':jetty-server-new',
+ ':jetty-io-new',
+ ':jetty-http-new',
+ ':jetty-util-new',
'//lib:javax.servlet-api',
- '//lib:jetty-io',
':zeromq',
':json',
]
@@ -34,11 +34,11 @@
'//lib:httpclient-osgi',
'//lib:httpcore-osgi',
'//lib:org.apache.httpcomponents.httpasyncclient-osgi',
- '//lib:jetty-http',
- '//lib:jetty-io',
- '//lib:jetty-server',
- '//lib:jetty-util',
'//lib:javax.servlet-api',
+ ':jetty-server-new',
+ ':jetty-io-new',
+ ':jetty-http-new',
+ ':jetty-util-new',
]
EXCLUDED_BUNDLES = [
@@ -108,10 +108,37 @@
)
remote_jar (
- name = 'jetty-server-v9.4.6',
- out = 'jetty-server-9.4.6.v20170531.jar',
- url = 'mvn:org.eclipse.jetty:jetty-server:jar:9.4.6.v20170531',
- sha1 = 'afda653f00267fb8b501cafd1cf5cdd1615602a2',
- maven_coords = 'org.eclipse.jetty:jetty-server:9.4.6.v20170531',
+ name = 'jetty-server-new',
+ out = 'jetty-server-9.4.8.v20171121.jar',
+ url = 'mvn:org.eclipse.jetty:jetty-server:jar:9.4.8.v20171121',
+ sha1 = '34614bd9a29de57ef28ca31f1f2b49a412af196d',
+ maven_coords = 'org.eclipse.jetty:jetty-server:9.4.8.v20171121',
+ visibility = [ 'PUBLIC' ],
+)
+
+remote_jar (
+ name = 'jetty-io-new',
+ out = 'jetty-io-9.4.8.v20171121.jar',
+ url = 'mvn:org.eclipse.jetty:jetty-io:jar:9.4.8.v20171121',
+ sha1 = 'd3fe2dfa62f52ee91ff07cb359f63387e0e30b40',
+ maven_coords = 'org.eclipse.jetty:jetty-io:9.4.8.v20171121',
+ visibility = [ 'PUBLIC' ],
+)
+
+remote_jar (
+ name = 'jetty-http-new',
+ out = 'jetty-http-9.4.8.v20171121.jar',
+ url = 'mvn:org.eclipse.jetty:jetty-http:jar:9.4.8.v20171121',
+ sha1 = '9879d6c4e37400bf43f0cd4b3c6e34a3ba409864',
+ maven_coords = 'org.eclipse.jetty:jetty-http:9.4.8.v20171121',
+ visibility = [ 'PUBLIC' ],
+)
+
+remote_jar (
+ name = 'jetty-util-new',
+ out = 'jetty-util-9.4.8.v20171121.jar',
+ url = 'mvn:org.eclipse.jetty:jetty-util:jar:9.4.8.v20171121',
+ sha1 = 'd6ec1a1613c7fa72aa6bf5d8c204750afbc3df3b',
+ maven_coords = 'org.eclipse.jetty:jetty-util:9.4.8.v20171121',
visibility = [ 'PUBLIC' ],
)
diff --git a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/eventStream/JettyServer.java b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/eventStream/JettyServer.java
index 7da2de9..03c610e 100644
--- a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/eventStream/JettyServer.java
+++ b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/eventStream/JettyServer.java
@@ -10,7 +10,6 @@
import org.apache.commons.lang.exception.ExceptionUtils;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
-import org.eclipse.jetty.servlet.ServletHolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -22,18 +21,18 @@
*/
public class JettyServer implements AutoCloseable {
private static final Logger log = LoggerFactory.getLogger(JettyServer.class);
- private static JettyServer _isntance;
+ private static JettyServer _instance;
private Server server;
public static JettyServer createInstance() {
- if (_isntance == null) {
- _isntance = new JettyServer();
+ if (_instance == null) {
+ _instance = new JettyServer();
}
- return _isntance;
+ return _instance;
}
public static JettyServer getInstance() {
- return _isntance;
+ return _instance;
}
/**
* Method used to initialize and start the SSE server
@@ -41,17 +40,18 @@
public void open() {
ExecutorService executorService = Executors.newSingleThreadExecutor();
executorService.submit(() -> {
- server = new Server(8070);
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/");
- ServletHolder requestServletHolder = new ServletHolder(EventServer.class);
- context.addServlet(requestServletHolder, "/response");
-
- ServletHolder notificationServletHolder = new ServletHolder(NotificationServer.class);
- context.addServlet(notificationServletHolder, "/notification");
-
+ server = new Server(8070);
+// log.info("a");
server.setHandler(context);
+
+// log.info("a");
+ context.addServlet(EventServer.class, "/response");
+ context.addServlet(NotificationServer.class, "/notification");
+
+// log.info("a");
context.addEventListener(new ConfigureService());
context.addEventListener(new NotificationService());
@@ -61,6 +61,8 @@
server.join();
} catch (Exception e) {
log.error(ExceptionUtils.getFullStackTrace(e));
+ } finally {
+ server.destroy();
}
});
}
@@ -74,3 +76,4 @@
}
}
}
+