@Override
public void beginRequest(ExternalContext ec)
{
// asserts for debug which disappear in production
assert ec != null;
RequestStateMap state = RequestStateMap.getInstance(ec);
RequestType requestType = (RequestType) state.get(_REQUEST_TYPE);
// Do per-virtual request stuff
if (requestType == null)
{
// RequestType may change in a portal environment. Make sure it's set up to enforce the
// contracts
requestType = ExternalContextUtils.getRequestType(ec);
RequestStateMap.getInstance(ec).put(_REQUEST_TYPE, requestType);
// By contract, Configurators beginRequest is only called once per physical request.
// The globalConfigurator may be called multiple times, however, so we need to enforce
// the contract.
if (!_isDisabled(ec))
{
// If this hasn't been initialized then please initialize
if (!_initialized)
{
init(ec);
}
_attachRequestContext(ec);
if (state.get(_IN_REQUEST) == null)
{
_startConfiguratorServiceRequest(ec);
}
}
else