SRJRCFrames
v0.1.296

de.schwarzrot.data.access.pref
Class PreferencesEntityManager

java.lang.Object
  extended by de.schwarzrot.data.access.support.AbstractEntityManager
      extended by de.schwarzrot.data.access.pref.PreferencesEntityManager
All Implemented Interfaces:
EntityManager

public class PreferencesEntityManager
extends AbstractEntityManager

a manager to handle configuration entities. Those entities are stored as preferences and may consist of a user and a system part. On reading, system parts are used as fallback and are considered readonly on normal application run.

Writing of user or system part depends on the jvm permissions. Configuration entities are considered being singletons, so any given condition arguments are ignored and all variants of find() or get() return the same instance.

Author:
Reinhard Mantey
See Also:
AbstractConfigBase

Field Summary
 
Fields inherited from class de.schwarzrot.data.access.support.AbstractEntityManager
appDefaults
 
Constructor Summary
PreferencesEntityManager()
           
 
Method Summary
 void commit(TransactionResource<?> resource)
          used to persist all changes made during transaction.
 TransactionResource<?> createTransactionResource(Transaction t)
          create an abstract handle to storage.
 void execute(TransactionalOperation<?> tao)
          execute a single step of ApplicationTransaction
protected
<E extends Entity>
void
fillEntity(E entity, EntityDescriptor ed, DataAccessor da)
           
 EntityDescriptor getEntityDescriptor(Class<?> entityType, TransactionResource<?> res)
          accessor to description instances of entities.
protected static Map<String,Integer> getSkipList()
           
protected
<E extends Entity>
void
readForeigns(E any, EntityDescriptor ed, PreferencesManager pm)
           
protected
<E extends Entity>
void
readNamedChildren(E any, EntityDescriptor ed, PreferencesManager pm)
           
protected
<E extends Entity>
void
readRelated(E any, EntityDescriptor ed, PreferencesManager pm)
           
protected
<E extends Entity>
void
readUnnamedChildren(E any, EntityDescriptor ed)
           
 void releaseTransactionResource(TransactionResource<?> resource)
          free given storage handle
 void rollback(TransactionResource<?> resource)
          discards changes of given storage handle and marks Transaction as failed.
protected
<E extends Entity>
int
saveConfig(PreferencesManager pm, E any, EntityDescriptor ed, boolean writeSystemConfig)
           
protected
<E extends Entity>
int
saveForeigns(PreferencesManager pm, E any, EntityDescriptor ed, boolean writeSystemConfig)
           
protected
<E extends Entity>
int
saveMap(PreferencesManager pm, E any, String name, Map<?,?> children, EntityDescriptor ed, boolean writeSystemConfig)
           
protected
<E extends Entity>
int
saveNamedChildren(PreferencesManager pm, E any, EntityDescriptor ed, boolean writeSystemConfig)
           
protected
<E extends Entity>
int
saveProperties(PreferencesManager pm, E instance, String nodePath, EntityDescriptor ed, Collection<String> propertyNames, boolean writeSystemConfig)
           
protected
<E extends Entity>
int
saveUnnamedChildren(PreferencesManager pm, E any, EntityDescriptor ed, boolean writeSystemConfig)
           
 
Methods inherited from class de.schwarzrot.data.access.support.AbstractEntityManager
dumpTypeCache, getApplicationDefaults, getApplicationName, getEntityCache, getEntityIntrospector, getEntityUtils, getName, getSchemaName, getSchemaName, getUserNameProvider, loadClass, needsTransaction, setEntityCache, setEntityIntrospector, setEntityUtils, setSchemaName, setSchemaName, setUserNameProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreferencesEntityManager

public PreferencesEntityManager()
Method Detail

commit

public void commit(TransactionResource<?> resource)
            throws Exception
Description copied from interface: EntityManager
used to persist all changes made during transaction.

Parameters:
resource - - an abstract handle to storage
Throws:
Exception - - depends on implementation

createTransactionResource

public TransactionResource<?> createTransactionResource(Transaction t)
                                                 throws Exception
Description copied from interface: EntityManager
create an abstract handle to storage. TransactionResource is a wrapper to handle jdbc and preferences the same way.

Parameters:
t - - the transaction
Returns:
- a wrapped storage handle
Throws:
Exception - - depends on implementation

execute

public void execute(TransactionalOperation<?> tao)
             throws Exception
Description copied from interface: EntityManager
execute a single step of ApplicationTransaction

Parameters:
tao - - the transactional operation to execute
Throws:
Exception - - depends on implementation

getEntityDescriptor

public final EntityDescriptor getEntityDescriptor(Class<?> entityType,
                                                  TransactionResource<?> res)
Description copied from interface: EntityManager
accessor to description instances of entities. An EntityDescriptor holds all information needed by an EntityManager to handle instances of that entity. The EntityDescriptor may vary between different EntityManager s.

Parameters:
entityType - - the class of that entity
res - - the wrapped storage handle
Returns:
- the descriptor for that entity

releaseTransactionResource

public void releaseTransactionResource(TransactionResource<?> resource)
Description copied from interface: EntityManager
free given storage handle

Parameters:
resource - - a wrapped storage handle

rollback

public void rollback(TransactionResource<?> resource)
Description copied from interface: EntityManager
discards changes of given storage handle and marks Transaction as failed.

Parameters:
resource - - a wrapped storage handle

fillEntity

protected <E extends Entity> void fillEntity(E entity,
                                             EntityDescriptor ed,
                                             DataAccessor da)

readForeigns

protected <E extends Entity> void readForeigns(E any,
                                               EntityDescriptor ed,
                                               PreferencesManager pm)

readNamedChildren

protected <E extends Entity> void readNamedChildren(E any,
                                                    EntityDescriptor ed,
                                                    PreferencesManager pm)

readRelated

protected <E extends Entity> void readRelated(E any,
                                              EntityDescriptor ed,
                                              PreferencesManager pm)

readUnnamedChildren

protected <E extends Entity> void readUnnamedChildren(E any,
                                                      EntityDescriptor ed)

saveConfig

protected <E extends Entity> int saveConfig(PreferencesManager pm,
                                            E any,
                                            EntityDescriptor ed,
                                            boolean writeSystemConfig)

saveForeigns

protected <E extends Entity> int saveForeigns(PreferencesManager pm,
                                              E any,
                                              EntityDescriptor ed,
                                              boolean writeSystemConfig)

saveMap

protected <E extends Entity> int saveMap(PreferencesManager pm,
                                         E any,
                                         String name,
                                         Map<?,?> children,
                                         EntityDescriptor ed,
                                         boolean writeSystemConfig)

saveNamedChildren

protected <E extends Entity> int saveNamedChildren(PreferencesManager pm,
                                                   E any,
                                                   EntityDescriptor ed,
                                                   boolean writeSystemConfig)

saveProperties

protected <E extends Entity> int saveProperties(PreferencesManager pm,
                                                E instance,
                                                String nodePath,
                                                EntityDescriptor ed,
                                                Collection<String> propertyNames,
                                                boolean writeSystemConfig)

saveUnnamedChildren

protected <E extends Entity> int saveUnnamedChildren(PreferencesManager pm,
                                                     E any,
                                                     EntityDescriptor ed,
                                                     boolean writeSystemConfig)

getSkipList

protected static Map<String,Integer> getSkipList()

SRJRCFrames
v0.1.296

hosted at
Find SRJRCFrames at SourceForge.net. Fast, secure and free:
           Open Source Software download
Submit a bug or request a feature

SRJRCFrames is published according to the GNU General Public License
Copyright 2005-2012 Reinhard Mantey - some rights reserved.