root/Enterprise/trunk/AppServer/I_ApplicationService.hpp @ 2358

Revision 2358, 3.3 KB (checked in by trichards, 15 months ago)

Merged 0154_TR_DATA_MODEL to Enterprise trunk.

Line 
1//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
2// Zen Enterprise Framework
3//
4// Copyright (C) 2001 - 2009 Tony Richards
5//
6//  This software is provided 'as-is', without any express or implied
7//  warranty.  In no event will the authors be held liable for any damages
8//  arising from the use of this software.
9//
10//  Permission is granted to anyone to use this software for any purpose,
11//  including commercial applications, and to alter it and redistribute it
12//  freely, subject to the following restrictions:
13//
14//  1. The origin of this software must not be misrepresented; you must not
15//     claim that you wrote the original software. If you use this software
16//     in a product, an acknowledgment in the product documentation would be
17//     appreciated but is not required.
18//  2. Altered source versions must be plainly marked as such, and must not be
19//     misrepresented as being the original software.
20//  3. This notice may not be removed or altered from any source distribution.
21//
22//  Tony Richards trichards@indiezen.com
23//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
24#ifndef ZEN_APPSERVER_I_APPLICATION_SERVICE_HPP_INCLUDED
25#define ZEN_APPSERVER_I_APPLICATION_SERVICE_HPP_INCLUDED
26
27#include "Configuration.hpp"
28
29#include <Zen/Enterprise/AppServer/I_RequestHandler.hpp>
30
31#include <Zen/Core/Memory/managed_ptr.hpp>
32
33//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
34namespace Zen {
35namespace Enterprise {
36namespace AppServer {
37//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
38class I_ApplicationServer;
39class I_Message;
40class I_MessageType;
41
42class APPSERVER_DLL_LINK I_ApplicationService
43:   public I_RequestHandler
44{
45    /// @name Types
46    /// @{
47public:
48    typedef Memory::managed_ptr<I_Message>                  pMessage_type;
49    typedef Zen::Memory::managed_ptr<I_MessageType>         pMessageType_type;
50    /// @}
51
52    /// @name I_ApplicationService interface.
53    /// @{
54public:
55    /// Get the application server which is hosting this application service.
56    /// This must be the same reference that was passed to the factory create
57    /// method.
58    /// @see I_ApplicationServiceFactory
59    virtual I_ApplicationServer& getApplicationServer() = 0;
60
61    /// Handle a message
62    /// Messages are one-way notifications and are not expected to return a result.
63    virtual void handleMessage(pMessage_type _pMessage) = 0;
64    /// @}
65
66    /// @name Static methods
67    /// @{
68public:
69    static const std::string& getNamespace();
70    static const std::string& getExtensionPointName();
71    /// @}
72
73    /// @name Events
74    /// @{
75public:
76    /// @}
77
78    /// @name 'Structors
79    /// @{
80protected:
81             I_ApplicationService();
82    virtual ~I_ApplicationService();
83    /// @}
84
85};  // interface I_ApplicationService
86
87//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
88}   // namespace AppServer
89}   // namespace Enterprise
90namespace Memory
91{
92    /// I_ApplicationService is managed by a factory
93    template<>
94    struct is_managed_by_factory<Enterprise::AppServer::I_ApplicationService> : public boost::true_type{};
95}   // namespace Memory
96}   // namespace Zen
97//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
98
99#endif // ZEN_APPSERVER_I_APPLICATION_SERVICE_HPP_INCLUDED
Note: See TracBrowser for help on using the browser.