On Wed, Dec 9, 2009 at 2:02 PM, Simon Laws <[email protected]> wrote:
> The createNode(String... contributionLocations); operation sounds
> reasonable. I'd like to make a list of what we have in various places
> and what it's utility is. We already have several ways of creating
> nodes through APIs and launchers and they are not consistent.
>
> node-api/NodeFactory
>    public Node createNode(URL configurationURL) {
>        URL of a node config doc
>    public Node createNode(InputStream is) {
>        node config doc as a stream
>    public Node createNode(String deploymentCompositeURI,
> Contribution... contributions)
>        deployment composite URI and list of contribution configurations
>    public final Node createNode(String deploymentCompositeURI,
> String[] uris, String locations[])
>         ???
>    public final Node createNode(String deploymentCompositeURI, String
> locations[])
>         ???
>    public final Node createNode(Reader deploymentCompositeContent,
> String[] uris, String locations[])
>          ???
>    public final Node createNode(String compositeURI, ClassLoader classLoader)
>          ???
>    public Node createNode(Contribution... contributions)
>         list of contribution configurations
>    public Node createNode(InputStream compositeContent,
> Contribution... contributions)
>         contributions and deployment composite in an input stream
>    public Node createNode(Reader compositeContent, Contribution...
> contributions)
>        contributions and deployment composite in a reader
>    public Node createNode()
>        assume contrib is in current directory
>   Seems to be a lot. What can we add/remove? Ant already suggested a
> list of contribution locations.
>

Some more additions:

- createNode(URI uri, String... contributionLocations);
where the uri is the config uri that can be used to configure things
like the domain name and registry. That would match the SCAClient API
that takes the the similar uri to connect to the running services

- it would useful and consistent to have a way to use Nodes with the
objects created from the Deployer so for example you can doing things
like Deployer.loadContribution, fiddle about with the Contribution and
then use that object in a Node. I'm not suggesting a method signature
for this yet as this opens up quite a lot of interesting options. For
example, all the NodeFactory methods about attaching or adding
deployment composites could then be done via the Deployer instead of
all the overloaded createNode methods. To do this well requires quite
a lot of changes to the Node APIs but after some playing around it
looks to me like it could make the APIs much cleaner with the simple
uses clear and obvious and the more complex cases more consistent and
powerful.

- rename createNode(URL) to match the other loadConfiguration method,
or rename both to something like createNodeFromConfig

Some to remove:
- all the ones using classloaders
- the Client Interface and just add the getService method to Node
- the destroy method
- the getInstance(String domainURI) as there's the createNode that
includes the URI

   ...ant

Reply via email to