Package org.simpleframework.http.core
Class ContainerTransportProcessor
- java.lang.Object
-
- org.simpleframework.http.core.ContainerTransportProcessor
-
- All Implemented Interfaces:
TransportProcessor
public class ContainerTransportProcessor extends java.lang.Object implements TransportProcessor
TheContainerProcessor
object is used to create channels which can be used to consume and process requests. This is basically an adapter to theSelector
which will convert the provided transport to a usable channel. Each of the connected pipelines will end up at this object, regardless of whether those connections are SSL or plain data.
-
-
Field Summary
Fields Modifier and Type Field Description private Controller
controller
This is the controller used to process the created channels.
-
Constructor Summary
Constructors Constructor Description ContainerTransportProcessor(Container container, Allocator allocator, int count)
Constructor for theContainerProcessor
object.ContainerTransportProcessor(Container container, Allocator allocator, int count, int select)
Constructor for theContainerProcessor
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
process(Transport transport)
This is used to consume HTTP messages that arrive on the given transport.void
stop()
This method is used to stop the connector in such a way that it will not accept and process any further messages.
-
-
-
Field Detail
-
controller
private final Controller controller
This is the controller used to process the created channels.
-
-
Constructor Detail
-
ContainerTransportProcessor
public ContainerTransportProcessor(Container container, Allocator allocator, int count) throws java.io.IOException
Constructor for theContainerProcessor
object. This is used to create a processor which will convert the provided transport objects to channels, which can then be processed by the controller and dispatched to the container.- Parameters:
container
- the container to dispatch requests toallocator
- this is the allocator used to buffer datacount
- this is the number of threads to be used- Throws:
java.io.IOException
-
ContainerTransportProcessor
public ContainerTransportProcessor(Container container, Allocator allocator, int count, int select) throws java.io.IOException
Constructor for theContainerProcessor
object. This is used to create a processor which will convert the provided transport objects to channels, which can then be processed by the controller and dispatched to the container.- Parameters:
container
- the container to dispatch requests toallocator
- this is the allocator used to buffer datacount
- this is the number of threads to be usedselect
- this is the number of controller threads to use- Throws:
java.io.IOException
-
-
Method Detail
-
process
public void process(Transport transport) throws java.io.IOException
This is used to consume HTTP messages that arrive on the given transport. All messages consumed from the transport are then handed to theContainer
for processing. The response will also be delivered over the provided transport. At this point the SSL handshake will have fully completed.- Specified by:
process
in interfaceTransportProcessor
- Parameters:
transport
- the transport to process requests from- Throws:
java.io.IOException
-
stop
public void stop() throws java.io.IOException
This method is used to stop the connector in such a way that it will not accept and process any further messages. If there are resources to clean up they may be cleaned up asynchronously so that this method can return without blocking.- Specified by:
stop
in interfaceTransportProcessor
- Throws:
java.io.IOException
-
-