[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: Fw: [equinox-dev] Is there a "bug" in the DS specification?
|
No spec is perfect :-)
One of the design goals of DS was to utilize Configuration is present but
to work without ConfigurationAdmin being present or without requiring a
configuration to be set.
I suppose what it needed is some new attribute for the component
declaration which says to only create an instance IF there is a
Configuration( or Configurations). This would seem to satisfy your need.
If you thinks this would satisfy your need, I will open a feature request
against the DS spec to consider adding this in the next release.
BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
hargrave@xxxxxxxxxx
Office: +1 407 849 9117 Mobile: +1 386 848 3788
John Wells <jwells131313@xxxxxxxxx>
Sent by: equinox-dev-bounces@xxxxxxxxxxx
2006-01-03 03:04 PM
Please respond to
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
To
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
cc
Subject
Re: Fw: [equinox-dev] Is there a "bug" in the DS specification?
Component factories are fine, except that I sort of have to roll-my-own
deployment then. It would be nicer to have this sort of deployment done
automagically for me. Anyway, thanks for the help.
John Wells (Aziz)
jwells@bea.comNOSPAM
Roy Paterson <rpatersn@xxxxxxxxxx> wrote:
The design intent was that all components get their configurations from CM
if it is available. I encourage you to check out ComponentFactory -
sounds like it is closer to what you want.
Roy
-----------------------------------------
Roy Paterson
IBM Pervasive Computing
Austin, TX
Phone: (512) 838-8898
John Wells <jwells131313@xxxxxxxxx>
Sent by: equinox-dev-bounces@xxxxxxxxxxx
01/03/2006 01:59 PM
Please respond to
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
To
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
cc
Subject
Re: Fw: [equinox-dev] Is there a "bug" in the DS specification?
Thanks for the explanation. I still think it would be nice to have a
mechanism whereby I can explictly tell the component that I want it to get
its configuration from the CS, and thereby not have the strangeness of
having a vestigial component in existence when there are zero instances of
the Configuration. You gotta admit that having it revert to the
"read-from-xml" file behaviour is unexpected.
John Wells (Aziz)
jwells@bea.comNOSPAM
Roy Paterson <rpatersn@xxxxxxxxxx> wrote:
Hello John,
This is a bit confusing but I don't think this is a "bug" in the DS
specification. Unfortunately DS isn't set up to do exactly what you want,
but I think it can come pretty close. The DS runtime behaves as follows :
1) A Component is enabled - DS checks to see if ConfigurationAdmin has a
Configuration (factory or not) for it's PID.
2) The Component does not have a Configuration - an instance of the
Component is resolved with the properties from the XML and activated.
(There is now 1 active instance)
... some time later
3) A Factory Configuration appears for the Component. DS deactivates and
disposes of the XML-properties instance of the Component, and creates and
activates a new instance with the properties from the Configuration.
(There is now 1 active instance)
4) Another Configuration appears for the Component. DS creates and
activates a new instance with the properties from the second
Configuration. (There are now 2 active instances)
... some time later
5) All of the Configurations for the Component's component.id are deleted
in CM. DS deactivates both of the active instances, and then creates and
activates a new instance with the properties from the XML file. (There is
now 1 active instance).
So basically it looks like DS does what you want, except it creates a
vestigial instance even if there are no configurations. You might want to
look at the ComponentFactory option, which behaves similarly but doesn't
automatically create new instances due to Configurations in ConfigAdmin.
However once you programmatically c reate the instances they can still be
configured by ConfigAdmin.
Regards,
Roy Paterson
-----------------------------------------
Roy Paterson
IBM Pervasive Computing
Austin, TX
Phone: (512) 838-8898
----- Forwarded by Roy Paterson/Austin/IBM on 01/03/2006 01:30 PM -----
Thomas Watson/Austin/IBM
01/03/2006 09:51 AM
To
Roy Paterson/Austin/IBM@IBMUS
cc
Subject
Fw: [equinox-dev] Is there a "bug" in the DS specification?
< FONT face=sans-serif size=2>Here is a message you may be able to answer.
Thomas Watson
Pervasive Development
Phone: 512-838-4533 Tie: 678-4533
tjwatson@xxxxxxxxxx
----- Forwarded by Thomas Watson/Austin/IBM on 01/03/2006 09:50 AM -----
John Wells <jwells131313@xxxxxxxxx>
Sent by: equinox-dev-bounces@xxxxxxxxxxx
12/31/2005 10:33 AM
Please respond to
Equinox development mailing list
To
equinox-dev@xxxxxxxxxxx
cc
Subject
[equinox-dev] Is there a "bug" in the DS specification?
In section 117.2 of the specification it says (I paraphrase):
A. If there is no Configuration with a PID or FactoryPID then the
component is deployed with properties from the xml file
B. If there is a Configuration with a PID with the same name as the
component then the properties are overridden with the properties from the
Configuration
C. (This one I am copying directly from the specification)
Factory Configuration – If a factory PID exists, with zero or more
Configurations,
that is equal to the component name, then for each Configuration,
a component configuration must be created that will obtain
additional component properties from Configuration Admin. This is the
ManagedServiceFactory situation.
What I don't understand is how to have a "factoryPID" configuration with
zero Configurations. In order to create a ManagedFactory cofiguration one
must use ConfigurationAdmin.createFactoryConfiguration("component-name")
which will then create a configuration with a factoryPID and a generated
PID. This is a Configuration with a factoryPID, but there is one of them.
Not zero. Which is unfor tunate, because I actually want the situation
where the components are created due to dynamic additions and subtractions
from factory Configuration objects (Configuration objects with the
factoryPID set).
However, it is impossible for DS to determine the difference between two
cases then.
1. There is no Configuration object but I want a component to be created
with the properties from the XML file
2. There is no Configuration object but I wanted to create a
Configuration with a matching FactoryPID later.
Since there is no way to tell the component which of the two situations I
wanted, it seems like there is a problem. There seems to only be two ways
to fix this:
1. Somehow change the ConfigurationAdmin specification to allow for a
Factory Configuration with zero subordinate configurations (doesn't seem
possible, given the mechanichs of the ConfigurationAdmin specification).
2. Some sort of property on the component that tells it that it should be
tied to the FactoryPID of a Configuration. (Obviously "factory" is out.
Perhaps something like "deployment-policy").
Am I misreading the specification? Is there some other way to read this
section? Can you DS experts help me out here? (What I actually want is
behavior #2 up above - components that are tied to a Factory Configuration
and which are created and destroyed dynamically).
John Wells (Aziz)
jwells@bea.comNOSPAM
(From my yahoo account, since I am on "vacation" reading
specifications!!!)
Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev
Yahoo! for Good - Make a difference this year.
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev
Yahoo! Photos
Ring in the New Year with Photo Calendars. Add photos, events, holidays,
whatever._______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev