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
ConstructorsConstructorDescriptionGuiceRestApplication(GuiceRegistry guiceRegistry) If constructing from within a guice environment we should use the existing GuiceRegistry -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when a new Injector has been created, after Guice injection has been applied to this instance.voidstopping()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:
getSingletonsin classjavax.ws.rs.core.Application
-
configured
public void configured()Description copied from interface:GuiceApplicationCalled 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:
configuredin interfaceGuiceApplication
-
stopping
public void stopping()Description copied from interface:GuiceApplicationCalled 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:
stoppingin interfaceGuiceApplication
-