2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.asdctool;
23 import org.eclipse.jetty.server.Server;
24 import org.eclipse.jetty.servlet.ServletContextHandler;
25 import org.eclipse.jetty.servlet.ServletHolder;
32 public static void main(String[] args) {
34 String asdcToolPort = "8087";
36 ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
37 context.setContextPath("/asdctool");
39 Server jettyServer = new Server(Integer.valueOf(asdcToolPort));
40 jettyServer.setHandler(context);
42 ServletHolder jerseyServlet = context.addServlet(org.glassfish.jersey.servlet.ServletContainer.class, "/*");
43 jerseyServlet.setInitOrder(0);
45 // Tells the Jersey Servlet which REST service/class to load.
46 // jerseyServlet.setInitParameter("jersey.config.server.provider.classnames",
47 // EntryPoint.class.getCanonicalName());
48 jerseyServlet.setInitParameter("jersey.config.server.provider.packages", "org.openecomp.sdc.asdctool.servlets");
49 jerseyServlet.setInitParameter("jersey.config.server.provider.classnames",
50 "org.glassfish.jersey.media.multipart.MultiPartFeature");
55 System.out.println("Server was started on port " + asdcToolPort);
59 } catch (Exception e) {
63 jettyServer.destroy();