Top Inners Fields Constructors Methods
org.glassfish.grizzly

public abstract Class AbstractTransformer<K, L>

extends Object
implements Transformer<K, L>
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.Transformer
Known Direct Subclasses
org.glassfish.grizzly.compression.lzma.LZMADecoder, org.glassfish.grizzly.compression.lzma.LZMAEncoder, org.glassfish.grizzly.compression.zip.GZipDecoder, org.glassfish.grizzly.compression.zip.GZipEncoder, org.glassfish.grizzly.ssl.SSLDecoderTransformer, org.glassfish.grizzly.ssl.SSLEncoderTransformer, org.glassfish.grizzly.utils.ChunkingFilter.ChunkingTransformer, org.glassfish.grizzly.utils.StringDecoder, org.glassfish.grizzly.utils.StringEncoder
Imports
org.glassfish.grizzly.attributes.Attribute, .AttributeBuilder, .AttributeStorage, org.glassfish.grizzly.memory.MemoryManager

Author
Alexey Stashok

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
protected final AttributeBuilder
private MemoryManager<E extends Buffer>
protected final Attribute<AbstractTransformer.LastResultAwareState<K, L>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected AbstractTransformer.LastResultAwareState<K, L>
public final TransformationResult<K, L>
getLastResult(final AttributeStorage storage)

Implements org.glassfish.grizzly.Transformer.getLastResult.

Gets the last returned Transformer result.

public MemoryManager<E extends Buffer>
protected String
public static <T> T
getValue(final AttributeStorage storage, final Attribute<T> attribute, final T defaultValue)

protected MemoryManager<E extends Buffer>
protected final AbstractTransformer.LastResultAwareState<K, L>
public void
release(AttributeStorage storage)

Implements org.glassfish.grizzly.Transformer.release.

The Transformer has done its work and can release all associated resource.

protected final TransformationResult<K, L>
saveLastResult(final AttributeStorage storage, final TransformationResult<K, L> result)

public void
setMemoryManager(MemoryManager<E extends Buffer> memoryManager)

public final TransformationResult<K, L>
transform(AttributeStorage storage, K input)

Implements org.glassfish.grizzly.Transformer.transform.

Transforms an input data to some custom representation.

protected abstract TransformationResult<K, L>
transformImpl(AttributeStorage storage, K input)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attributeBuilderback to summary
protected final AttributeBuilder attributeBuilder
memoryManagerback to summary
private MemoryManager<E extends Buffer> memoryManager
stateAttrback to summary
protected final Attribute<AbstractTransformer.LastResultAwareState<K, L>> stateAttr

Constructor Detail

AbstractTransformerback to summary
public AbstractTransformer()

Method Detail

createStateObjectback to summary
protected AbstractTransformer.LastResultAwareState<K, L> createStateObject()
getLastResultback to summary
public final TransformationResult<K, L> getLastResult(final AttributeStorage storage)

Implements org.glassfish.grizzly.Transformer.getLastResult.

Doc from org.glassfish.grizzly.Transformer.getLastResult.

Gets the last returned Transformer result. Last result could be either retrieved from internal state, or external storage, which is passed as the parameter.

Annotations
@Override
getMemoryManagerback to summary
public MemoryManager<E extends Buffer> getMemoryManager()
getNamePrefixback to summary
protected String getNamePrefix()
getValueback to summary
public static <T> T getValue(final AttributeStorage storage, final Attribute<T> attribute, final T defaultValue)
obtainMemoryManagerback to summary
protected MemoryManager<E extends Buffer> obtainMemoryManager(AttributeStorage storage)
obtainStateObjectback to summary
protected final AbstractTransformer.LastResultAwareState<K, L> obtainStateObject(final AttributeStorage storage)
releaseback to summary
public void release(AttributeStorage storage)

Implements org.glassfish.grizzly.Transformer.release.

Doc from org.glassfish.grizzly.Transformer.release.

The Transformer has done its work and can release all associated resource.

Annotations
@Override
saveLastResultback to summary
protected final TransformationResult<K, L> saveLastResult(final AttributeStorage storage, final TransformationResult<K, L> result)
setMemoryManagerback to summary
public void setMemoryManager(MemoryManager<E extends Buffer> memoryManager)
transformback to summary
public final TransformationResult<K, L> transform(AttributeStorage storage, K input) throws TransformationException

Implements org.glassfish.grizzly.Transformer.transform.

Doc from org.glassfish.grizzly.Transformer.transform.

Transforms an input data to some custom representation. Input and output are not passed implicitly, which means that Transformer is able to retrieve input and output from its internal state or from external storage (AttributeStorage).

Annotations
@Override
Exceptions
TransformationException:
if failed to transport i.e. invalid types
transformImplback to summary
protected abstract TransformationResult<K, L> transformImpl(AttributeStorage storage, K input) throws TransformationException
org.glassfish.grizzly back to summary

public Class AbstractTransformer.LastResultAwareState<K, L>

extends Object
Class Inheritance
  • java.lang.Object
  • org.glassfish.grizzly.AbstractTransformer.LastResultAwareState
Known Direct Subclasses
org.glassfish.grizzly.compression.lzma.LZMADecoder.LZMAInputState, org.glassfish.grizzly.compression.lzma.LZMAEncoder.LZMAOutputState, org.glassfish.grizzly.compression.zip.GZipDecoder.GZipInputState, org.glassfish.grizzly.compression.zip.GZipEncoder.GZipOutputState

Field Summary

Modifier and TypeField and Description
protected TransformationResult<K, L>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public TransformationResult<K, L>
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lastResultback to summary
protected TransformationResult<K, L> lastResult

Constructor Detail

LastResultAwareStateback to summary
public LastResultAwareState()

Method Detail

getLastResultback to summary
public TransformationResult<K, L> getLastResult()
setLastResultback to summary
public void setLastResult(TransformationResult<K, L> lastResult)