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 classPer-session table that remembers all the bound instances. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBinds an object temporarily and returns its URL.voiddoScript(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 booleanisValidJavaIdentifier(String name) static booleanisValidJavaScriptIdentifier(String variableName) voidCalled from within the request handling of a bound object, to release the object explicitly.
-
Field Details
-
PREFIX
- See Also:
-
-
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:StaplerFallbackReturns the object that is further searched for processing web requests.- Specified by:
getStaplerFallbackin interfaceStaplerFallback- Returns:
- If null or
thisis 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. -
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.
-