java.lang.Object
org.jvnet.hk2.guice.bridge.api.GuiceBridge
- Direct Known Subclasses:
GuiceBridgeImpl
This class can be used to initialize a ServiceLocator for use with
the Guice/HK2 Bridge
- Author:
- jwells
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidConfigure Guice to allow for Jakarta annotations.static GuiceBridgeabstract voidinitializeGuiceBridge(org.glassfish.hk2.api.ServiceLocator locator) This method will initialize the given service locator for use with the Guice/HK2 bridge.
-
Constructor Details
-
GuiceBridge
public GuiceBridge()
-
-
Method Details
-
allowJakartaInject
public static void allowJakartaInject()Configure Guice to allow for Jakarta annotations. This function must be called before any annotation bindings are created. -
getGuiceBridge
-
initializeGuiceBridge
public abstract void initializeGuiceBridge(org.glassfish.hk2.api.ServiceLocator locator) throws org.glassfish.hk2.api.MultiException This method will initialize the given service locator for use with the Guice/HK2 bridge. It adds into the service locator an implementation of GuiceIntoHK2Bridge and also the custom scope needed for Guice services. This method is idempotent, in that if these services have already been added to the service locator they will not be added again- Parameters:
locator- A non-null locator to use with the Guice/HK2 bridge- Throws:
org.glassfish.hk2.api.MultiException- On failure
-