|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.directwebremoting.fluent.FluentConfigurator
public abstract class FluentConfigurator
A Configurator that used the FluentInterface style as
described by
Martin Fowler.
To wire up the configuration programatically rather than having to use
dwr.xml. In order to use this style, you'll need to:
FluentConfigurator which
implements the configure() method.customConfigurator' to the DWR servlet in
web.xml to point at your new class.The implementation of configure() will look something like
this:
public void configure() {
withConverterType("dog", "com.yourcompany.beans.Dog");
withCreatorType("ejb", "com.yourcompany.dwr.creator.EJBCreator");
withCreator("new", "ApartmentDAO")
.addParam("scope", "session")
.addParam("class", "com.yourcompany.dao.ApartmentDAO")
.exclude("saveApartment")
.withAuth("method", "role");
withCreator("struts", "DogDAO")
.addParam("clas", "com.yourcompany.dao.DogDAO")
.include("getDog")
.include("getColor");
withConverter("dog", "*.Dog")
.addParam("name", "value");
withSignature()
.addLine("import java.util.List;")
.addLine("import com.example.Check;")
.addLine("Check.setLotteryResults(List nos);");
}
| Constructor Summary | |
|---|---|
FluentConfigurator()
|
|
| Method Summary | |
|---|---|
FluentConfigurator |
addFilter(java.lang.String newFilterClassName)
Add a filter to whatever is being configured. |
FluentConfigurator |
addLine(java.lang.String line)
Add lines to a signature. |
FluentConfigurator |
addParam(java.lang.String name,
java.lang.String value)
Add a parameter to whatever is being configured. |
abstract void |
configure()
This method is used to configure DWR using the fluent style. |
void |
configure(Container container)
Do the Configuration actions |
FluentConfigurator |
exclude(java.lang.String methodName)
Add an exclude rule to a Creator
This should be used during a withCreator(String, String) call. |
FluentConfigurator |
include(java.lang.String methodName)
Add an include rule to a Creator. |
FluentConfigurator |
withAuth(java.lang.String methodName,
java.lang.String role)
Add an authorization rule to a Creator
This should be used during a withCreator(String, String) call. |
FluentConfigurator |
withConverter(java.lang.String newConverter,
java.lang.String newMatch)
Use a Converter to instansiate a class |
FluentConfigurator |
withConverterType(java.lang.String id,
java.lang.String converterClassName)
Add a new Converter definition. |
FluentConfigurator |
withCreator(java.lang.String newTypeName,
java.lang.String newScriptName)
Use a Creator to instansiate a class |
FluentConfigurator |
withCreatorType(java.lang.String id,
java.lang.String creatorClassName)
Add a new Creator definition. |
FluentConfigurator |
withFilter(java.lang.String newFilterClassName)
|
FluentConfigurator |
withSignature()
Add lines to a signature. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FluentConfigurator()
| Method Detail |
|---|
public abstract void configure()
public FluentConfigurator withConverterType(java.lang.String id,
java.lang.String converterClassName)
Converter definition.
id - The id referred to by the withConverter(String, String)converterClassName - The implementation of Converter to instansitate.
this to continue the fluency
public FluentConfigurator withConverter(java.lang.String newConverter,
java.lang.String newMatch)
Converter to instansiate a class
newConverter - A predefined Converter or one defined by
withConverterType(String, String).newMatch - The javascript name of this component
this to continue the fluency
public FluentConfigurator withCreatorType(java.lang.String id,
java.lang.String creatorClassName)
Creator definition.
id - The id referred to by the withCreator(String, String)creatorClassName - The implementation of Creator to instansitate.
this to continue the fluency
public FluentConfigurator withCreator(java.lang.String newTypeName,
java.lang.String newScriptName)
Creator to instansiate a class
newTypeName - A predefined Creator or one defined by
withCreatorType(String, String).newScriptName - The javascript name of this component
this to continue the fluencypublic FluentConfigurator withFilter(java.lang.String newFilterClassName)
newFilterClassName - filter class name
this to continue the fluency
public FluentConfigurator addParam(java.lang.String name,
java.lang.String value)
name - The name of the parametervalue - The value of the parameter
this to continue the fluencypublic FluentConfigurator addFilter(java.lang.String newFilterClassName)
newFilterClassName - The class to add as a filter
this to continue the fluencypublic FluentConfigurator include(java.lang.String methodName)
Creator.
This should be used during a withCreator(String, String) call.
methodName - The method name to be allowed
this to continue the fluencypublic FluentConfigurator exclude(java.lang.String methodName)
Creator
This should be used during a withCreator(String, String) call.
methodName - The method name to be dis-allowed
this to continue the fluency
public FluentConfigurator withAuth(java.lang.String methodName,
java.lang.String role)
Creator
This should be used during a withCreator(String, String) call.
methodName - The method name to have a required rolerole - The required role for the given method
this to continue the fluencypublic FluentConfigurator withSignature()
this to continue the fluencypublic FluentConfigurator addLine(java.lang.String line)
line - The line of text to add to the signature configuration
this to continue the fluencypublic void configure(Container container)
Configurator
configure in interface Configuratorcontainer - The object that contains the system objects to configure
|
Copyright ¬ 2005 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||