|
ModeShape Distribution 3.2.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.infinispan.batch.AutoBatchSupport
org.infinispan.schematic.internal.SchematicEntryProxy
public class SchematicEntryProxy
A layer of indirection around an SchematicEntryLiteral to provide consistency and isolation for concurrent readers
while writes may also be going on. The techniques used in this implementation are very similar to the lock-free reader MVCC
model used in the MVCCEntry implementations for the core data container, which closely
follow software transactional memory approaches to dealing with concurrency.
Implementations of this class are rarely created on their own;
SchematicEntryLiteral.getProxy(CacheContext, String, FlagContainer) should be used to retrieve an instance of this
proxy.
Typically proxies are only created by the SchematicEntryLookup helper, and would not be created by end-user code
directly.
AtomicHashMapProxy| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.infinispan.schematic.SchematicEntry |
|---|
SchematicEntry.FieldName |
| Field Summary |
|---|
| Fields inherited from class org.infinispan.batch.AutoBatchSupport |
|---|
batchContainer |
| Method Summary | |
|---|---|
Document |
asDocument()
Get the representation of this entry as a document, which will include the metadata and content
as nested documents. |
EditableDocument |
editDocumentContent()
Get an editable document, when the content is a document. |
EditableDocument |
editMetadata()
Get an editable metadata document. |
protected EditableDocument |
editorFor(Document doc,
Path pathToDocument,
DocumentObserver observer)
|
Object |
getContent()
Return this value's content. |
Binary |
getContentAsBinary()
Get this value's content, if it is a Binary object. |
Document |
getContentAsDocument()
Get this value's content, if it is a Document object. |
String |
getContentType()
Get the media type describing the content. |
Document |
getMetadata()
Get the metadata associated with this value. |
boolean |
hasBinaryContent()
Return true if the SchematicEntry.getContent() method would return a Binary (or SchematicEntry.getContentAsBinary() would
return a non-null value). |
boolean |
hasDocumentContent()
Return true if the SchematicEntry.getContent() method would return a Document (or SchematicEntry.getContentAsDocument()
would return a non-null value). |
protected org.infinispan.container.entries.CacheEntry |
lookupEntryFromCurrentTransaction()
Looks up the CacheEntry stored in transactional context corresponding to this SchematicEntryLiteral. |
void |
setContent(Binary content,
Document metadata,
String defaultContentType)
Set the content for this value to be the supplied Binary data described by the supplied content type. |
void |
setContent(Document content,
Document metadata,
String defaultContentType)
Set the content for this value to be the supplied Document and set the content type to be " application/json". |
String |
toString()
|
protected SchematicEntryLiteral |
toValue(Object object)
Utility method that casts the supplied cache entry value to a literal value for reading
purposes. |
| Methods inherited from class org.infinispan.batch.AutoBatchSupport |
|---|
assertBatchingSupported, endAtomic, failAtomic, startAtomic |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
protected SchematicEntryLiteral toValue(Object object)
literal value for reading
purposes.
object - the cache entry value, which may be a MarshalledValue
object is nullprotected org.infinispan.container.entries.CacheEntry lookupEntryFromCurrentTransaction()
public Document getMetadata()
SchematicEntry
getMetadata in interface SchematicEntrypublic String getContentType()
SchematicEntry
getContentType in interface SchematicEntrypublic Object getContent()
SchematicEntryDocument or Binary.
Note that this method will return a non-null value only if the SchematicEntry.hasDocumentContent() method
returns true.
getContent in interface SchematicEntryDocument object, or null if there is no contentpublic Document getContentAsDocument()
SchematicEntrySchematicEntry.hasDocumentContent() returns true, and is therefore equivalent to the following:
return hasDocumentContent() ? (Document)getContent() : null;
getContentAsDocument in interface SchematicEntryDocument content, or null if there is no content or the content is a Binary valuepublic Binary getContentAsBinary()
SchematicEntrySchematicEntry.hasDocumentContent() returns false, and is therefore equivalent to the following:
return hasDocumentContent() ? (Binary)getContent() : null;
getContentAsBinary in interface SchematicEntryBinary content, or null if there is no content or if the content is a Documentpublic boolean hasDocumentContent()
SchematicEntrytrue if the SchematicEntry.getContent() method would return a Document (or SchematicEntry.getContentAsDocument()
would return a non-null value).
This is equivalent to the following:
return getContent() instanceof Document;
hasDocumentContent in interface SchematicEntrytrue if the content is a Document, or false otherwisepublic boolean hasBinaryContent()
SchematicEntrytrue if the SchematicEntry.getContent() method would return a Binary (or SchematicEntry.getContentAsBinary() would
return a non-null value).
This is equivalent to the following:
return getContent() instanceof Binary;
hasBinaryContent in interface SchematicEntrytrue if the content is a Binary value, or false otherwisepublic Document asDocument()
SchematicEntrymetadata and content
as nested documents.
asDocument in interface SchematicEntrypublic String toString()
toString in class Object
public void setContent(Binary content,
Document metadata,
String defaultContentType)
SchematicEntryBinary data described by the supplied content type.
setContent in interface SchematicEntrycontent - the Binary representation of the content; may not be nullmetadata - the Document representing the metadata; may be nulldefaultContentType - the value for the MIME type describing the content that should be used if the metadata does not
already contain a "contentType" field, and typically Schematic.ContentTypes.JSON, Schematic.ContentTypes.JSON_SCHEMA ,
or Schematic.ContentTypes.BSON; may not be null
public void setContent(Document content,
Document metadata,
String defaultContentType)
SchematicEntryapplication/json".
setContent in interface SchematicEntrycontent - the Document representing the JSON content; may not be nullmetadata - the Document representing the metadata; may be nulldefaultContentType - the value for the MIME type describing the content that should be used if the metadata does not
already contain a "contentType" field, and typically Schematic.ContentTypes.JSON, Schematic.ContentTypes.JSON_SCHEMA ,
or Schematic.ContentTypes.BSON; may not be nullpublic EditableDocument editDocumentContent()
SchematicEntryeditable document, when the content is a document. The client
is expected to make these edits within the context of a transaction, and the edits will be saved when the transaction is
committed.
editDocumentContent in interface SchematicEntrySchematicEntry.editMetadata()public EditableDocument editMetadata()
SchematicEntryeditable metadata document. The client is expected to make these edits within the context
of a transaction, and the edits will be saved when the transaction is committed.
editMetadata in interface SchematicEntrySchematicEntry.editDocumentContent()
protected EditableDocument editorFor(Document doc,
Path pathToDocument,
DocumentObserver observer)
|
ModeShape Distribution 3.2.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||