Class ContextualFactories

java.lang.Object
com.levigo.jadice.web.server.ContextualFactories

public final class ContextualFactories extends Object
Utilities for working with ContextualFactory objects.
  • Method Details

    • singleton

      public static <T> ContextualFactory<T> singleton(T instance)
      Generate a singleton ContextualFactory providing the given instance. The resulting ContextualFactory will always return the same instance, completely ignoring the given InvocationContext
      Type Parameters:
      T - the type of object to be held as a singlton
      Parameters:
      instance - the instance that shall be provided as a singleton
      Returns:
      a ContextualFactory returning the given instance.