org.directwebremoting.extend
Class AbstractCreator

java.lang.Object
  extended by org.directwebremoting.extend.AbstractCreator
All Implemented Interfaces:
Creator
Direct Known Subclasses:
BeanCreator, Ejb3Creator, JsfCreator, NewCreator, NullCreator, PageFlowCreator, ScriptedCreator, SpringCreator, StaticCreator

public abstract class AbstractCreator
extends java.lang.Object
implements Creator

A simple implementation of the basic parts of Creator

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

Field Summary
 
Fields inherited from interface org.directwebremoting.extend.Creator
APPLICATION, PAGE, REQUEST, SCRIPT, SESSION
 
Constructor Summary
AbstractCreator()
           
 
Method Summary
 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.
 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 setCacheable(boolean cacheable)
           
 void setHidden(boolean hidden)
           
 void setJavascript(java.lang.String javascript)
           
 void setProperties(java.util.Map<java.lang.String,java.lang.String> params)
          DefaultConfiguration is done via access to the DOM Element.
 void setScope(java.lang.String scope)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.directwebremoting.extend.Creator
getInstance, getType
 

Constructor Detail

AbstractCreator

public AbstractCreator()
Method Detail

setProperties

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

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

getJavascript

public java.lang.String getJavascript()
Description copied from interface: Creator
How is this creator referred to in Javascript land?

Specified by:
getJavascript in interface Creator
Returns:
Returns the javascript name.

setJavascript

public void setJavascript(java.lang.String javascript)
Parameters:
javascript - The javascript name to set.

setScope

public void setScope(java.lang.String scope)
Parameters:
scope - Set the scope.

getScope

public java.lang.String getScope()
Description copied from interface: Creator
Each Creator creates objects with a given scope.

Specified by:
getScope in interface Creator
Returns:
How long do we hold onto instances created by this Creator

isCacheable

public boolean isCacheable()
Description copied from interface: Creator
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.

Specified by:
isCacheable in interface Creator
Returns:
Returns the reloadable variable

setCacheable

public void setCacheable(boolean cacheable)
Parameters:
cacheable - Whether or not to cache the script.
See Also:
Creator.isCacheable()

isHidden

public boolean isHidden()
Description copied from interface: Creator
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.

Specified by:
isHidden in interface Creator
Returns:
false if a class is not hidden

setHidden

public void setHidden(boolean hidden)
Parameters:
hidden - the new hidden status.
See Also:
isHidden()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Copyright 2008