ApacheApplication.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // ApacheApplication.h
  3. //
  4. // Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH.
  5. // and Contributors.
  6. //
  7. // SPDX-License-Identifier: BSL-1.0
  8. //
  9. #ifndef ApacheConnector_ApacheApplication_INCLUDED
  10. #define ApacheConnector_ApacheApplication_INCLUDED
  11. #include "ApacheRequestHandlerFactory.h"
  12. #include "Poco/Util/Application.h"
  13. #include "Poco/Mutex.h"
  14. class ApacheApplication: public Poco::Util::Application
  15. {
  16. public:
  17. ApacheApplication();
  18. /// Creates the ApacheApplication and sets the
  19. /// ApacheChannel as the root logger channel.
  20. ~ApacheApplication();
  21. /// Destroys the ApacheApplication.
  22. void setup();
  23. /// Initializes the application if called for the first
  24. /// time; does nothing in later calls.
  25. ApacheRequestHandlerFactory& factory();
  26. /// Returns the ApacheRequestHandlerFactory.
  27. static ApacheApplication& instance();
  28. /// Returns the application instance.
  29. private:
  30. bool _ready;
  31. ApacheRequestHandlerFactory _factory;
  32. Poco::FastMutex _mutex;
  33. };
  34. //
  35. // inlines
  36. //
  37. inline ApacheRequestHandlerFactory& ApacheApplication::factory()
  38. {
  39. return _factory;
  40. }
  41. #endif // ApacheConnector_ApacheApplication_INCLUDED