The central registry class. Implemented as singleton.
The normal way to use managers in webman is to request an instance of
the Registry, using the
Registry.getInstance() method, and looking up
the Manager from the resulting instance using the manager's id. For
example:
MyManager reg = (MyManager)Registry.getInstance().lookup("acl");
Boolean authgrp = (Boolean)reg.get("AUTH_GROUP", Boolean.FALSE);
Since webman is a (kind of) webapplication and webapplications live in
hostile environment (at least from the point of configuration at start
up time), the configuration of the Registry is a bit weird. It is done
using a xml file read in the very first time, the Registry is
configured. Any following tries to configure it are simply ignored (see
Registry.setConfiguration() ). The structure of the xml config file is
as follows:
<!ELEMENT registry (factories?)>
<!ELEMENT factories (registry*)>
<!ELEMENT manager #EMPTY>
<!ATTLIST manager load-scheme (start|lazy) "lazy"
factory-class CDATA #REQUIRED>
Example:
author: Gregor Klinke version: $Revision: 1.2 $ |