public class RecoverableContainer<T> extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
_objectModel |
protected WeakHashMap<T,T> |
_transactionalProxies |
protected int |
_type |
Modifier | Constructor and Description |
---|---|
|
RecoverableContainer()
Create a container without a name.
|
protected |
RecoverableContainer(int objectModel) |
|
RecoverableContainer(String name)
Create a named container.
|
protected |
RecoverableContainer(String name,
int objectModel) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkObjectType(Object member) |
protected T |
createHandle(T member,
int ot)
Return a handle through which the object should be used, rather than the one
passed in.
|
T |
enlist(T member)
Given an object we create a new transactional instance of it and return that
for future use.
|
T |
enlist(T member,
Uid id)
Given an identified for an existing object, create another handle.
|
T |
getHandle(Uid reference)
Given a Uid, return the proxy for that instance.
|
Uid |
getUidForHandle(T proxy)
Given a real object, return the Uid if it exists in this container.
|
Uid |
getUidForOriginal(T member)
Given a real object, return the Uid if it exists in this container.
|
boolean |
isPessimistic(Object member) |
String |
name()
Get the name of the container.
|
int |
objectModel() |
int |
objectType() |
String |
toString()
Gives the name of the container.
|
protected WeakHashMap<T,T> _transactionalProxies
protected int _type
protected int _objectModel
public RecoverableContainer()
public RecoverableContainer(String name)
name
- the name (should be unique, but this is not enforced).protected RecoverableContainer(int objectModel)
protected RecoverableContainer(String name, int objectModel)
public final String name()
public T enlist(T member)
member
- the instance of type T that you want to be made transactional and persistent.public T enlist(T member, Uid id)
member
- the instance of type T that you want to be made transactional and persistent.id
- the Uid of the object.protected T createHandle(T member, int ot)
public T getHandle(Uid reference)
reference
- the unique identifier for the handle.public Uid getUidForOriginal(T member)
member
- the real object.throws
- IllegalArgumentException if the real object is not within the container.public Uid getUidForHandle(T proxy)
member
- the real object.throws
- IllegalArgumentException if the instance is not within the container.public String toString()
public final int objectType()
public final int objectModel()
public final boolean isPessimistic(Object member)
protected final void checkObjectType(Object member)
Copyright © 2021 JBoss by Red Hat. All rights reserved.