RE: component deployment

"Goldsack, Patrick" <[email protected]>
Newsgroups gmane.comp.java.smartfrog.user
Message-ID <D46BE408DE18F841B90DEFA8CAA2CDB2A8861A@sdcexcea01.emea.cpqcorp.net>

I presume that you have a ComponentDescriptionImpl instance already
parsed - either by parsing the text (from a string, a file or some input
stream) or by picking up a "LAZY extends" attribute.

The right model will depend on whether you want the component parented
or not, and by what, and which phase of the lifecycle this parent is in.

Andreas,

I will cover a number of possibilities for your current situation:

1) you are to be the parent, and you are a compound, call the method
sfCreateNewChild(...) on yourself. You can do this as you are in
sfStart, but only after the super call. Had you been in sfDeploy(), you
would have to only partially step through the lifecycle and use the more
basic methods.

2) you are not the parent but some other compound is - it depends on
whether you where you want this component deployed (near you, near the
parent, or elsewhere). If the location is near the compound - call the
sfCreateNewChild() on that compound passing the
ComponentDescriptionImpl. If the location is not near that compound,
find the process compound of the location (do an sfResolve in the link
"HOST hostame"), and call sfCreateNewChild( ) passing the required
compound as a parent parameter. This will be OK if the parent has been
fully through its lifecycle.

3) If you want no parent - do as (2) to locate the right process
compound, and use sfCreateNewApp(...).

In 2 and 3, if the location attributes are set in the component
description, you can always use the local process compound to deploy the
component in the right place.

Patrick

-----Original Message-----
From: smartfrog-support-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:smartfrog-support-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of
Andreas Unterkircher
Sent: 16 March 2005 13:41
To: smartfrog-support-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [Smartfrog-support] component deployment


Hello,

I have a component which should deploy another component if some
condition is met within the sfStart method. What is the right way to do
that in Java ? E.g. I was thinking of something like

newComponent = new newComponentImpl();
newComponentImpl.sfDeploy();
newComponentImpl.sfStart();

but I guess this is not right... Do I have to use PrimDeployerImpl ? 

Thanks,
Andreas

--
Andreas Unterkircher
IT Department
CERN
CH-1211 Geneva 23
http://cern.ch/openlab


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Smartfrog-support mailing list
Smartfrog-support-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/smartfrog-support


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.