Publishing Engine Programmer's Guide > The Arbortext Publishing Engine Request Manager > Understanding the Internal Structure of Arbortext PE Request Manager > Arbortext PE sub-process Pool Management > Matching Arbortext PE sub-processes with Requests
  
Matching Arbortext PE sub-processes with Requests
Whenever a dynamic component needs an Arbortext PE sub-process to service a request, it calls the com.arbortext.E3RequestContext.allocateE3Subprocess method, passing the request as a parameter. allocateSubprocess in turn, calls the method com.arbortext.e3.E3SubprocessPool.testRequest for each Arbortext PE sub-process pool until a pool returns true, again passing the request as a parameter. The defaultArbortext PE sub-process pool can handle every request; its response to testRequest is always true. Every other Arbortext PE sub-process pool evaluates the request against the Arbortext PE sub-process pool's configured TestSet.
A TestSet is the equivalent of a parenthetical boolean expression containing any number of Test elements grouped by And and Or operators. Each Test element refers to a Request Selector. A Request Selector is a dynamic component that examines a request and determines whether the request matches a predefined criteria.
Each Test element specification must include a name attribute that identifies a RequestSelector. Several Test elements may reference the same RequestSelector.
Each RequestSelector is an object implementing the com.arbortext.e3.E3RequestSelector interface, which has a single method called test. The test method takes an HTTP request as a parameter and returns true or false.
When configuring a TestSet, keep in mind:
A TestSet or And element returns true if every Test, And, and Or element it contains returns true. Remember that And elements can be nested, so a true response for a lower level test may be eventually superseded by a higher level false response after all the And conditions are evaluated.
An Or element returns true if any Test, And, or Or element returns true.
Given these assumptions, the testRequest method passes the current HTTP request to the test structure built from the subprocess pool's TestSet element. The TestSet structure is evaluated like a logical expression that returns the result from testRequest (true or false).