|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.jmi.mem.JmiMemFactory
public abstract class JmiMemFactory
JmiMemFactory creates objects for use in an in-memory repository implementation.
Nested Class Summary | |
---|---|
(package private) static interface |
JmiMemFactory.Element
Implemented by proxy objects, this interface makes the proxy handler object accessible. |
protected class |
JmiMemFactory.ElementImpl
Implementation of a RefBaseObject via an InvocationHandler interface. |
private static class |
JmiMemFactory.ManyList
List which holds instances of a bi-directional relationship. |
private static class |
JmiMemFactory.MethodId
Enumeration of common method names to be handled by the proxy. |
protected class |
JmiMemFactory.MofPackageImpl
|
private static class |
JmiMemFactory.OneWayList
List which holds instances of a many-to-one relationship. |
protected class |
JmiMemFactory.RefAssociationImpl
Specialized handler for implementing a RefAssociation via a
dynamic proxy. |
protected class |
JmiMemFactory.RefClassImpl
Specialized handler for implementing a RefClass via a dynamic
proxy. |
protected class |
JmiMemFactory.RefPackageImpl
Specialized handler for implementing a RefPackage via a dynamic
proxy. |
(package private) static class |
JmiMemFactory.Relationship
Definition of a relationship. |
Field Summary | |
---|---|
private Map<Class,RefClass> |
classMap
|
private static Double |
DoubleZero
|
private static Float |
FloatZero
|
private HashMap<Class<? extends RefBaseObject>,RefObject> |
metaMap
|
private static Map<String,JmiMemFactory.MethodId> |
methodMap
|
private AtomicLong |
nextId
|
private Map<RefObject,RefPackage> |
pluginPackageMap
|
private Map<String,JmiMemFactory.Relationship> |
relationshipMap
|
private JmiMemFactory.RefPackageImpl |
rootPackageImpl
|
Constructor Summary | |
---|---|
JmiMemFactory()
|
Method Summary | ||
---|---|---|
protected JmiMemFactory.ElementImpl |
createImpl(Class<? extends RefBaseObject> clazz,
JmiMemFactory.RefPackageImpl immediatePkg,
boolean preemptive)
Creates the right kind of implementation class to implement the given interface. |
|
void |
createRelationship(Class<? extends RefBaseObject> fromClass,
String fromName,
boolean fromMany,
Class<? extends RefBaseObject> toClass,
String toName,
boolean toMany,
boolean composite)
Creates a relationship definition |
|
void |
createRelationship(Class<? extends RefObject> fromClass,
String fromName,
boolean fromMany,
Class<? extends RefObject> toClass,
String toName,
boolean toMany)
Creates a relationship definition |
|
void |
defineMetaObject(Class<? extends RefBaseObject> iface,
RefObject metaObject)
Defines a meta-object. |
|
protected JmiModelGraph |
getModelGraph()
|
|
String |
getPersistentMofId(RefBaseObject obj)
Gets the MOFID of a persistent object associated with an in-memory object. |
|
RefPackage |
getRootPackage()
|
|
protected JmiMemFactory.RefPackageImpl |
getRootPackageImpl()
|
|
private JmiMemFactory.Relationship |
lookupRelationship(Class<? extends RefBaseObject> fromClass,
String fromName)
Looks up a relationship. |
|
protected void |
mapMofId(RefBaseObject refObj,
String mofId)
Notifies subclasses that a new object has been created with the given MOFID. |
|
|
newRefPackage(Class<T> ifacePackage)
Creates a new package explicitly (rather than reflectively), locating it as a child of the root package. |
|
protected abstract JmiMemFactory.RefPackageImpl |
newRootPackage()
|
|
protected String |
parseGetter(String methodName)
|
|
void |
setPersistentMofId(RefBaseObject obj,
String persistentMofId)
Associates the MOFID of a persistent object with an in-memory object. |
|
protected static Method[] |
sortMethods(Method[] methods)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Float FloatZero
private static final Double DoubleZero
private static final Map<String,JmiMemFactory.MethodId> methodMap
private final AtomicLong nextId
private final JmiMemFactory.RefPackageImpl rootPackageImpl
private final Map<String,JmiMemFactory.Relationship> relationshipMap
private final HashMap<Class<? extends RefBaseObject>,RefObject> metaMap
private final Map<RefObject,RefPackage> pluginPackageMap
private final Map<Class,RefClass> classMap
Constructor Detail |
---|
public JmiMemFactory()
Method Detail |
---|
public RefPackage getRootPackage()
public void setPersistentMofId(RefBaseObject obj, String persistentMofId)
obj
- in-memory objectpersistentMofId
- MOFID of persistent object to setpublic String getPersistentMofId(RefBaseObject obj)
obj
- in-memory object
public <T extends RefPackage> T newRefPackage(Class<T> ifacePackage)
ifacePackage
- interface corresponding to RefPackage
protected void mapMofId(RefBaseObject refObj, String mofId)
refObj
- new objectmofId
- MOFID assignedprotected abstract JmiMemFactory.RefPackageImpl newRootPackage()
protected JmiMemFactory.RefPackageImpl getRootPackageImpl()
protected JmiMemFactory.ElementImpl createImpl(Class<? extends RefBaseObject> clazz, JmiMemFactory.RefPackageImpl immediatePkg, boolean preemptive)
protected static Method[] sortMethods(Method[] methods)
private JmiMemFactory.Relationship lookupRelationship(Class<? extends RefBaseObject> fromClass, String fromName)
fromClass
- Name class the relationship is fromfromName
- Name of the relationship
public void createRelationship(Class<? extends RefObject> fromClass, String fromName, boolean fromMany, Class<? extends RefObject> toClass, String toName, boolean toMany)
public void defineMetaObject(Class<? extends RefBaseObject> iface, RefObject metaObject)
iface
- Java interface to associate with meta-objectmetaObject
- meta-object to return for RefBaseObject.refMetaObject()
from instances of ifacepublic void createRelationship(Class<? extends RefBaseObject> fromClass, String fromName, boolean fromMany, Class<? extends RefBaseObject> toClass, String toName, boolean toMany, boolean composite)
protected String parseGetter(String methodName)
protected JmiModelGraph getModelGraph()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |