00001 /** @file 00002 00003 A brief file description 00004 00005 @section license License 00006 00007 Licensed to the Apache Software Foundation (ASF) under one 00008 or more contributor license agreements. See the NOTICE file 00009 distributed with this work for additional information 00010 regarding copyright ownership. The ASF licenses this file 00011 to you under the Apache License, Version 2.0 (the 00012 "License"); you may not use this file except in compliance 00013 with the License. You may obtain a copy of the License at 00014 00015 http://www.apache.org/licenses/LICENSE-2.0 00016 00017 Unless required by applicable law or agreed to in writing, software 00018 distributed under the License is distributed on an "AS IS" BASIS, 00019 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00020 See the License for the specific language governing permissions and 00021 limitations under the License. 00022 */ 00023 00024 /** 00025 * Remap plugin processor 00026 **/ 00027 #if !defined (_REMAPPROCESSOR_h_) 00028 #define _REMAPPROCESSOR_h_ 00029 00030 #include "I_EventSystem.h" 00031 #include "RemapPlugins.h" 00032 #include "RemapPluginInfo.h" 00033 #include "ReverseProxy.h" 00034 #undef std // FIXME: remove dependency on the STL 00035 #include <map> 00036 00037 #define EVENT_REMAP_START (REMAP_EVENT_EVENTS_START+0) 00038 #define EVENT_REMAP_ERROR (REMAP_EVENT_EVENTS_START+1) 00039 #define EVENT_REMAP_COMPLETE (REMAP_EVENT_EVENTS_START+2) 00040 00041 class url_mapping; 00042 00043 class RemapProcessor: public Processor 00044 { 00045 public: 00046 00047 RemapProcessor() 00048 : ET_REMAP(0), _use_separate_remap_thread(false) 00049 { } 00050 00051 ~RemapProcessor() { } 00052 00053 bool setup_for_remap(HttpTransact::State * s); 00054 bool finish_remap(HttpTransact::State * s); 00055 00056 Action *perform_remap(Continuation * cont, HttpTransact::State * s); 00057 int start(int num_threads, size_t stacksize); 00058 bool LessThan(HttpTransact::State *, HttpTransact::State *); 00059 void setUseSeparateThread() { _use_separate_remap_thread = true; } 00060 bool using_separate_thread() { return _use_separate_remap_thread == true; } 00061 00062 private: 00063 EventType ET_REMAP; 00064 bool _use_separate_remap_thread; 00065 }; 00066 00067 /** 00068 * the global remapProcessor that everyone uses 00069 **/ 00070 extern RemapProcessor remapProcessor; 00071 00072 #endif