Interface JerseyInstaller<T>

Type Parameters:
T - expected extension type (or Object when no super type (e.g. for annotated beans))
All Superinterfaces:
WebInstaller
All Known Implementing Classes:
AbstractJerseyInstaller, JerseyProviderInstaller, ResourceInstaller

public interface JerseyInstaller<T> extends WebInstaller
Marker interface for jersey extensions installer.Must be used together with FeatureInstaller. Installer will be called in time of jersey start to properly register extensions in HK context. Installer report() method will be called only after jersey start (so if, for example, environment command is started, jersey specific extensions will not be logged).

Installer must support JerseyManaged and GuiceManaged annotations, which delegates bean creation to HK2 or guice (as exception). Default target is declared by InstallersOptions.JerseyExtensionsManagedByGuice option.

By default, jersey extensions should be registered in singleton scope, unless explicit scoping annotation is present on bean. Forced singleton could be disabled with InstallersOptions.ForceSingletonForJerseyExtensions option.

Use JerseyBinding to properly support annotation.

Since:
16.11.2014
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    install(org.glassfish.jersey.internal.inject.AbstractBinder binder, com.google.inject.Injector injector, Class<T> type)
    Called on jersey start to inject extensions into HK context.
  • Method Details

    • install

      void install(org.glassfish.jersey.internal.inject.AbstractBinder binder, com.google.inject.Injector injector, Class<T> type)
      Called on jersey start to inject extensions into HK context. Use JerseyBinding utility for proper types binding: it provide utilities for various jersey extensions and use special "bridges" for registration to respect guice scopes (most of the time we not register ready instance, but factory which delegates creation to guice).
      Parameters:
      binder - hk binder
      injector - guice injector
      type - extension type to register
      See Also: