org.directwebremoting.extend
Interface Creator

All Known Implementing Classes:
AbstractCreator, BeanCreator, Ejb3Creator, GuiceCreator, JsfCreator, NewCreator, NullCreator, PageFlowCreator, ScriptedCreator, SpringCreator, StaticCreator

public interface Creator

A base class for all AllowedClasses

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Field Summary
static java.lang.String APPLICATION
          Application scope: named reference remains available in the ServletContext until it is reclaimed.
static java.lang.String PAGE
          Page scope: (this is the default) the named reference remains available in this PageContext until the return from the current Servlet.service() invocation.
static java.lang.String REQUEST
          Request scope: the named reference remains available from the ServletRequest associated with the Servlet until the current request is completed.
static java.lang.String SCRIPT
          Script scope (tied to a id recorded in Javascript): the named reference remains available while the script variable remains stored in the browser.
static java.lang.String SESSION
          Session scope (only valid if this page participates in a session): the named reference remains available from the HttpSession (if any) associated with the Servlet until the HttpSession is invalidated.
 
Method Summary
 java.lang.Object getInstance()
          Accessor for the/an instance of this Creator.
 java.lang.String getJavascript()
          How is this creator referred to in Javascript land?
 java.lang.String getScope()
          Each Creator creates objects with a given scope.
 java.lang.Class<?> getType()
          Accessor for the java.lang.Class that this Creator allows access to.
 boolean isCacheable()
          Is the class behind the Creator likely to change over time? TODO: We should probably remove this.
 boolean isHidden()
          Hidden creators do not show up from the outside world, the only way to call them is to know their name.
 void setProperties(java.util.Map<java.lang.String,java.lang.String> params)
          DefaultConfiguration is done via access to the DOM Element.
 

Field Detail

APPLICATION

static final java.lang.String APPLICATION
Application scope: named reference remains available in the ServletContext until it is reclaimed.

See Also:
Constant Field Values

SESSION

static final java.lang.String SESSION
Session scope (only valid if this page participates in a session): the named reference remains available from the HttpSession (if any) associated with the Servlet until the HttpSession is invalidated.

See Also:
Constant Field Values

SCRIPT

static final java.lang.String SCRIPT
Script scope (tied to a id recorded in Javascript): the named reference remains available while the script variable remains stored in the browser.

See Also:
Constant Field Values

REQUEST

static final java.lang.String REQUEST
Request scope: the named reference remains available from the ServletRequest associated with the Servlet until the current request is completed. This scope type is almost identical to PAGE scope and it is recommended to use PAGE scope in place of this scope. Use of "request" may be deprecated in the future.

See Also:
Constant Field Values

PAGE

static final java.lang.String PAGE
Page scope: (this is the default) the named reference remains available in this PageContext until the return from the current Servlet.service() invocation.

See Also:
Constant Field Values
Method Detail

setProperties

void setProperties(java.util.Map<java.lang.String,java.lang.String> params)
                   throws java.lang.IllegalArgumentException
DefaultConfiguration is done via access to the DOM Element. This is not at all ideal, but it will do for the moment.

Parameters:
params - The map of parameters to configure the creator
Throws:
java.lang.IllegalArgumentException - If the config data in the Element is invalid

getType

java.lang.Class<?> getType()
Accessor for the java.lang.Class that this Creator allows access to.

Returns:
The type of this allowed class

getInstance

java.lang.Object getInstance()
                             throws java.lang.InstantiationException
Accessor for the/an instance of this Creator.

Returns:
the instance to use
Throws:
java.lang.InstantiationException - If for some reason the object can not be created

getScope

java.lang.String getScope()
Each Creator creates objects with a given scope.

Returns:
How long do we hold onto instances created by this Creator

isCacheable

boolean isCacheable()
Is the class behind the Creator likely to change over time? TODO: We should probably remove this. I suspect that the reason we added this was to handle ScriptCreator's ability to change things half way through, and it feels dangerous given the number of caches around the place.

Returns:
Returns the reloadable variable

isHidden

boolean isHidden()
Hidden creators do not show up from the outside world, the only way to call them is to know their name. This restriction is in addition to those made by setting debug=false, which prevents enumeration of the exported classes. If a class is hidden then you can't ask for an interface script even when you know it by name.

Returns:
false if a class is not hidden

getJavascript

java.lang.String getJavascript()
How is this creator referred to in Javascript land?

Returns:
A Javascript identifier

Copyright 2008