I have some questions about configuring a Component declaratively using XML as 
described, for example, in the Component class API documentation

http://www.restlet.org/documentation/2.1/jse/api/org/restlet/Component.html

as well as in "Restlet in Action" section 3.4.

I want to attach separate instances of the same ServerResource subclass to two 
different TCP ports.  My understanding is that my Component XML configuration 
file will need to contain a separate <server> element for each port, with the 
"port" attribute of each set to the number of the port I want to be listening 
on.

My first question is whether that is correct, or if there is a way to use one 
<server> element to configure listening on both ports (and only those ports)?

Assuming I need to have two <server> elements, the next point is that I am 
using SSL, so the <server> elements contain all the configuration parameters, 
trustStore file names and passwords and so forth.  I don't want to duplicate 
all that text, so my thinking is that I should declare an XML internal entity 
containing all the SSL configuration markup, which I can then insert into my 
two <server> elements using entity references.  As my guide I am referring to 
sections 2.8 and 4.2.1 of the XML specification:

http://www.w3.org/TR/REC-xml/#sec-prolog-dtd
http://www.w3.org/TR/REC-xml/#sec-internal-ent

My understanding is that any internal entity declaration is a markup 
declaration and therefore must go into an XML DTD.  I want to keep everything 
in the same file, so that would be an internal subset DTD.

When I put so much as the following line into the restlet Component XML 
configuration file between the XML prolog and the <component> start tag:

<!DOCTYPE component [] >

the Component does not start when I call start() on it.  Nor do I see any error 
messages.

So my general question is how to do what I want: get multiple, 
differently-configured instances of the same ServerResource subclass listening 
on different ports, configured declaratively in XML, without repeating all the 
SSL configuration parameters for both?  Is using an XML entity in the 
configuration file DTD the optimal way to do it?  And if so, why is adding the 
<!DOCTYPE> DTD apparently causing the Component configuration to be ineffectual?

I am using Restlet v. 2.1-RC6.

Thank you very much.

--
Adam Mackler

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3004605

Reply via email to