Class BoundObjectTable

java.lang.Object
org.kohsuke.stapler.bind.BoundObjectTable
All Implemented Interfaces:
StaplerFallback

public class BoundObjectTable extends Object implements StaplerFallback
Objects exported and bound by JavaScript proxies. TODO: think about some kind of eviction strategy, beyond the session eviction. Maybe it's not necessary, I don't know.
Author:
Kohsuke Kawaguchi
  • Field Details

    • PREFIX

      public static final String PREFIX
      See Also:
    • DEBUG_LOGGING

      public static boolean DEBUG_LOGGING
      True to activate debug logging of session fragments.
  • Constructor Details

    • BoundObjectTable

      public BoundObjectTable()
  • Method Details

    • isValidJavaScriptIdentifier

      public static boolean isValidJavaScriptIdentifier(String variableName)
    • isValidJavaIdentifier

      public static boolean isValidJavaIdentifier(String name)
    • doScript

      public void doScript(StaplerRequest req, StaplerResponse rsp, @QueryParameter String var, @QueryParameter String methods) throws IOException
      This serves the script content for a bound object. Support CSP-compatible st:bind and similar methods of making objects accessible to JS.
      Parameters:
      req - The request
      rsp - The response
      var - the variable name to assign the Stapler proxy to
      methods - the list of methods (needed for WithWellKnownURL)
      Throws:
      IOException - If an I/O error occurs
    • getStaplerFallback

      public BoundObjectTable.Table getStaplerFallback()
      Description copied from interface: StaplerFallback
      Returns the object that is further searched for processing web requests.
      Specified by:
      getStaplerFallback in interface StaplerFallback
      Returns:
      If null or this is returned, stapler behaves as if the object didn't implement this interface (which means the request processing fails with 404.)
    • bind

      public Bound bind(Object o)
      Binds an object temporarily and returns its URL.
    • bindWeak

      public Bound bindWeak(Object o)
      Binds an object temporarily and returns its URL.
    • releaseMe

      public void releaseMe()
      Called from within the request handling of a bound object, to release the object explicitly.
    • getTable

      public BoundObjectTable.Table getTable()
      Explicit call to create the table if one doesn't exist yet.