Enum SoapSTSInjectorHolder

  • All Implemented Interfaces:
    Serializable, Comparable<SoapSTSInjectorHolder>

    public enum SoapSTSInjectorHolder
    extends Enum<SoapSTSInjectorHolder>
    Holds the Injector instance common to all Rest STS instances. Should only be called from contexts where injection cannot be done - i.e. where Guice is not controlling instance lifecycle. Reference to this Enum will trigger the creation of of the Injector with the common bindings. Modeled after the InjectorHolder class, and taking advantage of the fact that enums are singletons. This class will be first referenced by the STSBroker class, the CXFNonSpringServlet subclass that is the entry point for all invocations against the soap sts.
    • Enum Constant Detail

      • INSTANCE

        public static final SoapSTSInjectorHolder INSTANCE
        The Singleton instance of the InjectorHolder.
    • Method Detail

      • values

        public static SoapSTSInjectorHolder[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SoapSTSInjectorHolder c : SoapSTSInjectorHolder.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SoapSTSInjectorHolder valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getInstance

        public static <T> T getInstance​(com.google.inject.Key<T> key)
        Returns the appropriate instance for the given injection key. Avoid using this method, in favor of having Guice inject your dependencies ahead of time. This method is called by the STSBroker, to obtain the SoapSTSLifecycle implementation which bootstraps the soap sts context. It is also used by the SoapSTSContextListener, to shut-down the soap sts context, and by the SoapSTSInstancePublisherImpl, to get this common injector, which is the parent of all Injectors corresponding to published soap-sts instances.
        Type Parameters:
        T - The type of class defined by the key.
        Parameters:
        key - The key that defines the class to get.
        Returns:
        An instance of the class defined by the key.