|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.grizzly.AbstractTransformer<K,L>
public abstract class AbstractTransformer<K,L>
| Field Summary | |
|---|---|
protected AttributeBuilder |
attributeBuilder
|
protected static TransformationResult |
incompletedResult
|
protected Attribute<K> |
inputBufferAttribute
|
protected Attribute<TransformationResult<L>> |
lastResultAttribute
|
protected Attribute<L> |
outputBufferAttribute
|
| Constructor Summary | |
|---|---|
AbstractTransformer()
|
|
| Method Summary | ||
|---|---|---|
K |
getInput(AttributeStorage storage)
Gets the input data, which Transformer will work with. |
|
TransformationResult<L> |
getLastResult(AttributeStorage storage)
Gets the last returned Transformer result. |
|
MemoryManager |
getMemoryManager()
|
|
L |
getOutput(AttributeStorage storage)
Gets the output, which Transformer will use for transformed data. |
|
AttributeHolder |
getProperties(AttributeStorage storage)
Gets the property storage, using which it's possible to read or update Transformer properties. |
|
static
|
getValue(AttributeStorage storage,
Attribute<T> attribute,
T defaultValue)
|
|
void |
hibernate(AttributeStorage storage)
Method could be called by framework to let Transformer know, that transformation will be postponed and probably continued in separate Thread, so all resources, which are associated with the current Thread should be detached and stored internally or in the external storage. |
|
protected MemoryManager |
obtainMemoryManager(AttributeStorage storage)
|
|
void |
release(AttributeStorage storage)
The Transformer has done its work and can release all associated resource. |
|
void |
setInput(AttributeStorage storage,
K input)
Sets the input data, which Transformer will work with. |
|
void |
setMemoryManager(MemoryManager memoryManager)
|
|
void |
setOutput(AttributeStorage storage,
L output)
Gets the output, which Transformer will use for transformed data. |
|
TransformationResult<L> |
transform(AttributeStorage storage)
Transforms an input data to some custom representation. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sun.grizzly.Transformer |
|---|
transform |
| Field Detail |
|---|
protected static TransformationResult incompletedResult
protected AttributeBuilder attributeBuilder
protected Attribute<K> inputBufferAttribute
protected Attribute<L> outputBufferAttribute
protected Attribute<TransformationResult<L>> lastResultAttribute
| Constructor Detail |
|---|
public AbstractTransformer()
| Method Detail |
|---|
public TransformationResult<L> transform(AttributeStorage storage)
throws TransformationException
TransformerAttributeStorage).
transform in interface Transformer<K,L>storage - the external state storage, where Transformer could
get/put a state.
TransformationResult
TransformationExceptionpublic K getInput(AttributeStorage storage)
TransformerBuffer, where "reader" will read the data to. But note,
the returned Buffer should always represent READY data.In other words,
if there is no data to be transformed - the Buffer should have 0
remaining bytes.
getInput in interface Transformer<K,L>storage - the external state storage, where Transformer
could retrieve or store its state.
public void setInput(AttributeStorage storage,
K input)
TransformerBuffer will be used by "reader" to read the data to. But note,
the input Buffer should always represent READY data.In other words,
if there is no data to be transformed - the Buffer should have 0
remaining bytes.
setInput in interface Transformer<K,L>storage - the external state storage, where Transformer
could retrieve or store its state.input - Input datapublic L getOutput(AttributeStorage storage)
TransformerTransformationResult.
getOutput in interface Transformer<K,L>storage - the external state storage, where Transformer
could retrieve or store its state.
public void setOutput(AttributeStorage storage,
L output)
TransformerTransformationResult.
setOutput in interface Transformer<K,L>storage - the external state storage, where Transformer
could retrieve or store its state.output - Outputpublic TransformationResult<L> getLastResult(AttributeStorage storage)
Transformer
getLastResult in interface Transformer<K,L>storage - the external state storage, where Transformer
could retrieve or store its state.
public AttributeHolder getProperties(AttributeStorage storage)
Transformer
getProperties in interface Transformer<K,L>storage - the external state storage, where Transformer
could retrieve or store its state.
public void hibernate(AttributeStorage storage)
Transformer
hibernate in interface Transformer<K,L>storage - the external state storage, where Transformer
could retrieve or store its state.public void release(AttributeStorage storage)
Transformer
release in interface Transformer<K,L>storage - the external state storage, where Transformer
could retrieve or store its state.protected MemoryManager obtainMemoryManager(AttributeStorage storage)
public MemoryManager getMemoryManager()
public void setMemoryManager(MemoryManager memoryManager)
public static <T> T getValue(AttributeStorage storage,
Attribute<T> attribute,
T defaultValue)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||