|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.grizzly.filter.ReadFilter
com.sun.grizzly.portunif.PUReadFilter
public class PUReadFilter
Port unification ReadFilter.
Could be used for usecases, where on one TCP/UDP/... port several higher level
protocols should be served (for example HTTP, HTTPS, IIOP).
If input ByteBuffer
is empty - ReadFilter
logic will
be executed in order to read request data.
Field Summary | |
---|---|
static long |
DEFAULT_READ_TIMEOUT
|
static String |
PROTOCOL_FINDERS
|
static String |
PROTOCOL_HANDLERS
|
static String |
PU_PRE_PROCESSORS
|
Fields inherited from class com.sun.grizzly.filter.ReadFilter |
---|
continousExecution, UDP_SOCKETADDRESS |
Fields inherited from interface com.sun.grizzly.ProtocolFilter |
---|
SUCCESSFUL_READ |
Constructor Summary | |
---|---|
PUReadFilter()
|
Method Summary | |
---|---|
void |
addPreProcessor(PUPreProcessor preProcessor)
Add PUPreProcessor to preprocess income request |
void |
addProtocolFinder(ProtocolFinder protocolFinder)
Add an instance of ProtocolFinder |
void |
addProtocolHandler(ProtocolHandler protocolHandler)
Add an instance of ProtocolHandler |
void |
configure(List<ProtocolFinder> protocolFinders,
List<ProtocolHandler> protocolHandlers,
List<PUPreProcessor> preProcessors)
Configures port unification depending on passed List s |
void |
configure(Properties props)
Configures port unification depending on passed Properties |
boolean |
execute(Context context)
Read available bytes and delegate the processing of them to the next ProtocolFilter in the ProtocolChain. |
protected ProtocolHandler |
getProtocolChainHandler(Context context,
PUProtocolRequest protocolRequest)
Returns filter chain ProtocolHandler , depending on current
Context and PUProtocolRequest state |
long |
getReadTimeout()
Get readTimeout. |
boolean |
processProtocolHandler(ProtocolHandler protocolHandler,
Context context,
PUProtocolRequest protocolRequest,
boolean mapSelectionKey)
|
void |
removePreProcessor(PUPreProcessor preProcessor)
Remove PUPreProcessor from preprocess queue |
void |
removeProtocolFinder(ProtocolFinder protocolFinder)
Remove a ProtocolFinder |
void |
removeProtocolHandler(ProtocolHandler protocolHandler)
Remove a ProtocolHandler |
void |
setReadTimeout(long readTimeout)
Set readTimeout. |
Methods inherited from class com.sun.grizzly.filter.ReadFilter |
---|
execute, isContinuousExecution, log, postExecute, setContinuousExecution |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_READ_TIMEOUT
public static final String PROTOCOL_FINDERS
public static final String PROTOCOL_HANDLERS
public static final String PU_PRE_PROCESSORS
Constructor Detail |
---|
public PUReadFilter()
Method Detail |
---|
public boolean execute(Context context) throws IOException
ReadFilter
execute
in interface ProtocolFilter
execute
in class ReadFilter
context
- Context
IOException
protected ProtocolHandler getProtocolChainHandler(Context context, PUProtocolRequest protocolRequest)
ProtocolHandler
, depending on current
Context
and PUProtocolRequest
state
context
- protocolRequest
-
ProtocolHandler
public boolean processProtocolHandler(ProtocolHandler protocolHandler, Context context, PUProtocolRequest protocolRequest, boolean mapSelectionKey) throws IOException
IOException
public void configure(Properties props)
Properties
props
- Properties
public void configure(List<ProtocolFinder> protocolFinders, List<ProtocolHandler> protocolHandlers, List<PUPreProcessor> preProcessors)
List
s
protocolFinders
- ProtocolFinder
sprotocolHandlers
- ProtocolHandler
spreProcessors
- PUPreProcessor
spublic void addProtocolFinder(ProtocolFinder protocolFinder)
ProtocolFinder
public void removeProtocolFinder(ProtocolFinder protocolFinder)
ProtocolFinder
public void addProtocolHandler(ProtocolHandler protocolHandler)
ProtocolHandler
public void removeProtocolHandler(ProtocolHandler protocolHandler)
ProtocolHandler
public void addPreProcessor(PUPreProcessor preProcessor)
PUPreProcessor
to preprocess income request
public void removePreProcessor(PUPreProcessor preProcessor)
PUPreProcessor
from preprocess queue
public void setReadTimeout(long readTimeout)
PUReadFilter
will expect more data on channel.
If no ProtocolFinder
found - Filter tries to read more data
and rerun finders.
readTimeout
- new timeout valuepublic long getReadTimeout()
PUReadFilter
will expect more data on channel.
If no ProtocolFinder
found - Filter tries to read more data
and rerun finders.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |