Package org.kohsuke.stapler.bind
Class BoundObjectTable
java.lang.Object
org.kohsuke.stapler.bind.BoundObjectTable
- All Implemented Interfaces:
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Per-session table that remembers all the bound instances. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic boolean
True to activate debug logging of session fragments.static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBinds an object temporarily and returns its URL.Binds an object temporarily and returns its URL.void
doScript
(StaplerRequest2 req, StaplerResponse2 rsp, String var, String methods) This serves the script content for a bound object.Returns the object that is further searched for processing web requests.getTable()
Explicit call to create the table if one doesn't exist yet.static boolean
isValidJavaIdentifier
(String name) static boolean
isValidJavaScriptIdentifier
(String variableName) void
Called from within the request handling of a bound object, to release the object explicitly.
-
Field Details
-
PREFIX
- See Also:
-
DEBUG_LOGGING
public static boolean DEBUG_LOGGINGTrue to activate debug logging of session fragments.
-
-
Constructor Details
-
BoundObjectTable
public BoundObjectTable()
-
-
Method Details
-
isValidJavaScriptIdentifier
-
isValidJavaIdentifier
-
doScript
public void doScript(StaplerRequest2 req, StaplerResponse2 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 requestrsp
- The responsevar
- the variable name to assign the Stapler proxy tomethods
- the list of methods (needed forWithWellKnownURL
)- Throws:
IOException
- If an I/O error occurs
-
getStaplerFallback
Description copied from interface:StaplerFallback
Returns the object that is further searched for processing web requests.- Specified by:
getStaplerFallback
in interfaceStaplerFallback
- 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
Binds an object temporarily and returns its URL. -
bindWeak
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
Explicit call to create the table if one doesn't exist yet.
-