|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.Adaptee
org.norther.tammi.core.config.DefaultConfigurable
org.norther.tammi.core.config.DefaultConfigurableFactory
org.norther.tammi.root.db.AbstractPersisterFactory
org.norther.tammi.root.ojb.DefaultOJBPersisterFactory
public class DefaultOJBPersisterFactory
A default implementation of OJBPersisterFactory.
| Field Summary | |
|---|---|
static String |
BASE
The base key for connections. |
static String |
HOST
The host key for connections. |
| Fields inherited from class org.norther.tammi.root.db.AbstractPersisterFactory |
|---|
DESCRIPTION_SUFFIX, DOCTYPE, PRINCIPAL_CLASS_NAME, XML_HEADER |
| Fields inherited from class org.norther.tammi.core.config.DefaultConfigurable |
|---|
MODIFIED, SYNCHRONIZED, UNMODIFIED |
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Fields inherited from interface org.norther.tammi.root.ojb.OJBPersisterFactory |
|---|
EXT_INITIALIZER_CLASS_NAME, PERSISTER_CLASS_NAME |
| Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate |
|---|
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE |
| Constructor Summary | |
|---|---|
DefaultOJBPersisterFactory()
Constructs a new factory. |
|
| Method Summary | |
|---|---|
void |
addClassDescriptor(String expr,
String descriptor,
Map types)
Adds a new class descriptor for the specified connections in the repository. |
Map |
classDescriptorMap()
Returns a map of defined class descriptors. |
void |
clearClassDescriptors()
Clears all class decriptors. |
void |
clearConnectionDescriptors()
Clears all connection decriptors. |
Map |
connectionDescriptorMap()
Returns a map of defined connection descriptors. |
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. |
ClassDescriptor |
getClassDescriptor(String className)
Gets the class descriptor of the specified class from the repository. |
JdbcConnectionDescriptor |
getConnectionDescriptor()
Gets the default connection descriptor from the repository. |
JdbcConnectionDescriptor |
getConnectionDescriptor(String key)
Gets the connection descriptor of the specified connection from the repository. |
JdbcConnectionDescriptor |
getConnectionDescriptor(String key,
String user,
String pswd)
Gets the connection descriptor of the specified connection for the given user from the repository. |
String |
getConnectionPlatform(String key)
Gets the DB platform of the specified connection. |
String |
getConnectionURL(String key)
Gets the URL of the specified connection. |
String |
getConnectionUsername(String key)
Gets the username of the specified connection. |
protected String |
getDefaultConnectionDTD()
Gets the default connection DTD. |
String |
getDefaultConnectionKey()
Gets the key of the default connection. |
protected String |
getDefaultRepositoryDTD()
Gets the default repository DTD. |
FieldDescriptor |
getFieldDescriptor(String className,
String attribute)
Gets the field descriptor of the specified class and attribute from the repository. |
Object |
getInstance(String className,
ObjectName loader,
Object[] params,
String[] signature)
Gets an instance of a named class using a specified class loader. |
String |
getLoggingFilePath()
Gets the logging file path. |
protected List |
getParsedAttributeInfo(String className,
Object repository,
OrderedMap externals,
Map types)
Gets the parsed attributes of a named class in the repository. |
boolean |
isLoaderSupported(String className)
Checks if specified class loaders are supported for a named class. |
boolean |
isStarted()
Checks whether the startable has been started. |
void |
postmanaged()
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time. |
void |
removeConnectionDescriptor(String key,
String user,
String pswd)
Removes the specified connection descriptor from the repository. |
void |
setConnectionDescriptor(String descriptor,
Object[] params)
Sets a connection descriptor in the repository. |
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 username,
String password)
Sets the key, username and password of the default connection. |
void |
setLoggingFilePath(String path)
Sets the logging file path. |
void |
setPropertyFilePath(String path,
String encoding)
Sets the property file path with encoding. |
void |
start()
Starts the MBean. |
void |
stop()
Stops the MBean. |
void |
unmanaged()
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time. |
| Methods inherited from class org.norther.tammi.core.config.DefaultConfigurableFactory |
|---|
getInstance, getInstance, getInstance |
| Methods inherited from class org.norther.tammi.core.config.DefaultConfigurable |
|---|
addProperty, addProperty, clearProperties, containsProperty, getConfigKey, getConfiguration, getModifiedState, getProperties, getProperty, getPropertyFilePath, indexOfProperty, loadConfiguration, loadConfiguration, loadConfiguration, modified, propertyMap, propertyMap, removeProperty, removeProperty, setConfigKey, setModifiedState, setProperties, setProperty, setPropertyFilePath, storeProperties |
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
|---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.norther.tammi.core.base.ObjectFactory |
|---|
getInstance, getInstance, getInstance |
| 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, 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 |
| Methods inherited from interface org.norther.tammi.root.db.PersisterListener |
|---|
modified |
| Field Detail |
|---|
public static final String HOST
public static final String BASE
| Constructor Detail |
|---|
public DefaultOJBPersisterFactory()
| Method Detail |
|---|
public void postmanaged()
Manageable
postmanaged in interface Manageablepostmanaged in class AbstractPersisterFactory
public void unmanaged()
throws Exception
Manageable
unmanaged in interface Manageableunmanaged in class AbstractPersisterFactoryException - if the adaptee refused to be unmanaged.public boolean isStarted()
Startable
isStarted in interface Startable
public void start()
throws Exception
Startable
start in interface StartableException - if start fails.public void stop()
Startable
stop in interface Startablepublic String getDefaultConnectionKey()
PersisterFactory
getDefaultConnectionKey in interface PersisterFactorypublic void setDefaultConnectionKey(String key)
PersisterFactory
setDefaultConnectionKey in interface PersisterFactorykey - the key of the default connection.
public void setDefaultConnectionKey(String key,
String username,
String password)
PersisterFactory
setDefaultConnectionKey in interface PersisterFactorykey - the key of the default connection.username - the username of the default connection.password - the password of the default connection.public String getConnectionUsername(String key)
PersisterFactory
getConnectionUsername in interface PersisterFactorykey - the key of the connection.
public void setConnectionUsername(String key,
String user)
PersisterFactory
setConnectionUsername in interface PersisterFactorykey - the key of the connection.user - the username of the connection.
public void setConnectionPassword(String key,
String pswd)
PersisterFactory
setConnectionPassword in interface PersisterFactorykey - the key of the connection.pswd - the password of the connection.public String getConnectionURL(String key)
PersisterFactory
getConnectionURL in interface PersisterFactorykey - the key of the connection.
public void setConnectionURL(String key,
String url)
PersisterFactory
setConnectionURL in interface PersisterFactorykey - the key of the connection.url - the URL of the connection.
public void setConnectionDescriptor(String descriptor,
Object[] params)
throws LogException
PersisterFactory
setConnectionDescriptor in interface PersisterFactorydescriptor - the connection descriptor.params - message format parameters.
LogException - on errors.public boolean containsConnectionDescriptor(String key)
PersisterFactory
containsConnectionDescriptor in interface PersisterFactorykey - the key i.e. the alias name of the connection.
public void removeConnectionDescriptor(String key,
String user,
String pswd)
PersisterFactory
removeConnectionDescriptor in interface PersisterFactorykey - the key i.e. the alias name of the connection.user - the username of the connection.pswd - the password of the connection.public void clearConnectionDescriptors()
PersisterFactory
clearConnectionDescriptors in interface PersisterFactory
public void addClassDescriptor(String expr,
String descriptor,
Map types)
throws LogException
PersisterFactoryDeclared 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.
addClassDescriptor in interface PersisterFactoryexpr - the expression matching connection aliases.descriptor - the class descriptor.types - JDBC type mappings.
LogException - on errors.
public boolean containsClassDescriptor(String expr,
String className)
PersisterFactory
containsClassDescriptor in interface PersisterFactoryexpr - the expression matching connection aliases.className - the name of the class.
public void clearClassDescriptors()
PersisterFactory
clearClassDescriptors in interface PersisterFactorypublic JdbcConnectionDescriptor getConnectionDescriptor()
OJBPersisterFactoryNote that the descriptor is cloned from the original one.
getConnectionDescriptor in interface OJBPersisterFactorypublic JdbcConnectionDescriptor getConnectionDescriptor(String key)
OJBPersisterFactoryNote that the descriptor is cloned from the original one.
getConnectionDescriptor in interface OJBPersisterFactorykey - the key i.e. the alias name of the connection.
public JdbcConnectionDescriptor getConnectionDescriptor(String key,
String user,
String pswd)
OJBPersisterFactoryNote that the descriptor is cloned from the original one.
getConnectionDescriptor in interface OJBPersisterFactorykey - the key i.e. the alias name of the connection.user - the username of the connection.pswd - the password of the connection.
public Map connectionDescriptorMap()
OJBPersisterFactory
connectionDescriptorMap in interface OJBPersisterFactorypublic String getConnectionPlatform(String key)
OJBPersisterFactory
getConnectionPlatform in interface OJBPersisterFactorykey - the key i.e. the alias name of the connection.
public ClassDescriptor getClassDescriptor(String className)
OJBPersisterFactory
getClassDescriptor in interface OJBPersisterFactoryclassName - the name of the class.
public Map classDescriptorMap()
OJBPersisterFactory
classDescriptorMap in interface OJBPersisterFactory
public FieldDescriptor getFieldDescriptor(String className,
String attribute)
OJBPersisterFactory
getFieldDescriptor in interface OJBPersisterFactoryclassName - the name of the class.attribute - the name of the attribute.
public String getLoggingFilePath()
OJBPersisterFactory
getLoggingFilePath in interface OJBPersisterFactorypublic void setLoggingFilePath(String path)
OJBPersisterFactory
setLoggingFilePath in interface OJBPersisterFactorypath - a logging file path.
public void setPropertyFilePath(String path,
String encoding)
Configurable
setPropertyFilePath in interface ConfigurablesetPropertyFilePath in class DefaultConfigurablepath - a property file path.encoding - the encoding to use.
public Object getInstance(String className,
ObjectName loader,
Object[] params,
String[] signature)
throws ConstructionException
ObjectFactoryClass loaders are supported only if the isLoaderSupported method returns true. Otherwise the loader parameter is ignored.
getInstance in interface ObjectFactorygetInstance in class DefaultConfigurableFactoryclassName - the name of the class.loader - the class loader.params - an array containing the parameters of the constructor.signature - an array containing the signature of the constructor.
ConstructionException - if construction fails.public boolean isLoaderSupported(String className)
ObjectFactory
isLoaderSupported in interface ObjectFactoryisLoaderSupported in class DefaultConfigurableFactoryclassName - the name of the class.
protected String getDefaultRepositoryDTD()
AbstractPersisterFactory
getDefaultRepositoryDTD in class AbstractPersisterFactoryprotected String getDefaultConnectionDTD()
AbstractPersisterFactory
getDefaultConnectionDTD in class AbstractPersisterFactory
protected List getParsedAttributeInfo(String className,
Object repository,
OrderedMap externals,
Map types)
AbstractPersisterFactory
getParsedAttributeInfo in class AbstractPersisterFactoryclassName - the name of the class.repository - the class repository.externals - external properties.types - optional type mappings.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||