Class GuiceRestApplication
java.lang.Object
javax.ws.rs.core.Application
com.peterphi.std.guice.web.rest.jaxrs.GuiceRestApplication
- All Implemented Interfaces:
GuiceApplication
A jax-rs REST
This allows for a vanilla jax rs implementation, albeit at a small runtime performance penalty.
Application
implementation that returns singletons whih are dynamic proxies bound to objects built by
GuiceThis allows for a vanilla jax rs implementation, albeit at a small runtime performance penalty.
-
Constructor Summary
ConstructorDescriptionGuiceRestApplication
(GuiceRegistry guiceRegistry) If constructing from within a guice environment we should use the existing GuiceRegistry -
Method Summary
Modifier and TypeMethodDescriptionvoid
Called when a new Injector has been created, after Guice injection has been applied to this instance.void
stopping()
Called when an Injector is stopping and before the ShutdownManager for the GuiceRegistry is signalled
The GuiceRegistry will wait for this method to return before proceeding.Methods inherited from class javax.ws.rs.core.Application
getClasses, getProperties
-
Constructor Details
-
GuiceRestApplication
public GuiceRestApplication() -
GuiceRestApplication
If constructing from within a guice environment we should use the existing GuiceRegistry- Parameters:
guiceRegistry
-
-
-
Method Details
-
getSingletons
- Overrides:
getSingletons
in classjavax.ws.rs.core.Application
-
configured
public void configured()Description copied from interface:GuiceApplication
Called when a new Injector has been created, after Guice injection has been applied to this instance. No guarantees are made about the order in which GuiceApplication instances will be called- Specified by:
configured
in interfaceGuiceApplication
-
stopping
public void stopping()Description copied from interface:GuiceApplication
Called when an Injector is stopping and before the ShutdownManager for the GuiceRegistry is signalled
The GuiceRegistry will wait for this method to return before proceeding. No guarantees are made about the order in which GuiceApplication instances will be called- Specified by:
stopping
in interfaceGuiceApplication
-