public static class DefaultSession.SessionBuilder extends Object
validateAndSetValues()
method on this builder is actually called
by the DefaultSession
constructor for ease of use. May not be good
design though.Modifier and Type | Field and Description |
---|---|
private long |
creationTime |
private EventDispatcher |
eventDispatcher |
private Object |
id |
private boolean |
isShuttingDown |
private boolean |
isUDPEnabled |
private boolean |
isWriteable |
private long |
lastReadWriteTime |
private Map<String,Object> |
sessionAttributes |
Constructor and Description |
---|
DefaultSession.SessionBuilder() |
Modifier and Type | Method and Description |
---|---|
Session |
build() |
DefaultSession.SessionBuilder |
creationTime(long creationTime) |
DefaultSession.SessionBuilder |
eventDispatcher(EventDispatcher eventDispatcher) |
Object |
getId() |
DefaultSession.SessionBuilder |
id(Object id) |
DefaultSession.SessionBuilder |
isShuttingDown(boolean isShuttingDown) |
DefaultSession.SessionBuilder |
isUDPEnabled(boolean isUDPEnabled) |
DefaultSession.SessionBuilder |
isWriteable(boolean isWriteable) |
DefaultSession.SessionBuilder |
lastReadWriteTime(long lastReadWriteTime) |
DefaultSession.SessionBuilder |
sessionAttributes(Map<String,Object> sessionAttributes) |
protected void |
validateAndSetValues()
This method is used to validate and set the variables to default
values if they are not already set before calling build.
|
private Object id
private EventDispatcher eventDispatcher
private long creationTime
private long lastReadWriteTime
private boolean isWriteable
private volatile boolean isShuttingDown
private boolean isUDPEnabled
public Session build()
protected void validateAndSetValues()
public Object getId()
public DefaultSession.SessionBuilder id(Object id)
public DefaultSession.SessionBuilder eventDispatcher(EventDispatcher eventDispatcher)
public DefaultSession.SessionBuilder sessionAttributes(Map<String,Object> sessionAttributes)
public DefaultSession.SessionBuilder creationTime(long creationTime)
public DefaultSession.SessionBuilder lastReadWriteTime(long lastReadWriteTime)
public DefaultSession.SessionBuilder isWriteable(boolean isWriteable)
public DefaultSession.SessionBuilder isShuttingDown(boolean isShuttingDown)
public DefaultSession.SessionBuilder isUDPEnabled(boolean isUDPEnabled)
Copyright © 2012. All Rights Reserved.