|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xvsm.internal.ContainerEngine
public class ContainerEngine
Constructor Summary | |
---|---|
ContainerEngine()
Creates a new unbounded Container. |
|
ContainerEngine(int size)
Creates a new unbounded Container. |
Method Summary | |
---|---|
void |
addCoordinator(java.lang.Class<? extends Selector> s,
ICoordinator c)
Adds a coordinator to the engine. |
void |
commit(Transaction txn)
Commits an existing Transaction for this container. |
protected void |
commitEntryLocks(Transaction tx)
Updates the lock on all entries which have been modified in this container with tx. |
void |
commitSubTransaction(Transaction txn)
Commits an existing Transaction for this container. |
int |
currentSize()
Returns the current size of the container. |
java.util.List<ICoordinator> |
getCoordinators()
Get a List of all Coordinators supported by this Container. |
ICoordinator |
getCoordTypefromSelector(java.lang.Class<? extends Selector> s)
Returns the coordination Type for a given Selector class. |
ContainerRef |
getCref()
Get the ContainerRef of the container. |
int |
getSize()
Get the size. |
java.util.List<Entry> |
read(Transaction tx,
java.util.List<Selector> selectors)
Read Entry s that match with the Selector. |
void |
rollback(Transaction txn)
Does a rollback on this Transaction . |
protected void |
rollbackEntryLocks(Transaction tx)
Updates the lock on all entries which have been modified in this container with tx. |
void |
setCref(ContainerRef cref)
Set the ContainerRef of the container. |
java.util.List<Entry> |
shift(Entry entry,
Transaction tx)
Writes the Entries into the persistent mechanism. |
java.util.List<Entry> |
take(Transaction tx,
java.util.List<Selector> selectors)
Take Entry s that match with the Selector. |
void |
write(Entry entry,
Transaction tx)
Writes the Entry into the persistent mechanism. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContainerEngine()
public ContainerEngine(int size)
size
- the size of the container.Method Detail |
---|
public void commit(Transaction txn) throws TransactionLockException
Transaction
for this container..
commit
in interface IContainerEngine
txn
- The Transaction
that should be committed.
TransactionLockException
- might be thrown if an entry or container is locked by another
transaction.public void commitSubTransaction(Transaction txn) throws TransactionLockException
Transaction
for this container..
commitSubTransaction
in interface IContainerEngine
txn
- The Transaction
that should be committed.
TransactionLockException
- might be thrown if an entry or container is locked by another
transaction.public void rollback(Transaction txn) throws TransactionLockException
Transaction
..
rollback
in interface IContainerEngine
txn
- The Transaction
that should be rollbacked.
TransactionLockException
- might be thrown if an entry or container is locked by another
transaction.public int getSize()
getSize
in interface IContainerEngine
public java.util.List<Entry> read(Transaction tx, java.util.List<Selector> selectors) throws TransactionLockException, NoSuchCoordinationTypeException, CountNotMetException
Entry
s that match with the Selector..
read
in interface IContainerEngine
tx
- A Transaction under which the operation executesselectors
- A List of Selector
s that must match.
TransactionLockException
- might be thrown if an entry or container is locked by another
transaction.
NoSuchCoordinationTypeException
- thrown when there is a selector which needs a coordination
type which has not been activated on the container.
CountNotMetException
- thrown if there are not enough entries to fulfill the count
of the selector.public void write(Entry entry, Transaction tx) throws ContainerFullException, TransactionLockException, NoSuchCoordinationTypeException
ContainerFullException
can be raised..
write
in interface IContainerEngine
entry
- the entry to write.tx
- A Transaction under which the operation executes
ContainerFullException
- thrown when the entry can not be written because there is no
free place for it (e.g. full bounded container, vector
position already used, key already present).
TransactionLockException
- might be thrown if an entry or container is locked by another
transaction.
NoSuchCoordinationTypeException
- thrown when there is a selector which needs a coordination
type which has not been activated on the containerpublic ICoordinator getCoordTypefromSelector(java.lang.Class<? extends Selector> s) throws NoSuchCoordinationTypeException
getCoordTypefromSelector
in interface IContainerEngine
s
- the class of the selector.
ICoordinator
matching the given selector or
null
if there is no matching ICoordinator
.
NoSuchCoordinationTypeException
- if the no coordination type for the given selector can be
found.public java.util.List<Entry> shift(Entry entry, Transaction tx) throws TransactionLockException, NoSuchCoordinationTypeException
shift
in interface IContainerEngine
entry
- the entry to shift.tx
- A Transaction under which the operation executes
TransactionLockException
- might be thrown if an entry or container is locked by another
transaction.
NoSuchCoordinationTypeException
- thrown when there is a selector which needs a coordination
type which has not been activated on the container.public java.util.List<Entry> take(Transaction tx, java.util.List<Selector> selectors) throws TransactionLockException, NoSuchCoordinationTypeException, CountNotMetException
Entry
s that match with the Selector..
take
in interface IContainerEngine
tx
- A Transaction under which the operation executesselectors
- A List of Selector
s that must match.
TransactionLockException
- might be thrown if an entry or container is locked by another
transaction.
NoSuchCoordinationTypeException
- thrown when there is a selector which needs a coordination
type which has not been activated on the container.
CountNotMetException
- thrown if there are not enough entries to fulfill the count
of the selector.public ContainerRef getCref()
ContainerRef
of the container.
getCref
in interface IContainerEngine
ContainerRef
public void setCref(ContainerRef cref)
ContainerRef
of the container.
setCref
in interface IContainerEngine
cref
- the new ContainerRef
public void addCoordinator(java.lang.Class<? extends Selector> s, ICoordinator c)
addCoordinator
in interface IContainerEngine
s
- the class of the selector to register the coordinator with.c
- the new coordinator.public java.util.List<ICoordinator> getCoordinators()
getCoordinators
in interface IContainerEngine
protected void commitEntryLocks(Transaction tx) throws TransactionLockException
null
if tx has no father.
tx
- the transaction to commit.
TransactionLockException
- thrown if the lock can not be acquired.protected void rollbackEntryLocks(Transaction tx) throws TransactionLockException
null
.
tx
- the transaction to rollback.
TransactionLockException
- thrown if the lock can not be aquired.public int currentSize()
currentSize
in interface IContainerEngine
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |