|
BEA Systems, Inc. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.beasys.commerce.axiom.reasoning.rules.service.ServiceProviderManager
Implements a rules service provider manager
| Field Summary | |
static java.lang.String |
DIRECTORY_RELATIVE_URI_LEADING_STRING
The leading character(s) of a ruleset-directory-relative uri |
static java.lang.String |
FILE_PROTOCOL
The protocol string for file uri's |
static java.lang.String |
HOST_DELIMITER
The delimiter string used after the host in a uri |
protected javax.naming.Context |
jndiContext
The jndi context to use for lookups |
protected java.util.Map |
mimeTypeHandlersMap
The map of mime types to mime type handlers |
protected java.util.Map |
mimeTypesMap
The map of uri extensions to mime types |
static java.lang.String |
PROTOCOL_DELIMITER
The delimiter string used after the protocol in a uri |
protected java.util.Map |
rulesetBuilders
A map of cached ruleset builders |
protected java.lang.String |
rulesetDataHomeName
The ruleset data bean home name |
protected long |
rulesetExpirationAge
The ruleset expiration age |
protected int |
rulesetExpirationPolicy
The ruleset expiration policy |
protected java.util.Map |
rulesetExpirers
The ruleset expirers |
protected java.lang.String |
rulesheetDirectory
The rule sheet deployment directory |
protected java.util.Map |
serviceProviders
The registered service providers |
static char |
URI_EXTENSION_DELIMITER
The character used to delimit a uri extension |
protected java.lang.String |
vendorIndependentMimeType
The vendor independent mime type |
static java.lang.String |
XML_EXTENSION
The file extension for xml files |
| Constructor Summary | |
ServiceProviderManager(int rulesetExpirationPolicy,
long rulesetExpirationAge,
java.lang.String rulesheetDirectory,
java.util.Map mimeTypesMap,
java.util.Map mimeTypeHandlersMap,
java.lang.String vendorIndependentMimeType,
javax.naming.Context jndiContext,
java.lang.String rulesetDataHomeName)
Constructor |
|
| Method Summary | |
com.beasys.commerce.axiom.reasoning.rules.serviceProvider.Context |
createContext(java.lang.String rulesetURI)
Creates a context for the given rule set uri |
protected java.lang.String |
createFullyQualifiedURIForURI(java.lang.String rulesetURI)
Creates a fully-qualified rule set uri which corresponds to a rule set uri |
protected void |
createRulesetForNative(java.lang.String rulesetURI,
com.beasys.commerce.axiom.reasoning.rules.serviceProvider.ServiceProvider serviceProvider)
Creates a ruleset for native language rules |
protected void |
createRulesetForXML(java.lang.String rulesetURI,
com.beasys.commerce.axiom.reasoning.rules.serviceProvider.ServiceProvider serviceProvider)
Creates a ruleset for a set of rules expressed as xml |
protected java.lang.String |
getMimeTypeForURI(java.lang.String rulesetURI)
Gets the mime type for a ruleset uri |
protected com.beasys.commerce.axiom.reasoning.rules.serviceProvider.ServiceProvider |
getServiceProviderForMimeType(java.lang.String mimeType)
Gets the service provider which can service a given mime type |
protected void |
loadServiceProvider(java.lang.String serviceProviderName)
Loads a service provider and adds it to the map of service providers |
protected void |
performRulesetMaintenance()
Performs ruleset maintenance TODO: 1. |
protected boolean |
rulesetMaintenanceNeeded()
Determines whether or not ruleset maintenance is required |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String DIRECTORY_RELATIVE_URI_LEADING_STRING
public static final java.lang.String FILE_PROTOCOL
public static final java.lang.String HOST_DELIMITER
public static final java.lang.String PROTOCOL_DELIMITER
public static final char URI_EXTENSION_DELIMITER
public static final java.lang.String XML_EXTENSION
protected javax.naming.Context jndiContext
protected java.util.Map mimeTypesMap
protected java.util.Map mimeTypeHandlersMap
protected java.util.Map rulesetBuilders
protected java.lang.String rulesetDataHomeName
protected long rulesetExpirationAge
protected int rulesetExpirationPolicy
protected java.util.Map rulesetExpirers
protected java.lang.String rulesheetDirectory
protected java.util.Map serviceProviders
protected java.lang.String vendorIndependentMimeType
| Constructor Detail |
public ServiceProviderManager(int rulesetExpirationPolicy,
long rulesetExpirationAge,
java.lang.String rulesheetDirectory,
java.util.Map mimeTypesMap,
java.util.Map mimeTypeHandlersMap,
java.lang.String vendorIndependentMimeType,
javax.naming.Context jndiContext,
java.lang.String rulesetDataHomeName)
throws java.lang.IllegalArgumentException,
RulesServiceException
rulesetExpirationPolicy - The rule set expiration policyrulesetExpirationAge - The age in milliseconds at which rulesets should
be expired. Ignored if rulesetExpirationPolicy is not
EXPIRE_RULE_SET_AT_AGErulesheetDirectory - The rulesheet deployment directorymimeTypesMap - The map of uri extensions to mime typesmimeTypeHandlersMap - The map of mime types to mime type handlersvendorIndependentMimeType - The vendor independent, xml-based mime typejndiContext - The jndi context to use for lookupsjava.lang.IllegalArgumentException - Thrown if:
1. rulesetExpirationPolicy is invalid
2. rulesetExpirationPolicy is EXPIRE_RULE_SET_AT_AGE and rulesetExpirationAge
is negative
3. mimeTypesMap is null
4. mimeTypeHandlersMap is null
5. vendorIndependentMimeType is null or zero-length
6. jndiContext is null
7. rulesetDataHomeName is null or zero-lengthRulesServiceException - | Method Detail |
public com.beasys.commerce.axiom.reasoning.rules.serviceProvider.Context createContext(java.lang.String rulesetURI)
throws RulesServiceException
rulesetURI - The rule set uri for which a context is to be createdjava.lang.IllegalArgumentException - Thrown if rulesetURI is nullRulesServiceException - Thrown if unable to create the context
TODO:
1. Improve no-service-provider-found code
protected void loadServiceProvider(java.lang.String serviceProviderName)
throws RulesServiceException
serviceProviderName - The name of the service provider classjava.lang.IllegalArgumentException - Thrown if serviceProviderName is null
or zero-lengthRulesServiceException -
protected void createRulesetForNative(java.lang.String rulesetURI,
com.beasys.commerce.axiom.reasoning.rules.serviceProvider.ServiceProvider serviceProvider)
throws java.lang.IllegalArgumentException,
RulesServiceException
rulesetURI - The uri of the native rule setserviceProvider - The serviceProvider that will create the rulesetjava.lang.IllegalArgumentException - Thrown if rulesetURI is null or
zero-length, or if serviceProvider is nullRulesServiceException - Thrown if unable to create the ruleset
protected void createRulesetForXML(java.lang.String rulesetURI,
com.beasys.commerce.axiom.reasoning.rules.serviceProvider.ServiceProvider serviceProvider)
throws java.lang.IllegalArgumentException,
RulesServiceException
rulesetURI - The uri of the rule set for which the ruleset should
be created.serviceProvider - The service provider that will create the rulesetjava.lang.IllegalArgumentException - Thrown if rulesetURI is null or zero-length,
or if serviceProvider is nullRulesServiceException - Thrown if unable to create the ruleset
protected java.lang.String createFullyQualifiedURIForURI(java.lang.String rulesetURI)
throws java.lang.IllegalArgumentException,
RulesServiceException
rulesetURI - The rule set urijava.lang.IllegalArgumentException - Thrown if rulesetURI is null or zero-lengthRulesServiceException - Thrown if unable to create the uri
protected java.lang.String getMimeTypeForURI(java.lang.String rulesetURI)
throws java.lang.IllegalArgumentException,
RulesServiceException
rulesetURI - The uri for which the mime type should be obtainedjava.lang.IllegalArgumentException - Thrown if rulesetURI is null or zero-lengthRulesServiceException - Thrown if unable to determine mime type
protected com.beasys.commerce.axiom.reasoning.rules.serviceProvider.ServiceProvider getServiceProviderForMimeType(java.lang.String mimeType)
throws java.lang.IllegalArgumentException,
RulesServiceException
mimeType - The mime type to be servicedjava.lang.IllegalArgumentException - Thrown if mimeType is null or zero-lengthRulesServiceException - Thrown if unable to determine a service providerprotected void performRulesetMaintenance()
protected boolean rulesetMaintenanceNeeded()
|
BEA Systems, Inc. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||