Package com.nomagic.uml2.ext.jmi.reflect
Class AbstractRepository
- java.lang.Object
-
- com.nomagic.uml2.ext.jmi.reflect.AbstractRefBaseObjectImpl
-
- com.nomagic.uml2.ext.jmi.reflect.AbstractRefPackage
-
- com.nomagic.uml2.ext.jmi.reflect.AbstractRepository
-
- All Implemented Interfaces:
MapOwner
,AbstractRefBaseObject
,RepositoryProvider
,javax.jmi.reflect.RefBaseObject
,javax.jmi.reflect.RefPackage
public abstract class AbstractRepository extends AbstractRefPackage
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AbstractRepository.Calculator
Calculator used in to calculate derived values.static class
AbstractRepository.Calculators
private static class
AbstractRepository.CandidatesForDisposeEventSupport
Support that delivers candidates to remove events to the listenersstatic interface
AbstractRepository.CandidatesForDisposeListener
Candidates for dispose listenerstatic interface
AbstractRepository.IDProxy
class
AbstractRepository.MofRepository
-
Field Summary
Fields Modifier and Type Field Description private boolean
alive
private java.util.Map<AbstractRepository.Calculators,AbstractRepository.Calculator>
calculators
private java.util.Set<javax.jmi.reflect.RefObject>
candidatesForDispose
private AbstractRepository.CandidatesForDisposeEventSupport
candidatesForDisposeEventSupport
private boolean
canSetID
private ElementsFactory
elementsFactory
private java.util.Map<java.lang.String,javax.jmi.reflect.RefEnum>
enumMap
private EventSupport
eventSupport
private Counter
idCounter
private AbstractRepository.IDProxy
idProxy
protected java.util.Collection
interfacePackagePrefixes
protected java.util.Map
interfacePackagePrefixToRefPackage
private ModelListener
modelListener
private TransactionManager
modelTransaction
protected com.io_software.catools.tas.mof.TASMofRepository
mofRepository
private java.util.concurrent.atomic.AtomicLong
objectCount
private ElementRegistry
project
private boolean
rawMode
private com.nomagic.uml2.impl.ValuesTable
valuesTable
private java.util.concurrent.atomic.AtomicLong
version
-
Constructor Summary
Constructors Constructor Description AbstractRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractRepository.Calculator
addCalculator(AbstractRepository.Calculators id, AbstractRepository.Calculator calculator)
void
addCandidateForDispose(javax.jmi.reflect.RefObject object)
void
addCandidatesForDisposeListener(AbstractRepository.CandidatesForDisposeListener listener)
Adds aAbstractRepository.CandidatesForDisposeListener
to get notifications aboutboolean
canSetID()
protected void
checkAlive()
protected void
classProxies()
void
clearCandidatesForDispose()
java.util.Map
createMap(MapOwner owner, java.lang.String mapName)
AbstractRepository.Calculator
getCalculator(AbstractRepository.Calculators calculatorName)
java.util.Set<javax.jmi.reflect.RefObject>
getCandidatesForDispose()
Counter
getCounter()
Standalone repositories (those, having no Project object) can have a separate counter assigned to them.javax.jmi.reflect.RefObject
getElementById(java.lang.String id)
ElementsFactory
getElementsFactory()
EventSupport
getEventSupport()
AbstractRepository.IDProxy
getIDProxy()
com.io_software.catools.tas.mof.TASRepository
getMetamodelProvider()
com.io_software.catools.tas.mof.TASMofRepository
getMofRepository()
int
getObjectsCount()
ElementRegistry
getProject()
AbstractRepository
getRepository()
Get repository.TransactionManager
getTransactionManager()
ModelListener
getTransactionModelListener()
com.nomagic.uml2.impl.ValuesTable
getValuesTable()
long
getVersion()
Returns the repository version.void
invokeAfterTransaction(java.lang.Runnable r)
If at the current moment firing cached events, running runnable after these events are fired.boolean
isAlive()
boolean
isFullPreLoad()
boolean
isRawMode()
Raw mode is when binary associations is not synchronized.void
kill()
Destroys repository.void
nextVersion()
Sets new repository version.javax.jmi.reflect.RefEnum
refGetEnum(java.lang.String enumName, java.lang.String args)
The refGetEnum operation returns the instance of an enumeration (i.e., an enumeration literal) whose value is described by the value of literalName .void
registerElement(javax.jmi.reflect.RefBaseObject object)
void
removeCandidateForDispose(javax.jmi.reflect.RefObject object)
void
removeCandidatesForDisposeListener(AbstractRepository.CandidatesForDisposeListener listener)
void
setCanSetID(boolean canSetID)
void
setCounter(Counter count)
Standalone repositories (those, having no Project object) can have a separate counter assigned to them.void
setElementsFactory(ElementsFactory elementsFactory)
protected void
setEventSupport(EventSupport eventSupport)
void
setIDProxy(AbstractRepository.IDProxy useEsiID)
void
setProject(ElementRegistry project)
void
setRawMode(boolean rawMode)
Raw mode is when binary associations is not synchronized.void
setTransactionManager(TransactionManager modelTransactionImpl)
void
setTransactionModelListener(ModelListener listener)
void
unRegisterElement(javax.jmi.reflect.RefBaseObject object)
-
Methods inherited from class com.nomagic.uml2.ext.jmi.reflect.AbstractRefPackage
addAssociation, addClass, addPackage, getMetaObjects, internalError, refAllAssociations, refAllClasses, refAllPackages, refAssociation, refAssociation, refClass, refClass, refCreateStruct, refCreateStruct, refDelete, refGetEnum, refPackage, refPackage, removeClass, removePackage
-
Methods inherited from class com.nomagic.uml2.ext.jmi.reflect.AbstractRefBaseObjectImpl
mapClear, mapPut, mapPutAll, mapRemove, mof_getRepository, refImmediatePackage, refMetaObject, refMofId, refOutermostPackage, refVerifyConstraints, setMofID, setOwner, setRefMetaObject, setRepository
-
-
-
-
Field Detail
-
calculators
private final java.util.Map<AbstractRepository.Calculators,AbstractRepository.Calculator> calculators
-
objectCount
private final java.util.concurrent.atomic.AtomicLong objectCount
-
idProxy
private AbstractRepository.IDProxy idProxy
-
version
private final java.util.concurrent.atomic.AtomicLong version
-
enumMap
private final java.util.Map<java.lang.String,javax.jmi.reflect.RefEnum> enumMap
-
interfacePackagePrefixToRefPackage
protected java.util.Map interfacePackagePrefixToRefPackage
-
interfacePackagePrefixes
protected java.util.Collection interfacePackagePrefixes
-
eventSupport
private EventSupport eventSupport
-
mofRepository
protected com.io_software.catools.tas.mof.TASMofRepository mofRepository
-
alive
private boolean alive
-
project
private ElementRegistry project
-
canSetID
private boolean canSetID
-
idCounter
private Counter idCounter
-
modelListener
private ModelListener modelListener
-
modelTransaction
private TransactionManager modelTransaction
-
valuesTable
private final com.nomagic.uml2.impl.ValuesTable valuesTable
-
rawMode
private boolean rawMode
-
candidatesForDispose
private final java.util.Set<javax.jmi.reflect.RefObject> candidatesForDispose
-
elementsFactory
private ElementsFactory elementsFactory
-
candidatesForDisposeEventSupport
private final AbstractRepository.CandidatesForDisposeEventSupport candidatesForDisposeEventSupport
-
-
Method Detail
-
isFullPreLoad
public boolean isFullPreLoad()
-
getIDProxy
public AbstractRepository.IDProxy getIDProxy()
-
setIDProxy
public void setIDProxy(AbstractRepository.IDProxy useEsiID)
-
getVersion
public long getVersion()
Returns the repository version. It is a number that will be increased after any repository change.- Returns:
- repository version.
-
nextVersion
public void nextVersion()
Sets new repository version.
-
setEventSupport
protected void setEventSupport(EventSupport eventSupport)
-
getElementsFactory
public ElementsFactory getElementsFactory()
-
setElementsFactory
public void setElementsFactory(ElementsFactory elementsFactory)
-
setTransactionManager
public void setTransactionManager(TransactionManager modelTransactionImpl)
-
getElementById
@CheckForNull public javax.jmi.reflect.RefObject getElementById(java.lang.String id)
- Returns:
- element registered with such id.
-
checkAlive
protected void checkAlive()
-
isAlive
public boolean isAlive()
- Returns:
- true if repository is not killed.
-
kill
public void kill()
Destroys repository.
-
classProxies
protected void classProxies()
-
getMofRepository
public com.io_software.catools.tas.mof.TASMofRepository getMofRepository()
-
createMap
public java.util.Map createMap(MapOwner owner, java.lang.String mapName)
-
getEventSupport
public EventSupport getEventSupport()
- Returns:
- Event support for this repository
-
registerElement
public void registerElement(javax.jmi.reflect.RefBaseObject object)
-
getObjectsCount
public int getObjectsCount()
-
unRegisterElement
public void unRegisterElement(javax.jmi.reflect.RefBaseObject object)
-
getRepository
public AbstractRepository getRepository()
Description copied from interface:RepositoryProvider
Get repository.- Specified by:
getRepository
in interfaceAbstractRefBaseObject
- Specified by:
getRepository
in interfaceRepositoryProvider
- Overrides:
getRepository
in classcom.nomagic.uml2.ext.jmi.reflect.AbstractRefBaseObjectImpl
- Returns:
- repository.
-
getProject
public ElementRegistry getProject()
-
setProject
public void setProject(ElementRegistry project)
-
refGetEnum
@CheckForNull public javax.jmi.reflect.RefEnum refGetEnum(java.lang.String enumName, java.lang.String args)
Description copied from class:AbstractRefPackage
The refGetEnum operation returns the instance of an enumeration (i.e., an enumeration literal) whose value is described by the value of literalName . Note that the type of enumeration is defined by the meta object that owns the metaLiteral object. InvalidCallException is raised if the enumType parameter does not designate a valid enumeration. InvalidNameException is raised when the enumName does not denote a valid enum name. This refGetEnum returns the enumeration object representing the enumeration literal. specific analog: none. return type: RefEnum parameters: RefObject enumType (or String enumName ) String literalName exceptions: JmiException (TypeMismatchException, InvalidCallException, InvalidNameException, java.lang.NullPointerException)- Specified by:
refGetEnum
in interfacejavax.jmi.reflect.RefPackage
- Overrides:
refGetEnum
in classAbstractRefPackage
-
getMetamodelProvider
public com.io_software.catools.tas.mof.TASRepository getMetamodelProvider()
-
getCounter
public Counter getCounter()
Standalone repositories (those, having no Project object) can have a separate counter assigned to them.
-
setCounter
public void setCounter(Counter count)
Standalone repositories (those, having no Project object) can have a separate counter assigned to them.
-
canSetID
public boolean canSetID()
-
setCanSetID
public void setCanSetID(boolean canSetID)
- Parameters:
canSetID
- The canSetID to set.
-
getValuesTable
public com.nomagic.uml2.impl.ValuesTable getValuesTable()
-
invokeAfterTransaction
public void invokeAfterTransaction(java.lang.Runnable r)
If at the current moment firing cached events, running runnable after these events are fired. Running now in other case.- Parameters:
r
-Runnable
to run.
-
isRawMode
public boolean isRawMode()
Raw mode is when binary associations is not synchronized. For example when raw mode is off setting owner element is added to the owned elements. For normal operations raw mode should be switched off.
-
setRawMode
public void setRawMode(boolean rawMode)
Raw mode is when binary associations is not synchronized. For example when raw mode is off setting owner element is added to the owned elements. For normal operations raw mode should be switched off.- Parameters:
rawMode
- new RawModeValue.
-
getTransactionModelListener
public ModelListener getTransactionModelListener()
-
getTransactionManager
public TransactionManager getTransactionManager()
-
setTransactionModelListener
public void setTransactionModelListener(ModelListener listener)
-
addCandidateForDispose
public void addCandidateForDispose(javax.jmi.reflect.RefObject object)
-
removeCandidateForDispose
public void removeCandidateForDispose(javax.jmi.reflect.RefObject object)
-
getCandidatesForDispose
public java.util.Set<javax.jmi.reflect.RefObject> getCandidatesForDispose()
-
clearCandidatesForDispose
public void clearCandidatesForDispose()
-
addCandidatesForDisposeListener
public void addCandidatesForDisposeListener(AbstractRepository.CandidatesForDisposeListener listener)
Adds aAbstractRepository.CandidatesForDisposeListener
to get notifications about- Parameters:
listener
- the listener
-
removeCandidatesForDisposeListener
public void removeCandidatesForDisposeListener(AbstractRepository.CandidatesForDisposeListener listener)
-
getCalculator
public AbstractRepository.Calculator getCalculator(AbstractRepository.Calculators calculatorName)
-
addCalculator
public AbstractRepository.Calculator addCalculator(AbstractRepository.Calculators id, AbstractRepository.Calculator calculator)
- Parameters:
id
- calculator identifier.calculator
- value calculator.- Returns:
- calculator which was registered by same id.
-
-