Top Description Inners Fields Constructors Methods
org.glassfish.grizzly.attributes

public Class IndexedMapAttributeHolder

extends Object
implements AttributeHolder
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.attributes.AttributeHolder
Annotations
@SuppressWarnings:rawtypes
Imports
java.util.Set, java.util.concurrent.ConcurrentHashMap, .ConcurrentMap, java.util.function.Supplier, java.util.stream.Collectors

An AttributeHolder implementation, which stores Attribute values in a ConcurrentMap, accessing them by Attribute#index().

This implementation is thread-safe.

Author
Bongjae Chang

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final DefaultAttributeBuilder
private final IndexedAttributeAccessor
private final ConcurrentMap<Integer, Object>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Implements org.glassfish.grizzly.attributes.AttributeHolder.clear.

Clear all the attributes.

public void
copyFrom(final AttributeHolder srcAttributes)

Implements org.glassfish.grizzly.attributes.AttributeHolder.copyFrom.

Copies attributes from the srcAttributes to this AttributeHolder

public void
copyTo(final AttributeHolder dstAttributes)

Implements org.glassfish.grizzly.attributes.AttributeHolder.copyTo.

Copies attributes from this AttributeHolder to the dstAttributes.

public Object
getAttribute(final String name)

Implements org.glassfish.grizzly.attributes.AttributeHolder.getAttribute.

Return an object based on a name.

public Object
getAttribute(final String name, final Supplier<T> initializer)

Implements org.glassfish.grizzly.attributes.AttributeHolder.getAttribute.

Return an object based on a name.

public AttributeBuilder
getAttributeBuilder()

Implements org.glassfish.grizzly.attributes.AttributeHolder.getAttributeBuilder.

Get AttributeBuilder, associated with this holder

public Set<String>
public IndexedAttributeAccessor
public void
public Object
public void
setAttribute(final String name, final Object value)

Implements org.glassfish.grizzly.attributes.AttributeHolder.setAttribute.

Set a name/value object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attributeBuilderback to summary
private final DefaultAttributeBuilder attributeBuilder
indexedAttributeAccessorback to summary
private final IndexedAttributeAccessor indexedAttributeAccessor
valueMapback to summary
private final ConcurrentMap<Integer, Object> valueMap

Constructor Detail

IndexedMapAttributeHolderback to summary
pack-priv IndexedMapAttributeHolder(final AttributeBuilder attributeBuilder)

Method Detail

clearback to summary
public void clear()

Implements org.glassfish.grizzly.attributes.AttributeHolder.clear.

Doc from org.glassfish.grizzly.attributes.AttributeHolder.clear.

Clear all the attributes.

Annotations
@Override
copyFromback to summary
public void copyFrom(final AttributeHolder srcAttributes)

Implements org.glassfish.grizzly.attributes.AttributeHolder.copyFrom.

Doc from org.glassfish.grizzly.attributes.AttributeHolder.copyFrom.

Copies attributes from the srcAttributes to this AttributeHolder

Annotations
@Override
copyToback to summary
public void copyTo(final AttributeHolder dstAttributes)

Implements org.glassfish.grizzly.attributes.AttributeHolder.copyTo.

Doc from org.glassfish.grizzly.attributes.AttributeHolder.copyTo.

Copies attributes from this AttributeHolder to the dstAttributes.

Annotations
@Override
getAttributeback to summary
public Object getAttribute(final String name)

Implements org.glassfish.grizzly.attributes.AttributeHolder.getAttribute.

Doc from org.glassfish.grizzly.attributes.AttributeHolder.getAttribute.

Return an object based on a name.

Annotations
@Override
getAttributeback to summary
public Object getAttribute(final String name, final Supplier<T> initializer)

Implements org.glassfish.grizzly.attributes.AttributeHolder.getAttribute.

Doc from org.glassfish.grizzly.attributes.AttributeHolder.getAttribute.

Return an object based on a name.

Annotations
@Override
getAttributeBuilderback to summary
public AttributeBuilder getAttributeBuilder()

Implements org.glassfish.grizzly.attributes.AttributeHolder.getAttributeBuilder.

Doc from org.glassfish.grizzly.attributes.AttributeHolder.getAttributeBuilder.

Get AttributeBuilder, associated with this holder

Annotations
@Override
getAttributeNamesback to summary
public Set<String> getAttributeNames()

Implements org.glassfish.grizzly.attributes.AttributeHolder.getAttributeNames.

Doc from org.glassfish.grizzly.attributes.AttributeHolder.getAttributeNames.

Return a Set of attribute names.

Annotations
@Override
getIndexedAttributeAccessorback to summary
public IndexedAttributeAccessor getIndexedAttributeAccessor()

Implements org.glassfish.grizzly.attributes.AttributeHolder.getIndexedAttributeAccessor.

Returns IndexedAttributeAccessor for accessing Attributes by index.

Returns:IndexedAttributeAccessor

IndexedAttributeAccessor for accessing Attributes by index.

Annotations
@Override
recycleback to summary
public void recycle()

Implements org.glassfish.grizzly.attributes.AttributeHolder.recycle.

Doc from org.glassfish.grizzly.attributes.AttributeHolder.recycle.

Recycle AttributeHolder

Annotations
@Override
removeAttributeback to summary
public Object removeAttribute(final String name)

Implements org.glassfish.grizzly.attributes.AttributeHolder.removeAttribute.

Doc from org.glassfish.grizzly.attributes.AttributeHolder.removeAttribute.

Remove a name/value object.

Annotations
@Override
setAttributeback to summary
public void setAttribute(final String name, final Object value)

Implements org.glassfish.grizzly.attributes.AttributeHolder.setAttribute.

Doc from org.glassfish.grizzly.attributes.AttributeHolder.setAttribute.

Set a name/value object.

Annotations
@Override
org.glassfish.grizzly.attributes back to summary

private final Class IndexedMapAttributeHolder.IndexedAttributeAccessorImpl

extends Object
implements IndexedAttributeAccessor
Class Inheritance
  • java.lang.Object
  • org.glassfish.grizzly.attributes.IndexedMapAttributeHolder.IndexedAttributeAccessorImpl
All Implemented Interfaces
org.glassfish.grizzly.attributes.IndexedAttributeAccessor

IndexedAttributeAccessor implementation.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Object
getAttribute(final int index)

Implements org.glassfish.grizzly.attributes.IndexedAttributeAccessor.getAttribute.

Internal method for dynamic attribute support.

public Object
getAttribute(final int index, final Supplier<T> initializer)

Implements org.glassfish.grizzly.attributes.IndexedAttributeAccessor.getAttribute.

Internal method for dynamic attribute support.

public Object
removeAttribute(final int index)

Implements org.glassfish.grizzly.attributes.IndexedAttributeAccessor.removeAttribute.

Internal method for dynamic attribute support.

public void
setAttribute(final int index, final Object value)

Implements org.glassfish.grizzly.attributes.IndexedAttributeAccessor.setAttribute.

Internal method for dynamic attribute support.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

IndexedAttributeAccessorImplback to summary
private IndexedAttributeAccessorImpl()

Method Detail

getAttributeback to summary
public Object getAttribute(final int index)

Implements org.glassfish.grizzly.attributes.IndexedAttributeAccessor.getAttribute.

Doc from org.glassfish.grizzly.attributes.IndexedAttributeAccessor.getAttribute.

Internal method for dynamic attribute support. Return the value of the attribute by index.

Annotations
@Override
getAttributeback to summary
public Object getAttribute(final int index, final Supplier<T> initializer)

Implements org.glassfish.grizzly.attributes.IndexedAttributeAccessor.getAttribute.

Doc from org.glassfish.grizzly.attributes.IndexedAttributeAccessor.getAttribute.

Internal method for dynamic attribute support. Return the value of the attribute by index. If the attribute with such index is not set, set it to the default value, using the initializer, and return the default.

Annotations
@Override
removeAttributeback to summary
public Object removeAttribute(final int index)

Implements org.glassfish.grizzly.attributes.IndexedAttributeAccessor.removeAttribute.

Doc from org.glassfish.grizzly.attributes.IndexedAttributeAccessor.removeAttribute.

Internal method for dynamic attribute support. Removes the attribute with the index and returns its previous value.

Annotations
@Override
setAttributeback to summary
public void setAttribute(final int index, final Object value)

Implements org.glassfish.grizzly.attributes.IndexedAttributeAccessor.setAttribute.

Doc from org.glassfish.grizzly.attributes.IndexedAttributeAccessor.setAttribute.

Internal method for dynamic attribute support. Set the attribute with the index to value.

Annotations
@Override