Hello,
I am using Jersey in an embedded Grizzly server (v.1.9.18i). Here is my
starting code which is pretty much copy and pasted from introductory
examples:
server = new GrizzlyWebServer(servicePort);
ServletAdapter jerseyAdapter = new ServletAdapter();
jerseyAdapter.addInitParameter("com.sun.jersey.config.property.packages",
"my.package");
jerseyAdapter.setContextPath("/");
jerseyAdapter.setServletInstance(new ServletContainer());
server.addGrizzlyAdapter(jerseyAdapter, new String[] { "/" });
server.start();
this.setPort(server.getSelectorThread().getPort());
However, I find startup time to be quite long, as I think jersey is scanning
the packages, loading the classes, instantiating everything,... I would like
to reduce startup time, possibly by defining ex-ante without relying on
packages scanning the resources that will be served. Ideally, I would even
like to set explicitly whcih objects will serve which resources and inject
necessary resources beforehand.
How can I do this with Jersey ?
Thanks in advance,
Arnaud
--
View this message in context: http://jersey.576304.n2.nabble.com/Reducing-boot-time-for-Jersey-Grizzly-server-tp6210445p6210445.html
Sent from the Jersey mailing list archive at Nabble.com.