ant elder wrote:
On Sun, May 11, 2008 at 7:34 PM, Jean-Sebastien Delfino <
[EMAIL PROTECTED]> wrote:

ant elder wrote:

I've been trying to use the new distributed domain stuff -
domain-manager
and node2* etc - to get Tomcat as a domain manager with SCA webapps
being
individual nodes, but not really making much progress getting it to work
so
asking here to see if there are any suggestions - mainly from you
Sebastien
as you've written most of those new modules :-)

I'm going to send steps to show how to run an SCA node as a web app in a
different email.

 What i'd like is for during Tomcat startup to create a domain manager and
then as each webapp is initialized create a new node for each webapp and
register it with the domain, and to do that registration with in-JVM
calls.
Right now the domain manger needs to know about all the nodes before the
domain can be started (i think?) but thats problematic in this scenario
as
the webapps are initialized one by one and its hard to batch all those
up
and then initialize the domain and then correctly insert the node into
the
webapps context. This is discussed in a bit more detail in the thread at
[1].

I wondered about enhancing the domain manager so that it can be created
"empty" and then create/register nodes one-by-one and then activate the
domain once thats done (which probably would require the more dynamic
endpoint stuff being talked about in [2]), but I'm not sure that
approach
really fits in with the current design of the distributed domain
support?

WDYT, any comments or suggestions?

  ...ant

[1] http://apache.markmail.org/message/2i6gtkveapk3n4nr
[2] http://www.mail-archive.com/[email protected]/msg30314.html


I'd like to make sure I understand your question and scenario correctly
before trying answering the wrong question.

Here are the parts that I'm not following:

- create a domain manager (did u mean create an domain? deploy a domain
manager as a web app? start an instance of a domain manager?)


You tell me, I'm trying to understand how to use all this distributed domain
stuff you've written to support the scenario described above.

Well, I'm not sure what to tell you unless I understand what you meant by 'create a domain manager' before Tomcat starts deploying webapps and what the purpose would be.

Some of those
distributed domain classes need to created/initialized/started before Tomcat
starts deploying webapps

No not really, you don't need to create/initialize/start anything before deploying a webapp to Tomcat.

I posted a description of a scenario to this thread earlier today, and it doesn't require to start anything before deploying the tutorial webapp to Tomcat.

You need to have the configuration of the application (resolved and configured composite) before starting it, but not before deploying it (actually I think you can deploy the app with nothing started, not even Tomcat). Also even though the configuration of the application can be generated on the fly using the domain manager application, you don't have to do that, you could just provide it as a file on disk, or just use give it programmatically (a composite and a set of contributions) to the SCANode using one of the SCANodeFactory.create methods.

Maybe you can look at the samples under samples/domain-management, they show how to bootstrap things using the various SPIs and APIs.

 - is that the domain-manger? the domain-impl? Some
combination? Something else?



- there is no such thing as 'start a domain',


Well, the SCADomain interface does have a start method...

If I understand correctly, the SCADomain class represents the combination of a view of an SCA domain, and a runtime instance capable of running a set of components belonging to the domain (which I prefer to call an SCA node).

SCADomain.start() starts that view and runtime instance. This is different from starting an SCA administration domain.

I think you can start an SCA node, start an administration/manager application that gives you access to an SCA domain, but starting an SCA domain does not make sense IMHO.

does it help if its
"Right now the domain manger needs to know about all the nodes before all
the services in the domain can be started (I think?)"?

No it doesn't, and I think that it would be pretty inconvenient if it id. The requirement at the moment is the following: The domain manager app needs to know the endpoints of the targets of service references to be able to provide that information in a resolved composite.

If the target endpoint is available then you'll get it. Note that it doesn't mean that the target service is started or even deployed to a node, it just means that the target service appears with an endpoint in an SCA composite included in the SCA domain composite.

If the target service endpoint is not known when you ask the domain manager app to resolve a reference, then the reference will remain unresolved, and then the logic that Simon Laws described earlier in this thread (IIRC) can apply, and let the particular SCA binding implementation code do last minute resolution if you really want that.


why did you think that the domain manager needed to know all the nodes
before 'starting the domain'? what did you mean by 'starting the domain'?


See [1] and the reply to that email. It does have "i think?" in brackets
above, if thats not the case then great.

That's not the case, I think I covered this above.


How do you add or register a node?


Nodes are described with SCA components of type implementation.node. These SCA components can be contributed to the domain using the normal SCA contribution mechanism or just placed in composite files under the cloud/ directory under the domain root directory, and included using a regular SCA <include> by cloud.composite. There's a complete example under tutorial/domain. There's also sample code showing how to do this with SPIs under samples/domain-management.


- 'as each webapp is initialized', did you mean 'installed' or 'started'?


The node for the webapp needs to be available to use when the "init" method
is called on any of the webapp Servlets and similar classes. To create that
node we can intercept and do things at various points during the deployment
of the webapp depending on the requirements of the distributed domain
modules and classes.

I'm lost here, sorry. Did you mean create an instance of an SCANode object? or did you mean dynamically add a node declaration and configuration to the SCA domain that you Web container belongs to??


do you have the requirement to know about the existence of a webapp (node)
in an SCA domain before it's started?


No


I think that there's a disconnect here, I don't understand that part either. This is like saying that you don't need to know the existence of the Webapp before starting it. Also an SCA domain is a domain of administration, used to start/stop nodes etc. I'm not sure how you can start and administer a node from the domain if you don't know about it. I had asked that question to see if I was following what you were after, but I'm not, I'm probably missing something obvious.


- 'insert the node in the webapp context' what did you mean by that?


Put whatever is the node or domain Java object which clients are supposed to
use into the ServletContext object of the webapp. Ideally all our existing
webapp samples will continue to work with minimal changes when running in
this new deep integration approach.

Another mis-understanding, probably from my part. I don't understand what putting a node in the servlet context has to do with the 'new deep integration approach'. We were talking about shallow integration and deep integration last year, but AFAIK the code that works with the ServletContext at the moment is what we used to call shallow integration. Could you please say a bit more about this?


   ...ant

[1] http://apache.markmail.org/message/zhoclft2wrvypyys


--
Jean-Sebastien

Reply via email to