Class Context

java.lang.Object
io.milton.context.Context
All Implemented Interfaces:
Contextual
Direct Known Subclasses:
RequestContext, RootContext

public abstract class Context extends Object implements Contextual
Basic context functionality. Use either a RootContext or RequestContext
  • Field Details

  • Constructor Details

    • Context

      protected Context()
      Used by subclasses
  • Method Details

    • numItemsById

      public int numItemsById()
    • get

      public <T> T get(String id)
      Specified by:
      get in interface Contextual
    • get

      public <T> T get(Class<T> c)
      Specified by:
      get in interface Contextual
    • getRegistration

      protected <T> Registration<T> getRegistration(Class<T> c)
    • getRegistration

      protected <T> Registration<T> getRegistration(String id)
    • put

      public <T> Registration<T> put(String id, T o)
      Place o into context, keying by the given id
      Type Parameters:
      T -
      Parameters:
      id -
      o -
      Returns:
    • put

      public <T> Registration<T> put(T o)
      Place the given object into context, keying only by its class
    • put

      public <T> Registration<T> put(T o, RemovalCallback f)
    • put

      public <T> Registration<T> put(String id, T o, Factory f)
      Put the given object into context, keying only the given id
    • tearDown

      public void tearDown()