Renamed CMS_API_SERVICE as CMS_API .
Reversed the design, and break dependency CMS_SETUP => CMS_API . Now CMS_API has attribute setup: CMS_SETUP . Moved error_handler from CMS_SETUP to CMS_API. The instance of CMS_SETUP is used when instanciating modules. The instance of CMS_API is used when instanciating CMS_REPONSE and Handlers/Filters. The instance of CMS_API is passed as argument to build the CMS_MODULE.router and filter.
This commit is contained in:
@@ -15,21 +15,17 @@ create
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (a_config: CMS_SETUP)
|
||||
make
|
||||
do
|
||||
name := "Demo module"
|
||||
version := "1.0"
|
||||
description := "Service to demonstrate and test cms system"
|
||||
package := "demo"
|
||||
config := a_config
|
||||
end
|
||||
|
||||
config: CMS_SETUP
|
||||
-- Node configuration.
|
||||
|
||||
feature -- Access: router
|
||||
|
||||
router: WSF_ROUTER
|
||||
router (a_api: CMS_API): WSF_ROUTER
|
||||
-- Node router.
|
||||
do
|
||||
create Result.make (2)
|
||||
|
||||
@@ -117,12 +117,12 @@ feature -- CMS Initialization
|
||||
initialize_cms (a_setup: CMS_SETUP)
|
||||
local
|
||||
cms: CMS_SERVICE
|
||||
api: CMS_API
|
||||
do
|
||||
log.write_debug (generator + ".initialize_cms")
|
||||
|
||||
setup_modules (a_setup)
|
||||
|
||||
create cms.make (a_setup)
|
||||
create api.make (a_setup)
|
||||
create cms.make (api)
|
||||
cms_service := cms
|
||||
end
|
||||
|
||||
@@ -133,14 +133,13 @@ feature -- CMS setup
|
||||
local
|
||||
m: CMS_MODULE
|
||||
do
|
||||
create {BASIC_AUTH_MODULE} m.make (a_setup)
|
||||
create {BASIC_AUTH_MODULE} m.make
|
||||
m.enable
|
||||
a_setup.modules.extend (m)
|
||||
|
||||
create {CMS_DEMO_MODULE} m.make (a_setup)
|
||||
create {CMS_DEMO_MODULE} m.make
|
||||
m.enable
|
||||
a_setup.modules.extend (m)
|
||||
|
||||
end
|
||||
|
||||
setup_storage (a_setup: CMS_SETUP)
|
||||
|
||||
Reference in New Issue
Block a user