|
Asterisk-Java | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.asteriskjava.fastagi.CompositeMappingStrategy
public class CompositeMappingStrategy
A mapping strategy that tries a sequence of other mapping strategies to find an AgiScript matching the request. The first strategy that returns a result wins, so the order of the mapping strategies passed to the CompositeMappingStrategy matters.
Example:
new CompositeMappingStrategy(
new ResourceBundleMappingStrategy(),
new ClassNameMappingStrategy());
This creates a new mapping strategy that first tries to look up the script
in fastagi-mapping.properties and - if the properties file is
not present on the classpath or contains no mapping for the request - uses
a ClassNameMappingStrategy to get the script.
ResourceBundleMappingStrategy,
ClassNameMappingStrategy| Constructor Summary | |
|---|---|
CompositeMappingStrategy()
Creates a new empty CompositeMappingStrategy. |
|
CompositeMappingStrategy(java.util.List<MappingStrategy> strategies)
Creates a new CompositeMappingStrategy. |
|
CompositeMappingStrategy(MappingStrategy... strategies)
Creates a new CompositeMappingStrategy. |
|
| Method Summary | |
|---|---|
void |
addStrategy(MappingStrategy strategy)
Adds a strategy (at the end of the list). |
AgiScript |
determineScript(AgiRequest request)
Returns the AgiScript instance that is responsible to handle the given request. |
void |
setStrategies(java.util.List<MappingStrategy> strategies)
Sets the strategies to use. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompositeMappingStrategy()
public CompositeMappingStrategy(MappingStrategy... strategies)
strategies - the strategies to use.public CompositeMappingStrategy(java.util.List<MappingStrategy> strategies)
strategies - the strategies to use.| Method Detail |
|---|
public void addStrategy(MappingStrategy strategy)
strategy - the strategy to add.public void setStrategies(java.util.List<MappingStrategy> strategies)
strategies - the strategies to use.public AgiScript determineScript(AgiRequest request)
MappingStrategy
determineScript in interface MappingStrategyrequest - 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 | |||||||||