/** * This method is used to create <code>Operation</code> object to * process the next phase of the negotiation. The operations that * are created using this factory ensure the processing can be * done asynchronously, which reduces the overhead the connection * thread has when handing the pipelines over for processing. * * @param socket this is the pipeline that is to be processed * * @return this returns the operation used for processing */ public Operation getInstance(Socket socket) throws IOException { return getInstance(socket, socket.getEngine()); }
/** * Constructor for the <code>ProcessorServer</code> object. * The transport processor is used to process plain connections * and wrap those connections in a <code>Transport</code> that * can be used to send and receive data to and from. * * @param processor this is used to process transports * @param threads this is the number of threads this will use * @param threshold number of bytes that can be copied for queuing * @param buffer this is the size of the buffers for the transport * @param queue this is the number of buffers that can be queued * @param client determines if the SSL handshake is for a client */ public ProcessorServer(Processor processor, int threads, int threshold, int buffer, int queue, boolean client) throws IOException { this.negotiator = new SecureNegotiator(processor, threads); this.factory = new OperationFactory(negotiator, threshold, buffer, queue, client); this.terminator = new Terminator(processor, negotiator); }
/** * Constructor for the <code>TransportSocketProcessor</code> object. * The transport processor is used to process plain connections * and wrap those connections in a <code>Transport</code> that * can be used to send and receive data to and from. * * @param processor this is used to process transports * @param threads this is the number of threads this will use * @param buffer this is the initial size of the output buffer * @param threshold this is the maximum size of the output buffer * @param client determines if the SSL handshake is for a client */ public TransportSocketProcessor(TransportProcessor processor, int threads, int buffer, int threshold, boolean client) throws IOException { this.executor = new ConcurrentExecutor(Operation.class, threads); this.reactor = new ExecutorReactor(executor); this.factory = new OperationFactory(processor, reactor, buffer, threshold, client); this.cleaner = new ServerCleaner(processor, executor, reactor); }
/** * This method is used to create <code>Operation</code> object to * process the next phase of the negotiation. The operations that * are created using this factory ensure the processing can be * done asynchronously, which reduces the overhead the connection * thread has when handing the pipelines over for processing. * * @param socket this is the pipeline that is to be processed * * @return this returns the operation used for processing */ public Operation getInstance(Socket socket) throws IOException { return getInstance(socket, socket.getEngine()); }
/** * Constructor for the <code>TransportSocketProcessor</code> object. * The transport processor is used to process plain connections * and wrap those connections in a <code>Transport</code> that * can be used to send and receive data to and from. * * @param processor this is used to process transports * @param threads this is the number of threads this will use * @param buffer this is the initial size of the output buffer * @param threshold this is the maximum size of the output buffer * @param client determines if the SSL handshake is for a client */ public TransportSocketProcessor(TransportProcessor processor, int threads, int buffer, int threshold, boolean client) throws IOException { this.executor = new ConcurrentExecutor(Operation.class, threads); this.reactor = new ExecutorReactor(executor); this.factory = new OperationFactory(processor, reactor, buffer, threshold, client); this.cleaner = new ServerCleaner(processor, executor, reactor); }
/** * This method is used to create <code>Operation</code> object to * process the next phase of the negotiation. The operations that * are created using this factory ensure the processing can be * done asynchronously, which reduces the overhead the connection * thread has when handing the pipelines over for processing. * * @param socket this is the pipeline that is to be processed * * @return this returns the operation used for processing */ public Operation getInstance(Socket socket) throws IOException { return getInstance(socket, socket.getEngine()); }
/** * Used to connect the <code>Socket</code> which is a full duplex * TCP connection to a higher layer the application. It is this * layer that is responsible for interpreting a protocol or handling * messages in some manner. In the case of HTTP this will initiate * the consumption of a HTTP request after any SSL handshake is * finished if the connection is secure. * * @param socket this is the connected HTTP pipeline to process */ public void process(Socket socket) throws IOException { Operation task = factory.getInstance(socket); if(task != null) { reactor.process(task); } }
/** * Used to connect the <code>Socket</code> which is a full duplex * TCP connection to a higher layer the application. It is this * layer that is responsible for interpreting a protocol or handling * messages in some manner. In the case of HTTP this will initiate * the consumption of a HTTP request after any SSL handshake is * finished if the connection is secure. * * @param socket this is the connected HTTP pipeline to process */ public void process(Socket socket) throws IOException { Operation task = factory.getInstance(socket); if(task != null) { reactor.process(task); } }
/** * Used to process the <code>Pipeline</code> which is a full duplex * communication link that may contain several HTTP requests. This * will be used to read the requests from the <code>Pipeline</code> * and to pass these requests to a <code>Container</code> for * processing. * <p> * Typical usage of this method is to accept multiple pipeline * objects, each representing a unique HTTP channel to the client, * and process requests from those pipelines concurrently. * * @param socket this is the connected HTTP pipeline to process */ public void process(Socket socket) throws IOException { Operation task = factory.getInstance(socket); if(task != null) { negotiator.process(task); } }