org.simpleframework.http.core
Class ContainerTransportProcessor

java.lang.Object
  extended by org.simpleframework.http.core.ContainerTransportProcessor
All Implemented Interfaces:
TransportProcessor

public class ContainerTransportProcessor
extends Object
implements TransportProcessor

The ContainerProcessor object is used to create channels which can be used to consume and process requests. This is basically an adapter to the Selector 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.

Author:
Niall Gallagher

Constructor Summary
ContainerTransportProcessor(Container container, Allocator allocator, int count)
          Constructor for the ContainerProcessor object.
ContainerTransportProcessor(Container container, Allocator allocator, int count, int select)
          Constructor for the ContainerProcessor object.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerTransportProcessor

public ContainerTransportProcessor(Container container,
                                   Allocator allocator,
                                   int count)
                            throws IOException
Constructor for the ContainerProcessor 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 to
allocator - this is the allocator used to buffer data
count - this is the number of threads to be used
Throws:
IOException

ContainerTransportProcessor

public ContainerTransportProcessor(Container container,
                                   Allocator allocator,
                                   int count,
                                   int select)
                            throws IOException
Constructor for the ContainerProcessor 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 to
allocator - this is the allocator used to buffer data
count - this is the number of threads to be used
select - this is the number of controller threads to use
Throws:
IOException
Method Detail

process

public void process(Transport transport)
             throws IOException
This is used to consume HTTP messages that arrive on the given transport. All messages consumed from the transport are then handed to the Container 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 interface TransportProcessor
Parameters:
transport - the transport to process requests from
Throws:
IOException

stop

public void stop()
          throws 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 interface TransportProcessor
Throws:
IOException


Copyright © 2014. All Rights Reserved.