You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Musachy Barroso <mu...@gmail.com> on 2009/04/05 03:50:22 UTC
plugin loading order
I have been trying a few different ways to get the Convention plugin
to work with the OSGi plugin, and there are some hacks that can be
done but I don't like them. I want to implement (I actually have it
implemented it already somewhere) a simple way for the config files to
specify a relative order of loading. This way I can at least make sure
that certaing plugins are loaded before others. It would look like
this in the xml:
OSGi:
<struts loadOrder="10">...</struts>
Convention:
<struts loadOrder="20">...</struts>
With this in place, we can enable some sort of communication between
plugins, by adding common interfaces to core. Any thoughts?
musachy
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: plugin loading order
Posted by Musachy Barroso <mu...@gmail.com>.
btw, this provides some very nice reloading of configuration by just
re-deploying the bundle. Admittedly , it was not intentional, but it
works, so I am kinda surprised.
musachy
On Sun, Apr 5, 2009 at 8:51 PM, Musachy Barroso <mu...@gmail.com> wrote:
> The changes are in the sanbox and trunk, to make Convention work with
> OSGi bundles. I still need to implement the plugin load order thing,
> right now it works because the OSGi plugin gets loaded first.
>
> I think we should get the OSGi and OVal plugins into trunk for the
> next release and label them "experimental". Anyone against it? I will
> start a vote thread later on, unless someone is against it.
>
> musachy
>
> On Sun, Apr 5, 2009 at 5:38 PM, Musachy Barroso <mu...@gmail.com> wrote:
>> and it finally works :)
>>
>> musachy
>>
>> On Sun, Apr 5, 2009 at 5:00 PM, Musachy Barroso <mu...@gmail.com> wrote:
>>> The plugin loading order takes 15 mins to implement. Getting OSGi to
>>> work with Convention, 3 days and counting, I am losing my nerve
>>> already :)
>>>
>>> musachy
>>>
>>> On Sun, Apr 5, 2009 at 4:54 PM, Wes Wannemacher <we...@wantii.com> wrote:
>>>> On Sunday 05 April 2009 15:17:24 Chris Pratt wrote:
>>>>> Sorry, I tried to make it clear that the optional attribute would be
>>>>> available to intrinsically denote load order without imposing any
>>>>> all-or-nothing dependency. Basically the point is to tell struts that the
>>>>> requirement is "if you want Convention to be able to use OSGi, check to see
>>>>> if it's available before loading Convention". That would not make OSGi a
>>>>> required dependency of Convention, just an optional ability.
>>>>> (*Chris*)
>>>>>
>>>>
>>>> You were clear enough, by the time I read Musachy's response, I had forgotten
>>>> about the "optional." I think the thing right now is that up until now, all
>>>> plugins have avoided interdependencies and related problems. A simple solution
>>>> to guarantee one plugin loads before another is enough, but if you want to
>>>> enhance it, feel free and post it in JIRA and we'll likely apply it.
>>>>
>>>> -Wes
>>>>
>>>> --
>>>>
>>>> Wes Wannemacher
>>>> Author - Struts 2 In Practice
>>>> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
>>>> http://www.manning.com/wannemacher
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: dev-help@struts.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>>
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: plugin loading order
Posted by Musachy Barroso <mu...@gmail.com>.
The changes are in the sanbox and trunk, to make Convention work with
OSGi bundles. I still need to implement the plugin load order thing,
right now it works because the OSGi plugin gets loaded first.
I think we should get the OSGi and OVal plugins into trunk for the
next release and label them "experimental". Anyone against it? I will
start a vote thread later on, unless someone is against it.
musachy
On Sun, Apr 5, 2009 at 5:38 PM, Musachy Barroso <mu...@gmail.com> wrote:
> and it finally works :)
>
> musachy
>
> On Sun, Apr 5, 2009 at 5:00 PM, Musachy Barroso <mu...@gmail.com> wrote:
>> The plugin loading order takes 15 mins to implement. Getting OSGi to
>> work with Convention, 3 days and counting, I am losing my nerve
>> already :)
>>
>> musachy
>>
>> On Sun, Apr 5, 2009 at 4:54 PM, Wes Wannemacher <we...@wantii.com> wrote:
>>> On Sunday 05 April 2009 15:17:24 Chris Pratt wrote:
>>>> Sorry, I tried to make it clear that the optional attribute would be
>>>> available to intrinsically denote load order without imposing any
>>>> all-or-nothing dependency. Basically the point is to tell struts that the
>>>> requirement is "if you want Convention to be able to use OSGi, check to see
>>>> if it's available before loading Convention". That would not make OSGi a
>>>> required dependency of Convention, just an optional ability.
>>>> (*Chris*)
>>>>
>>>
>>> You were clear enough, by the time I read Musachy's response, I had forgotten
>>> about the "optional." I think the thing right now is that up until now, all
>>> plugins have avoided interdependencies and related problems. A simple solution
>>> to guarantee one plugin loads before another is enough, but if you want to
>>> enhance it, feel free and post it in JIRA and we'll likely apply it.
>>>
>>> -Wes
>>>
>>> --
>>>
>>> Wes Wannemacher
>>> Author - Struts 2 In Practice
>>> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
>>> http://www.manning.com/wannemacher
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: dev-help@struts.apache.org
>>>
>>>
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: plugin loading order
Posted by Musachy Barroso <mu...@gmail.com>.
and it finally works :)
musachy
On Sun, Apr 5, 2009 at 5:00 PM, Musachy Barroso <mu...@gmail.com> wrote:
> The plugin loading order takes 15 mins to implement. Getting OSGi to
> work with Convention, 3 days and counting, I am losing my nerve
> already :)
>
> musachy
>
> On Sun, Apr 5, 2009 at 4:54 PM, Wes Wannemacher <we...@wantii.com> wrote:
>> On Sunday 05 April 2009 15:17:24 Chris Pratt wrote:
>>> Sorry, I tried to make it clear that the optional attribute would be
>>> available to intrinsically denote load order without imposing any
>>> all-or-nothing dependency. Basically the point is to tell struts that the
>>> requirement is "if you want Convention to be able to use OSGi, check to see
>>> if it's available before loading Convention". That would not make OSGi a
>>> required dependency of Convention, just an optional ability.
>>> (*Chris*)
>>>
>>
>> You were clear enough, by the time I read Musachy's response, I had forgotten
>> about the "optional." I think the thing right now is that up until now, all
>> plugins have avoided interdependencies and related problems. A simple solution
>> to guarantee one plugin loads before another is enough, but if you want to
>> enhance it, feel free and post it in JIRA and we'll likely apply it.
>>
>> -Wes
>>
>> --
>>
>> Wes Wannemacher
>> Author - Struts 2 In Practice
>> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
>> http://www.manning.com/wannemacher
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: plugin loading order
Posted by Musachy Barroso <mu...@gmail.com>.
The plugin loading order takes 15 mins to implement. Getting OSGi to
work with Convention, 3 days and counting, I am losing my nerve
already :)
musachy
On Sun, Apr 5, 2009 at 4:54 PM, Wes Wannemacher <we...@wantii.com> wrote:
> On Sunday 05 April 2009 15:17:24 Chris Pratt wrote:
>> Sorry, I tried to make it clear that the optional attribute would be
>> available to intrinsically denote load order without imposing any
>> all-or-nothing dependency. Basically the point is to tell struts that the
>> requirement is "if you want Convention to be able to use OSGi, check to see
>> if it's available before loading Convention". That would not make OSGi a
>> required dependency of Convention, just an optional ability.
>> (*Chris*)
>>
>
> You were clear enough, by the time I read Musachy's response, I had forgotten
> about the "optional." I think the thing right now is that up until now, all
> plugins have avoided interdependencies and related problems. A simple solution
> to guarantee one plugin loads before another is enough, but if you want to
> enhance it, feel free and post it in JIRA and we'll likely apply it.
>
> -Wes
>
> --
>
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: plugin loading order
Posted by Wes Wannemacher <we...@wantii.com>.
On Sunday 05 April 2009 15:17:24 Chris Pratt wrote:
> Sorry, I tried to make it clear that the optional attribute would be
> available to intrinsically denote load order without imposing any
> all-or-nothing dependency. Basically the point is to tell struts that the
> requirement is "if you want Convention to be able to use OSGi, check to see
> if it's available before loading Convention". That would not make OSGi a
> required dependency of Convention, just an optional ability.
> (*Chris*)
>
You were clear enough, by the time I read Musachy's response, I had forgotten
about the "optional." I think the thing right now is that up until now, all
plugins have avoided interdependencies and related problems. A simple solution
to guarantee one plugin loads before another is enough, but if you want to
enhance it, feel free and post it in JIRA and we'll likely apply it.
-Wes
--
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: plugin loading order
Posted by Chris Pratt <th...@gmail.com>.
Sorry, I tried to make it clear that the optional attribute would be
available to intrinsically denote load order without imposing any
all-or-nothing dependency. Basically the point is to tell struts that the
requirement is "if you want Convention to be able to use OSGi, check to see
if it's available before loading Convention". That would not make OSGi a
required dependency of Convention, just an optional ability.
(*Chris*)
On Sun, Apr 5, 2009 at 10:24 AM, Wes Wannemacher <we...@wantii.com> wrote:
> The other part of that is that Conventions and OSGi do not "depend" on each
> other. This load order is necessary to make the two play nice, but I'd hate
> to
> be forced to use OSGi when using Conventions or vice versa because of a
> dependency that is unnecessary. For cases like this, there is either the
> choice of using a number or a generic high/low priority... I like Musachy's
> idea, simple and flexible, but we can enhance later if a use-case arises.
>
> -Wes
>
> On Sunday 05 April 2009 12:58:13 Musachy Barroso wrote:
> > yeah I thought about that, but I would rather keep it simple. So far
> > this is the only case where I have needed loading order, and I don't
> > think it will be common at all.
> >
> > musachy
> >
> > On Sun, Apr 5, 2009 at 2:43 AM, Chris Pratt <th...@gmail.com>
> wrote:
> > > Wouldn't it be better to describe the interdependencies of the plug-ins
> > > and let struts build a directed graph to automatically load them in the
> > > proper order. Otherwise, someone is going to put plugin1 at order=5
> and
> > > plugin2 at order=6 then plugin3 will come along and need to be in
> > > between. There would no reason that the dependencies would "have" to
> be
> > > requirements, some of the dependencies could be "soft" (i.e. If the
> > > spring libraries are available, they're a soft dependency of struts,
> > > meaning they should be loaded first). Then you would have something
> more
> > > like this:
> > >
> > > In convention:
> > >
> > > <dependencies>
> > > <dependency optional="true">OSGi</dependency>
> > > <dependencies>
> > >
> > > (*Chris*)
> > >
>
> --
>
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
Re: plugin loading order
Posted by Wes Wannemacher <we...@wantii.com>.
The other part of that is that Conventions and OSGi do not "depend" on each
other. This load order is necessary to make the two play nice, but I'd hate to
be forced to use OSGi when using Conventions or vice versa because of a
dependency that is unnecessary. For cases like this, there is either the
choice of using a number or a generic high/low priority... I like Musachy's
idea, simple and flexible, but we can enhance later if a use-case arises.
-Wes
On Sunday 05 April 2009 12:58:13 Musachy Barroso wrote:
> yeah I thought about that, but I would rather keep it simple. So far
> this is the only case where I have needed loading order, and I don't
> think it will be common at all.
>
> musachy
>
> On Sun, Apr 5, 2009 at 2:43 AM, Chris Pratt <th...@gmail.com> wrote:
> > Wouldn't it be better to describe the interdependencies of the plug-ins
> > and let struts build a directed graph to automatically load them in the
> > proper order. Otherwise, someone is going to put plugin1 at order=5 and
> > plugin2 at order=6 then plugin3 will come along and need to be in
> > between. There would no reason that the dependencies would "have" to be
> > requirements, some of the dependencies could be "soft" (i.e. If the
> > spring libraries are available, they're a soft dependency of struts,
> > meaning they should be loaded first). Then you would have something more
> > like this:
> >
> > In convention:
> >
> > <dependencies>
> > <dependency optional="true">OSGi</dependency>
> > <dependencies>
> >
> > (*Chris*)
> >
--
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: plugin loading order
Posted by Musachy Barroso <mu...@gmail.com>.
yeah I thought about that, but I would rather keep it simple. So far
this is the only case where I have needed loading order, and I don't
think it will be common at all.
musachy
On Sun, Apr 5, 2009 at 2:43 AM, Chris Pratt <th...@gmail.com> wrote:
> Wouldn't it be better to describe the interdependencies of the plug-ins and
> let struts build a directed graph to automatically load them in the proper
> order. Otherwise, someone is going to put plugin1 at order=5 and plugin2 at
> order=6 then plugin3 will come along and need to be in between. There would
> no reason that the dependencies would "have" to be requirements, some of the
> dependencies could be "soft" (i.e. If the spring libraries are available,
> they're a soft dependency of struts, meaning they should be loaded first).
> Then you would have something more like this:
>
> In convention:
>
> <dependencies>
> <dependency optional="true">OSGi</dependency>
> <dependencies>
>
> (*Chris*)
>
> On Sat, Apr 4, 2009 at 6:50 PM, Musachy Barroso <mu...@gmail.com> wrote:
>
>> I have been trying a few different ways to get the Convention plugin
>> to work with the OSGi plugin, and there are some hacks that can be
>> done but I don't like them. I want to implement (I actually have it
>> implemented it already somewhere) a simple way for the config files to
>> specify a relative order of loading. This way I can at least make sure
>> that certaing plugins are loaded before others. It would look like
>> this in the xml:
>>
>> OSGi:
>> <struts loadOrder="10">...</struts>
>>
>> Convention:
>> <struts loadOrder="20">...</struts>
>>
>> With this in place, we can enable some sort of communication between
>> plugins, by adding common interfaces to core. Any thoughts?
>>
>> musachy
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: plugin loading order
Posted by Chris Pratt <th...@gmail.com>.
Wouldn't it be better to describe the interdependencies of the plug-ins and
let struts build a directed graph to automatically load them in the proper
order. Otherwise, someone is going to put plugin1 at order=5 and plugin2 at
order=6 then plugin3 will come along and need to be in between. There would
no reason that the dependencies would "have" to be requirements, some of the
dependencies could be "soft" (i.e. If the spring libraries are available,
they're a soft dependency of struts, meaning they should be loaded first).
Then you would have something more like this:
In convention:
<dependencies>
<dependency optional="true">OSGi</dependency>
<dependencies>
(*Chris*)
On Sat, Apr 4, 2009 at 6:50 PM, Musachy Barroso <mu...@gmail.com> wrote:
> I have been trying a few different ways to get the Convention plugin
> to work with the OSGi plugin, and there are some hacks that can be
> done but I don't like them. I want to implement (I actually have it
> implemented it already somewhere) a simple way for the config files to
> specify a relative order of loading. This way I can at least make sure
> that certaing plugins are loaded before others. It would look like
> this in the xml:
>
> OSGi:
> <struts loadOrder="10">...</struts>
>
> Convention:
> <struts loadOrder="20">...</struts>
>
> With this in place, we can enable some sort of communication between
> plugins, by adding common interfaces to core. Any thoughts?
>
> musachy
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
Re: plugin loading order
Posted by Wes Wannemacher <we...@wantii.com>.
On Saturday 04 April 2009 21:50:22 Musachy Barroso wrote:
> I have been trying a few different ways to get the Convention plugin
> to work with the OSGi plugin, and there are some hacks that can be
> done but I don't like them. I want to implement (I actually have it
> implemented it already somewhere) a simple way for the config files to
> specify a relative order of loading. This way I can at least make sure
> that certaing plugins are loaded before others. It would look like
> this in the xml:
>
> OSGi:
> <struts loadOrder="10">...</struts>
>
> Convention:
> <struts loadOrder="20">...</struts>
>
> With this in place, we can enable some sort of communication between
> plugins, by adding common interfaces to core. Any thoughts?
>
> musachy
I don't see a problem with that, I would assume a default of something like 99
if the struts-plugin.xml doesn't specify it.
--
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org