org.directwebremoting.extend
Interface CreatorManager

All Known Implementing Classes:
DefaultCreatorManager

public interface CreatorManager

A class to manage the types of creators and the instansiated creators.

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

Method Summary
 void addCreator(java.lang.String scriptName, Creator creator)
          Add a new creator
 void addCreator(java.lang.String scriptName, java.lang.String typename, java.util.Map params)
          Add a new creator
 void addCreatorType(java.lang.String id, java.lang.String className)
          In init mode, add a new type of creator
 Creator getCreator(java.lang.String scriptName)
          Find an Creator by name
 java.util.Collection getCreatorNames()
          Get a list of the javascript names of the allowed creators.
 boolean isDebug()
          Debug mode allows access to the list of creator names
 void setCreators(java.util.Map creators)
          Sets the creators for this creator manager.
 

Method Detail

isDebug

boolean isDebug()
Debug mode allows access to the list of creator names

Returns:
Are we in debug mode
See Also:
getCreatorNames()

addCreatorType

void addCreatorType(java.lang.String id,
                    java.lang.String className)
In init mode, add a new type of creator

Parameters:
id - The name of the new creator type
className - The class that we create

addCreator

void addCreator(java.lang.String scriptName,
                java.lang.String typename,
                java.util.Map params)
                throws java.lang.InstantiationException,
                       java.lang.IllegalAccessException,
                       java.lang.IllegalArgumentException
Add a new creator

Parameters:
scriptName - The name of the creator to Javascript
typename - The class to use as a creator
params - The extra parameters to allow the creator to configure itself
Throws:
java.lang.InstantiationException - If reflection based creation fails
java.lang.IllegalAccessException - If reflection based creation fails
java.lang.IllegalArgumentException - If we have a duplicate name

addCreator

void addCreator(java.lang.String scriptName,
                Creator creator)
                throws java.lang.IllegalArgumentException
Add a new creator

Parameters:
scriptName - The name of the creator to Javascript
creator - The creator to add
Throws:
java.lang.IllegalArgumentException - If we have a duplicate name

getCreatorNames

java.util.Collection getCreatorNames()
                                     throws java.lang.SecurityException
Get a list of the javascript names of the allowed creators. This method could be seen as a security risk because it could allow an attacker to find out extra information about your system so it is only available if debug is turned on.

Returns:
Loop over all the known allowed classes
Throws:
java.lang.SecurityException - If we are not in debug mode

getCreator

Creator getCreator(java.lang.String scriptName)
                   throws java.lang.SecurityException
Find an Creator by name

Parameters:
scriptName - The name of the creator to Javascript
Returns:
The found Creator instance, or null if none was found.
Throws:
java.lang.SecurityException - If the Creator is not known

setCreators

void setCreators(java.util.Map creators)
Sets the creators for this creator manager.

Parameters:
creators - the map of managed beans and their creator instances