public class ResourceBundleMappingStrategy extends AbstractMappingStrategy
The resource bundle contains the script part of the url as key and the fully qualified class name of the corresponding AgiScript as value.
Example:
leastcostdial.agi = com.example.fastagi.LeastCostDialAgiScript hello.agi = com.example.fastagi.HelloAgiScriptLeastCostDialAgiScript and HelloAgiScript must both implement the AgiScript interface and have a default constructor with no parameters.
The resource bundle (properties) file is called
fastagi-mapping.properties by default and must be available on
the classpath.
logger| Constructor and Description |
|---|
ResourceBundleMappingStrategy()
Creates a new ResourceBundleMappingStrategy using shared instances..
|
ResourceBundleMappingStrategy(boolean shareInstances)
Creates a new ResourceBundleMappingStrategy indicating whether to use
shared instances or not.
|
ResourceBundleMappingStrategy(String resourceBundleName)
Creates a new ResourceBundleMappingStrategy with the given basename of
the resource bundle to use.
|
ResourceBundleMappingStrategy(String resourceBundleName,
boolean shareInstances)
Creates a new ResourceBundleMappingStrategy with the given basename of
the resource bundle to use and indicating whether to use shared instances
or not.
|
| Modifier and Type | Method and Description |
|---|---|
AgiScript |
determineScript(AgiRequest request) |
void |
setResourceBundleName(String resourceBundleName)
Sets the basename of the resource bundle to use.
|
void |
setShareInstances(boolean shareInstances)
Sets whether to use shared instances or not.
|
createAgiScriptInstance, determineScript, getClassLoadergetDumpRateLimit, withLockpublic ResourceBundleMappingStrategy()
public ResourceBundleMappingStrategy(String resourceBundleName)
resourceBundleName - basename of the resource bundle to usepublic ResourceBundleMappingStrategy(boolean shareInstances)
shareInstances - true to use shared instances,
false to create a new instance for each request.public ResourceBundleMappingStrategy(String resourceBundleName, boolean shareInstances)
resourceBundleName - basename of the resource bundle to useshareInstances - true to use shared instances,
false to create a new instance for each request.public void setResourceBundleName(String resourceBundleName)
Default is "fastagi-mapping".
resourceBundleName - basename of the resource bundle to usepublic void setShareInstances(boolean shareInstances)
true
all AgiRequests are served by the same instance of an AgiScript, if set
to false a new instance is created for each request.
Default is true.
shareInstances - true to use shared instances,
false to create a new instance for each request.public AgiScript determineScript(AgiRequest request)
determineScript in class AbstractMappingStrategyCopyright © 2004–2021. All rights reserved.