Configuration | ![]() |
http://plover.sourceforge.net | Last published: 03 April, 2005 |
![]() |
![]() |
|||||
|
IntroductionIn this document we shall explain how to configure the Plover server-side hosting environment. Henceforth in this document, unless explicitly mentioned, the name Plover is synonymous with the server-side entity hosting environment.Plover supports two mechanisms of host configuration: programatically setting all parameters and reading entries from a XML file to set all parameters in one operation. You can use both these mechanisms in tandem, before you start the hosting environment. For example, you can configure the hosting environment using a base set of values using a configuration file and then fine-tune the same using the API methods.
An Example ConfigurationThe interface omd.plover.hosting.spi.IHostConfig provides all methods to configure the entity hosting environment. An example code is as provided below:
The same configuration effect as the code example above can be achieved using information stored in a XML file. The corresponding XML data is as provided below: <?xml version="1.0"?> <plover-host> <rmi-server /> <object-entity id="userMgr" type="sample.UserManager" /> <script-entity id="perMgr" path="sample/PermissionManager.script" /> </plover-host>
XML Configuration StructureThe complete DTD for the Plover XML configuration file is available here. Portions of the same are explained in details below. For details on the corresponding APIs for configuration, refer to the javadoc documentation of the omd.plover.hosting.spi.IHostConfig interface.<!ATTLIST plover-host type NMTOKEN #IMPLIED version NMTOKEN #IMPLIED > <!ELEMENT rmi-server EMPTY> <!ATTLIST rmi-server port NMTOKEN #IMPLIED bindPath NMTOKEN #IMPLIED leaseValue NMTOKEN #IMPLIED > <!ELEMENT discovery EMPTY> <!ATTLIST discovery address NMTOKEN #IMPLIED port NMTOKEN #IMPLIED > <!ELEMENT session EMPTY> <!ATTLIST session timeout NMTOKEN #REQUIRED > Use this element to set an explicit session timeout value in milliseconds. If not provided, the timeout value defaults to 30 seconds. <!ELEMENT access-controller (init-param*)> <!ATTLIST access-controller type NMTOKEN #REQUIRED > In the absence of this configuration information, a default access controller is used by Plover that allows all client credentials to connect to and access all methods on all hosted entities. <!ELEMENT global-object (init-param*)> <!ATTLIST global-object id NMTOKEN #REQUIRED type NMTOKEN #REQUIRED > Global objects are referred by the id attribute from within hosted entities. The type attribute should provide the fully qualified name of the global object class. Further customizations at runtime are provided by information contained in the nested init-param elements. <!ELEMENT object-entity EMPTY> <!ATTLIST object-entity id NMTOKEN #REQUIRED type NMTOKEN #REQUIRED sticky (true | false) #IMPLIED > <!ELEMENT script-entity EMPTY> <!ATTLIST script-entity id NMTOKEN #REQUIRED path NMTOKEN #REQUIRED sticky (true | false) #IMPLIED > For hosted entities that are implemented as Java classes, the type attribute should contain the fully qualified name of the class. For hosted entities that are implemented as Javascript fragments, the path attribute should contain the path to the corresponding script file. The sticky attribute determines the lifecycle of a hosted entity. By default, this attribute is false indicating that hosted entities are created and destroyed with every remote invocation. A true for this attribute signifies that the same hosted entity instance is reused across remote invocations for the same client session. Default Configuration ValuesIn the absence of any additional parameters for RMI transport, the bind path defaults to plover and the registry port value to 1099. The RMI lease value defaults to 30 seconds.In the absence of any additional parameters for discovery service, the multicast address defaults to 239.255.255.255 and the corresponding port defaults to 6789. |
|||||
![]() |
|