|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PersisterFactory
An interface to Persister factories. The default constructor
returns a persister to the default repository. Constructors with a connection
alias key of type java.lang.String as the first parameter
return a persister to the corresponding repository.
The factory is configured through an implementation specific property file. In addition, attribute types for dynamic variables, i.e. subclasses of the default Variable implementation defined automatically for missing classes declared in class descriptors, can be specified using the following syntax:
## # Primitive JDBC types (default is objects). #jdbc.type.TINYINT: byte #jdbc.type.SMALLINT: short #jdbc.type.INTEGER: int #jdbc.type.BIGINT: long #jdbc.type.REAL: float #jdbc.type.FLOAT: double #jdbc.type.DOUBLE: double
| Field Summary | |
|---|---|
static String |
ANY_ALIAS
The wildcard expression. |
static String |
EXT_BASE_CLASS_NAME
The external super class attribute. |
static String |
EXT_BEGIN_CLASS
The external begin class attribute. |
static String |
EXT_BEGIN_FIELD
The external begin field attribute. |
static String |
EXT_BLANK_ACCEPTED
The external blank accepted attribute. |
static String |
EXT_CLONEABLE
The external cloneable attribute. |
static String |
EXT_COLLECTION
The external collection attribute. |
static String |
EXT_COMPARATOR_CLASS_NAME
The external comparator attribute. |
static String |
EXT_CORRELATIVE
The external correlative attribute. |
static String |
EXT_DESCENDING
The external descending attribute. |
static String |
EXT_DESCRIPTION
The external description attribute. |
static String |
EXT_DETAIL
The external detail attribute. |
static String |
EXT_DISABLED
The external disabled attribute. |
static String |
EXT_EMPTY_ACCEPTED
The external empty accepted attribute. |
static String |
EXT_END_CLASS
The external end class attribute. |
static String |
EXT_END_FIELD
The external end field attribute. |
static String |
EXT_ENUM_NAME
The external enum name attribute. |
static String |
EXT_ENUM_VALUE
The external enum value attribute. |
static String |
EXT_ENUMERATED
The external enumeration attribute. |
static String |
EXT_EXPORTER_CLASS_NAME
The external exporter attribute. |
static String |
EXT_GROUP
The external group attribute. |
static String |
EXT_IMPORTER_CLASS_NAME
The external importer attribute. |
static String |
EXT_INDEX
The external index attribute. |
static String |
EXT_INTERACTIVE
The external interactive attribute. |
static String |
EXT_LOCAL
The external local attribute. |
static String |
EXT_LOCALIZED
The external localized attribute. |
static String |
EXT_MANDATORY
The external mandatory attribute. |
static String |
EXT_MAX_VALUE
The external max value attribute. |
static String |
EXT_MIN_VALUE
The external min value attribute. |
static String |
EXT_NAME_PATTERN
The external name pattern attribute. |
static String |
EXT_OPTIONS
The external options attribute. |
static String |
EXT_ORDER_BY
The external order-by attribute. |
static String |
EXT_ORDERED
The external ordered attribute. |
static String |
EXT_PATTERN
The external pattern attribute. |
static String |
EXT_PRIMARY
The external primary attribute. |
static String |
EXT_READABLE
The external readable attribute. |
static String |
EXT_REFERENCE
The external reference attribute. |
static String |
EXT_SERIALIZED
The external serialized attribute. |
static String |
EXT_SHADOW
The external shadow attribute. |
static String |
EXT_SORTED
The external sorted attribute. |
static String |
EXT_TRACEABLE
The external traceable attribute. |
static String |
EXT_TRANSIENT
The external transient attribute. |
static String |
EXT_TRIMMED
The external trimmed attribute. |
static String |
EXT_TYPE
The external type attribute. |
static String |
EXT_VALIDATOR_CLASS_NAME
The external validator attribute. |
static String |
EXT_VALUE
The external value attribute. |
static String |
EXT_VISIBLE
The external visible attribute. |
static String |
EXT_WRITABLE
The external writable attribute. |
static String |
JDBC_TYPE_PROPERTY
The JDBC type property. |
| Method Summary | |
|---|---|
void |
addClassDescriptor(String descriptor)
Adds a new class descriptor for all connections in the repository. |
void |
addClassDescriptor(String expr,
String descriptor)
Adds a new class descriptor for the specified connections in the repository. |
void |
addClassDescriptor(String expr,
String descriptor,
Map types)
Adds a new class descriptor for the specified connections in the repository. |
void |
clearClassDescriptors()
Clears all class decriptors. |
void |
clearConnectionDescriptors()
Clears all connection decriptors. |
boolean |
containsClassDescriptor(String expr,
String className)
Checks whether the specified class descriptor is mapped. |
boolean |
containsConnectionDescriptor(String key)
Checks whether the specified connection descriptor is mapped. |
String |
getAttributeType(String jdbcType)
Gets the Java attribute type corresponding to the specified JDBC type. |
String |
getConnectionDTD()
Gets the connection DTD. |
String |
getConnectionURL(String key)
Gets the URL of the specified connection. |
String |
getConnectionUsername(String key)
Gets the username of the specified connection. |
String |
getDefaultConnectionKey()
Gets the key of the default connection. |
long |
getLastModified(String key)
Gets the last modification time of the specified connection. |
String |
getRepositoryDTD()
Gets the repository DTD. |
ObjectName |
getVariableRegistryName()
Gets the the variable registry of this factory. |
boolean |
isCombinedFactoryCache()
Checks whether objects from all connections should be cached in only one combined factory cache. |
boolean |
isRefreshReferencesEnabled()
Checks whether automatic refresh of references is enabled. |
boolean |
isTraceReferencesDisabled()
Checks whether traced refresh of references is disabled. |
Set |
jdbcTypeSet()
Returns a read-only set of JDBC types mapped either to a default type or to a specified attribute type. |
Collection |
query(String className,
String expr,
boolean sql)
Queries for instances of the specified class by applying a query language. |
Collection |
query(String key,
String className,
String expr,
boolean sql)
Queries for instances of the specified class through the named connection by applying a query language. |
void |
removeAttributeType(String jdbcType)
Removes the Java attribute type corresponding to the specified JDBC type and restores the default mapping of the corresponding JDBC type. |
void |
removeConnectionDescriptor(String key)
Removes the default connection descriptor from the repository. |
void |
removeConnectionDescriptor(String key,
String user,
String pswd)
Removes the specified connection descriptor from the repository. |
void |
setAttributeType(String jdbcType,
String attributeType)
Sets the Java attribute type corresponding to the specified JDBC type. |
void |
setCombinedFactoryCache(boolean flag)
Sets whether objects from all connections should be cached in only one combined factory cache. |
void |
setConnectionDescriptor(String descriptor)
Sets a connection descriptor in the repository. |
void |
setConnectionDescriptor(String descriptor,
Object[] params)
Sets a connection descriptor in the repository. |
void |
setConnectionDTD(String path)
Sets the connection DTD. |
void |
setConnectionPassword(String key,
String pswd)
Sets the password of the specified connection. |
void |
setConnectionURL(String key,
String url)
Sets the URL of the specified connection. |
void |
setConnectionUsername(String key,
String user)
Gets the username of the specified connection. |
void |
setDefaultConnectionKey(String key)
Sets the key of the default connection. |
void |
setDefaultConnectionKey(String key,
String user,
String pswd)
Sets the key, username and password of the default connection. |
void |
setRefreshReferencesEnabled(boolean flag)
Sets whether automatic refresh of references is enabled. |
void |
setRepositoryDTD(String path)
Sets the repository DTD. |
void |
setTraceReferencesDisabled(boolean flag)
Sets whether traced refresh of references is disabled. |
void |
setVariableRegistryName(ObjectName registry)
Sets the variable registry of this factory. |
| Methods inherited from interface org.norther.tammi.core.base.ObjectFactory |
|---|
getInstance, getInstance, getInstance, getInstance, isLoaderSupported |
| Methods inherited from interface org.norther.tammi.core.config.Configurable |
|---|
addProperty, addProperty, clearProperties, containsProperty, getConfigKey, getProperties, getProperty, getPropertyFilePath, indexOfProperty, propertyMap, propertyMap, removeProperty, removeProperty, setConfigKey, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, storeProperties |
| Methods inherited from interface org.norther.tammi.core.cache.KeyCacheClient |
|---|
cacheKeySet, clearCaches, getCache, removeCache |
| Methods inherited from interface org.norther.tammi.core.cache.CacheClient |
|---|
clearCached, expireCached, expireFraction, getCache, isCachingDisabled, removeCache, setCachingDisabled |
| Methods inherited from interface org.norther.tammi.core.base.Refreshable |
|---|
getRefreshed, refresh |
| Field Detail |
|---|
static final String ANY_ALIAS
static final String EXT_BEGIN_CLASS
static final String EXT_END_CLASS
static final String EXT_BASE_CLASS_NAME
static final String EXT_IMPORTER_CLASS_NAME
static final String EXT_EXPORTER_CLASS_NAME
static final String EXT_VALIDATOR_CLASS_NAME
static final String EXT_COMPARATOR_CLASS_NAME
static final String EXT_NAME_PATTERN
static final String EXT_BEGIN_FIELD
static final String EXT_END_FIELD
static final String EXT_INDEX
static final String EXT_VALUE
static final String EXT_TYPE
static final String EXT_DESCRIPTION
static final String EXT_GROUP
static final String EXT_DETAIL
static final String EXT_VISIBLE
static final String EXT_READABLE
static final String EXT_WRITABLE
static final String EXT_CLONEABLE
static final String EXT_MANDATORY
static final String EXT_TRANSIENT
static final String EXT_SERIALIZED
static final String EXT_CORRELATIVE
static final String EXT_INTERACTIVE
static final String EXT_REFERENCE
static final String EXT_COLLECTION
static final String EXT_PRIMARY
static final String EXT_LOCALIZED
static final String EXT_ORDERED
static final String EXT_SORTED
static final String EXT_TRACEABLE
static final String EXT_DISABLED
static final String EXT_TRIMMED
static final String EXT_BLANK_ACCEPTED
static final String EXT_EMPTY_ACCEPTED
static final String EXT_LOCAL
static final String EXT_OPTIONS
static final String EXT_MIN_VALUE
static final String EXT_MAX_VALUE
static final String EXT_PATTERN
static final String EXT_SHADOW
static final String EXT_ENUMERATED
static final String EXT_ENUM_NAME
static final String EXT_ENUM_VALUE
static final String EXT_ORDER_BY
static final String EXT_DESCENDING
static final String JDBC_TYPE_PROPERTY
| Method Detail |
|---|
long getLastModified(String key)
key - the connection key.
String getDefaultConnectionKey()
void setDefaultConnectionKey(String key)
key - the key of the default connection.
void setDefaultConnectionKey(String key,
String user,
String pswd)
key - the key of the default connection.user - the username of the default connection.pswd - the password of the default connection.String getConnectionUsername(String key)
key - the key of the connection.
void setConnectionUsername(String key,
String user)
key - the key of the connection.user - the username of the connection.
void setConnectionPassword(String key,
String pswd)
key - the key of the connection.pswd - the password of the connection.String getConnectionURL(String key)
key - the key of the connection.
void setConnectionURL(String key,
String url)
key - the key of the connection.url - the URL of the connection.String getConnectionDTD()
void setConnectionDTD(String path)
path - the connection DTD.
void setConnectionDescriptor(String descriptor)
throws LogException
descriptor - the connection descriptor.
LogException - on errors.
void setConnectionDescriptor(String descriptor,
Object[] params)
throws LogException
descriptor - the connection descriptor.params - message format parameters.
LogException - on errors.boolean containsConnectionDescriptor(String key)
key - the key i.e. the alias name of the connection.
void removeConnectionDescriptor(String key)
key - the key i.e. the alias name of the connection.
void removeConnectionDescriptor(String key,
String user,
String pswd)
key - the key i.e. the alias name of the connection.user - the username of the connection.pswd - the password of the connection.void clearConnectionDescriptors()
String getRepositoryDTD()
void setRepositoryDTD(String path)
path - the repository DTD.
void addClassDescriptor(String descriptor)
throws LogException
Declared but missing classes are defined and loaded as VariableMBeans containing the declared fields as their attributes.
descriptor - the class descriptor.
LogException - on errors.
void addClassDescriptor(String expr,
String descriptor)
throws LogException
Declared but missing classes are defined and loaded as Variables containing the declared fields as their attributes.
expr - the expression matching connection aliases.descriptor - the class descriptor.
LogException - on errors.
void addClassDescriptor(String expr,
String descriptor,
Map types)
throws LogException
Declared but missing classes are defined and loaded as Variables containing the declared fields as their attributes. The types of the attributes corresponding to the declared JDBC types can be given in a separate type map. Default types are applied to undefined types.
expr - the expression matching connection aliases.descriptor - the class descriptor.types - JDBC type mappings.
LogException - on errors.
boolean containsClassDescriptor(String expr,
String className)
expr - the expression matching connection aliases.className - the name of the class.
void clearClassDescriptors()
String getAttributeType(String jdbcType)
jdbcType - the JDBC type.
void setAttributeType(String jdbcType,
String attributeType)
jdbcType - the JDBC type.attributeType - the corresponding Java type name.void removeAttributeType(String jdbcType)
jdbcType - the JDBC type.Set jdbcTypeSet()
boolean isCombinedFactoryCache()
void setCombinedFactoryCache(boolean flag)
Note that the factory cache is applied only if explicitly configured.
flag - true for a combined cache, false otherwise.boolean isRefreshReferencesEnabled()
void setRefreshReferencesEnabled(boolean flag)
flag - true if enabled, false otherwise.boolean isTraceReferencesDisabled()
void setTraceReferencesDisabled(boolean flag)
flag - true if disabled, false otherwise.ObjectName getVariableRegistryName()
void setVariableRegistryName(ObjectName registry)
registry - the object name of the variable registry or a query.
Collection query(String className,
String expr,
boolean sql)
throws Exception
className - the class name.expr - the query expression.sql - a flag to apply SQL.
Exception - on errors.
Collection query(String key,
String className,
String expr,
boolean sql)
throws Exception
key - the connection key.className - the class name.expr - the query expression.sql - a flag to apply SQL.
Exception - on errors.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||