|
Asterisk-Java | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.asteriskjava.fastagi.AbstractMappingStrategy
org.asteriskjava.fastagi.ResourceBundleMappingStrategy
public class ResourceBundleMappingStrategy
A MappingStrategy that is configured via a resource bundle.
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.
| Field Summary |
|---|
| Fields inherited from class org.asteriskjava.fastagi.AbstractMappingStrategy |
|---|
logger |
| Constructor Summary | |
|---|---|
ResourceBundleMappingStrategy()
Creates a new ResourceBundleMappingStrategy using shared instances.. |
|
ResourceBundleMappingStrategy(boolean shareInstances)
Creates a new ResourceBundleMappingStrategy indicating whether to use shared instances or not. |
|
ResourceBundleMappingStrategy(java.lang.String resourceBundleName)
Creates a new ResourceBundleMappingStrategy with the given basename of the resource bundle to use. |
|
ResourceBundleMappingStrategy(java.lang.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. |
|
| Method Summary | |
|---|---|
AgiScript |
determineScript(AgiRequest request)
Returns the AgiScript instance that is responsible to handle the given request. |
void |
setResourceBundleName(java.lang.String resourceBundleName)
Sets the basename of the resource bundle to use. |
void |
setShareInstances(boolean shareInstances)
Sets whether to use shared instances or not. |
| Methods inherited from class org.asteriskjava.fastagi.AbstractMappingStrategy |
|---|
createAgiScriptInstance, getClassLoader |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceBundleMappingStrategy()
public ResourceBundleMappingStrategy(java.lang.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(java.lang.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.| Method Detail |
|---|
public void setResourceBundleName(java.lang.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)
MappingStrategy
request - the request to lookup.
null if none could be determined by this strategy.
|
Asterisk-Java | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||