return an hk2 binder that injects this specific otpserver instance into jersey web resources . this should be registered in the resourceconfig jersey or application jax-rs as a singleton . jersey forces us to use injection to get application context into http method handlers , but in otp we always just inject this otpserver instance and grab anything else we need routers , graphs , application components from this single object . more on custom injection in jersey 2 : http://jersey.576304.n2.nabble.com/custom-providers-in-jersey-2-tp7580699p7580715.html concode_field_sep File basePath concode_elem_sep ScriptingService scriptingService concode_elem_sep SurfaceCache surfaceCache concode_elem_sep Logger LOG concode_elem_sep GraphService graphService concode_elem_sep CommandLineParameters params concode_elem_sep PointSetCache pointSetCache concode_field_sep Collection<String> getRouterIds concode_elem_sep GraphService getGraphService concode_elem_sep Router getRouter
AbstractBinder function ( ) { return new AbstractBinder ( ) { @ Override protected void configure ( ) { bind ( OTPServer . this ) . to ( OTPServer . class ) ; } } ; }