|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mina.core.filterchain.IoFilterAdapter
org.apache.mina.filter.util.SessionAttributeInitializingFilter
public class SessionAttributeInitializingFilter
An IoFilter
that sets initial attributes when a new
IoSession
is created. By default, the attribute map is empty when
an IoSession
is newly created. Inserting this filter will make
the pre-configured attributes available after this filter executes the
sessionCreated event.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.mina.core.filterchain.IoFilter |
---|
IoFilter.NextFilter |
Constructor Summary | |
---|---|
SessionAttributeInitializingFilter()
Creates a new instance with no default attributes. |
|
SessionAttributeInitializingFilter(java.util.Map<java.lang.String,? extends java.lang.Object> attributes)
Creates a new instance with the specified default attributes. |
Method Summary | |
---|---|
java.lang.Object |
getAttribute(java.lang.String key)
Returns the value of user-defined attribute. |
java.util.Set<java.lang.String> |
getAttributeKeys()
Returns the set of keys of all user-defined attributes. |
java.lang.Object |
removeAttribute(java.lang.String key)
Removes a user-defined attribute with the specified key. |
void |
sessionCreated(IoFilter.NextFilter nextFilter,
IoSession session)
Puts all pre-configured attributes into the actual session attribute map and forward the event to the next filter. |
java.lang.Object |
setAttribute(java.lang.String key)
Sets a user defined attribute without a value. |
java.lang.Object |
setAttribute(java.lang.String key,
java.lang.Object value)
Sets a user-defined attribute. |
void |
setAttributes(java.util.Map<java.lang.String,? extends java.lang.Object> attributes)
Sets the attribute map. |
Methods inherited from class org.apache.mina.core.filterchain.IoFilterAdapter |
---|
destroy, exceptionCaught, filterClose, filterWrite, init, messageReceived, messageSent, onPostAdd, onPostRemove, onPreAdd, onPreRemove, sessionClosed, sessionIdle, sessionOpened, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SessionAttributeInitializingFilter()
setAttribute(String, Object)
and setAttributes(Map)
.
public SessionAttributeInitializingFilter(java.util.Map<java.lang.String,? extends java.lang.Object> attributes)
setAttribute(String, Object)
and setAttributes(Map)
.
Method Detail |
---|
public java.lang.Object getAttribute(java.lang.String key)
key
- the key of the attribute
public java.lang.Object setAttribute(java.lang.String key, java.lang.Object value)
key
- the key of the attributevalue
- the value of the attribute
public java.lang.Object setAttribute(java.lang.String key)
Boolean.TRUE
.
key
- the key of the attribute
public java.lang.Object removeAttribute(java.lang.String key)
public java.util.Set<java.lang.String> getAttributeKeys()
public void setAttributes(java.util.Map<java.lang.String,? extends java.lang.Object> attributes)
public void sessionCreated(IoFilter.NextFilter nextFilter, IoSession session) throws java.lang.Exception
sessionCreated
in interface IoFilter
sessionCreated
in class IoFilterAdapter
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |