org.glassfish.grizzly.portunif
Class PUFilter

java.lang.Object
  extended by org.glassfish.grizzly.filterchain.BaseFilter
      extended by org.glassfish.grizzly.portunif.PUFilter
All Implemented Interfaces:
Filter

public class PUFilter
extends BaseFilter

Port unification filter.

Author:
Alexey Stashok

Constructor Summary
PUFilter()
           
 
Method Summary
 void deregister(PUProtocol puProtocol)
          Deregisters the PUProtocol.
protected  void findProtocol(PUContext puContext, FilterChainContext ctx)
           
 Filter getBackChannelFilter()
          Get the back channel Filter implementation, which should connect the custom protocol FilterChain with the main FilterChain.
 java.util.Set<PUProtocol> getProtocols()
          Get registered port unification protocols - PUProtocols.
 FilterChainBuilder getPUFilterChainBuilder()
          Returns the FilterChainBuilder, developers may use to build there custom protocol filter chain.
 NextAction handleClose(FilterChainContext ctx)
           
 NextAction handleEvent(FilterChainContext ctx, FilterChainEvent event)
           
 NextAction handleRead(FilterChainContext ctx)
           
 PUProtocol register(ProtocolFinder protocolFinder, FilterChain filterChain)
          Registers new ProtocolFinder - FilterChain pair, which defines the protocol.
 void register(PUProtocol puProtocol)
          Registers new PUProtocol.
 
Methods inherited from class org.glassfish.grizzly.filterchain.BaseFilter
createContext, exceptionOccurred, getFilterChain, getIndex, handleAccept, handleConnect, handleWrite, onAdded, onFilterChainChanged, onRemoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PUFilter

public PUFilter()
Method Detail

register

public PUProtocol register(ProtocolFinder protocolFinder,
                           FilterChain filterChain)
Registers new ProtocolFinder - FilterChain pair, which defines the protocol.

Parameters:
protocolFinder - ProtocolFinder
filterChain - FilterChain
Returns:
PUProtocol, which wraps passed ProtocolFinder and FilterChain.

register

public void register(PUProtocol puProtocol)
Registers new PUProtocol.

Parameters:
puProtocol - PUProtocol

deregister

public void deregister(PUProtocol puProtocol)
Deregisters the PUProtocol.

Parameters:
puProtocol - PUProtocol

getProtocols

public java.util.Set<PUProtocol> getProtocols()
Get registered port unification protocols - PUProtocols.

Returns:
PUProtocol Set.

getBackChannelFilter

public Filter getBackChannelFilter()
Get the back channel Filter implementation, which should connect the custom protocol FilterChain with the main FilterChain. Usually developers shouldn't use this method, if they build custom protocol chains using getPUFilterChainBuilder(), otherwise they have to make sure there custom protocol FilterChain contains back channel Filter (usually first Filter in the custom protocol filter chain).

Returns:
back channel Filter.

getPUFilterChainBuilder

public FilterChainBuilder getPUFilterChainBuilder()
Returns the FilterChainBuilder, developers may use to build there custom protocol filter chain. The returned FilterChainBuilder may have some Filters pre-added.

Returns:
FilterChainBuilder.

handleRead

public NextAction handleRead(FilterChainContext ctx)
                      throws java.io.IOException
Specified by:
handleRead in interface Filter
Overrides:
handleRead in class BaseFilter
Throws:
java.io.IOException

handleEvent

public NextAction handleEvent(FilterChainContext ctx,
                              FilterChainEvent event)
                       throws java.io.IOException
Specified by:
handleEvent in interface Filter
Overrides:
handleEvent in class BaseFilter
Throws:
java.io.IOException

handleClose

public NextAction handleClose(FilterChainContext ctx)
                       throws java.io.IOException
Specified by:
handleClose in interface Filter
Overrides:
handleClose in class BaseFilter
Throws:
java.io.IOException

findProtocol

protected void findProtocol(PUContext puContext,
                            FilterChainContext ctx)


Copyright © 2011 Oracle Corpration. All Rights Reserved.