These are good and relevant points. I have also put a lot of time (and significant personal money last year!) into Brix projects. It does seem to be a shame for it to get stuck, but of course every contributor will have requirements they need satisfied in order to contribute. OSGi, which started as a fascination for me at one point, has become a requirement for me with new projects that I start.
There are a lot of nuances to my position about it, including that it should not be impossible to use Brix without an OSGi container, but at the same time, there seemed to be enough temporal momentum against modular programming architecture in the larger Wicket community last year that I kind of gave up.
I think the difference in Brix versus Wicket though is there should be far more opportunity for people to contribute and make a difference. Open source projects with little or no activity have no business rejecting changes when it would be easier to just fork the project and pull the rare changes from upstream when they happen. Since few believe forking is a good thing, I hope anyone would find that it's a good time to get involved with making the changes they wish to see in Brix and have their changes accepted without hesitation. Github is of course the primary facilitator in making these changes with complete attribution, and recent changes by Dan Simko were accepted quickly as a point of reference.
Note that any investment that one makes in an OSS project is going to be enhanced by unit tests covering some large percentage of the code. It would be sad to watch a revival of the code base and a lot of investment in it, only to find that it became unstable over time and people's investments were less effective than they might otherwise have been.
As far as implications of OSGi, it's better thought of as a classloading and runtime linkage architecture only. As such, once bundles are loaded, OSGi gets out of the way and does not interfere with the requirements of one's architecture, which as you point out may require synchronization for threading. In other words, it's not possible for OSGi to introduce performance costs for any runtime configuration that is only available in straight Java (without OSGi). Whether OSGi is introduced is an open question though. If I were to do it, I would do it such that it is not a requirement for Brix to run, and the runtime behavior in those cases would lose runtime loading functionality. I think that's a big deal, others clearly would not. As it stands today, it is not implemented and you can develop without thinking about it.
Hope that helps,
Brian
> --
> You received this message because you are subscribed to the Google Groups "brix-cms-discuss" group.
> To post to this group, send email to brix-cms...@googlegroups.com.
> To unsubscribe from this group, send email to brix-cms-discu...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/brix-cms-discuss?hl=en.
>
On Wed, Feb 29, 2012 at 12:00 AM, D S <wick...@gmail.com> wrote:
> Hello guys,
>
> from my point of view is most important to finish migrating Brix to Wicket
> 1.5. There is still a lot of mess in core classes like BrixRequestMapper,
> BrixNodePageUrlMapper, etc.
> Currently I am trying to solve issue that
> org.apache.wicket.settings.IPageSettings#setRecreateMountedPagesAfterExpiry(true)
> is not working. And I am afraid that without Igor's (or other core
> developer's) hands it is almost impossible.
'true' is the default value. Yesterday someone reported that he
experience a problem with it - a Link cannot be found after session
expiration. Were that you ?
Create a quickstart and attach it to Wicket's Jira. it should be easy
to debug it.
I'll try to migrate Brix to Wicket 6.0.
Then you can backport any improvements which are not directly related
to 6.0 to 1.5.
Can you describe the problem in more details or explain how to
reproduce it with the demo app ?
2012/2/29 Korbinian <korbini...@googlemail.com>:
> Hello DS,
>
> is this happening with the latest master branch from
> https://github.com/brix-cms/brix-cms/commits/master ?
yes
>
> Because there was a commit 2 months ago for a page-expiry bug:
> https://github.com/brix-cms/brix-cms/commit/da536af7d28aa086f5fd76bd3b73617605fcf150
Before this commit you got some other exception (maybe NPE, I don't
remember) and now you get pageexpiredexception. I know it because this
is my commit :)
>
> As I suggested above, we need certain points to go through and also
> make a new beta cycle where we can fix problems like these. I know
> that wicket 1.4 and 1.5 have sometimes problems with the expiration of
> pages, but I think these can be solved as the wicket core devs are
> very eager to catch those buggers. My aim is also in long term to lock
> brixCMS main-releases to wicket-main releases so both prohjects
> benefit more.
>
> However, before I will start any work on this, I want a definitive
> saying from the community/ users if they want my path or not :)
I fully agree with your first and second points from your first email.
:D sorry for confusing. I am using danis...@gamil.com for brix,
wicket, jackrabbit, scala conferences and wick...@gmail.com for
personal emails and brix conference and I have a little bit hockey in
it sometimes. My name is Dan Simko and "danisevsky" is nick from
childhood.
2012/2/29 Martin Grigorov <martin....@gmail.com>:
cheers,
-igor
I've set Brix's version to 6.0-SNAPSHOT as well.
Do you want me to pull this in wicket6 branch or we will make a new
branch for Brix+Wicket1.5 (ver. 1.3.0) and merge this in master ?
Cheers, Brian
I'm OK. I'll have to work with wicket-cdi in Wicket 6.0 anyway.
What functionalities of CDI you need in Brix ?
> Point 3 needs someone who is OSGI aware for the overlook what problems
> are a.t.m and what should be done with regards to osgi - at least the
> current synchronized registry *has* to go unsynchronized for
> performance;
I thought you said the synchronized registry was unrelated to OSGi?
> Question to all: do you see a problem in requiring CDI in BrixCMS?
Can you elaborate on what would be affected and some of the benefits?
Brian
>> Question to all: do you see a problem in requiring CDI in BrixCMS?
>
> Can you elaborate on what would be affected and some of the benefits?
I should have added, if a requirement of Brix is that it can run without OSGi, then we need to make sure that any CDI configuration can also run both with and without OSGi.
Who knows, it might be easier with CDI, I'm just trying to make sure we don't overlook anything. :-)
for example, one may be tempted to use cdi instead of brix's registry.
for example looping over all tile factories in cdi can be done like
this:
@Inject Instance<TileFactory> factories;
...
for (TileFactory factory:factories) { .. }
however, a cdi context, like spring and many other ioc containers is
not built around the idea that modules/jars can come and go, therefore
it is fundamentally incompatible with osgi. ie, one cannot unload a
jar from a cdi context. cdi builds all metadata on boot and caches it.
so be cognizant of this impedance mismatch when tweaking brix to use
cdi, because i do not think any cool meta-data discovery facilities
can be used.
-igor
The registry is something that has been there since well before I started working on the project. So it's definitely not in there "for OSGi". I haven't scrutinized the code, but it sounds like a misfeature if a synchronization is happening on every page load.
Such synchronization will be necessary when modifying what plugins and tiles are available, the modifications will happen extremely rarely on a relative basis. For instance, I change/add/update plugins to Confluence / Jira once every several months on average. On a system under active development, the updates would coincide with a release schedule, typically two weeks plus any bug fix releases. Millions of pages could be served in that amount of time.
As a bundle is being changed, the container lifecycle would trigger a BundleListener, which would modify the registry / cache as appropriate. Those blocks of changes would need to be synchronized.
Automatic CDI injection may not be possible with any component that has the potential to change because once the component is injected into a bean, the reference is cached for the lifetime of the bean. Not having looked at org.glassfish::osgi-cdi-api, I don't know if proxies for services are injected that manage the dynamic nature of the referenced service. If it does, that would make the changes a lot cleaner throughout the code.
One of the nice things about OSGi is we can have multiple different versions of the same library available by version number. If plugin references from pages included version numbers they were created with, a repository would not have to be completely upgraded before a backwards-incompatible plugin could be used. If that were the case, plugin resolution would match this version number against the ranges provided by loaded plugins and the best match would be chosen, without having to upgrade the entire repository for any incompatible plugin change.
> Regarding this problem I can think of 2 possible solutions:
>
> -> use CDI inside brix and let it be accessible via CDI for non OSGI
> environments while OSGI environments should be able to access it via a
> stub reference (e.g.: CurrentBrixRequest.get().getCache() - similar to
> the BrixPageParemeters.get());
>
> -> ignore OSGI and instead aim for JIGSAW later on as it can't ignore
> CDI as both are part of upcoming spec (would be a big impact and be
> possible in about 1-2 years from now earliest as we need Java8 at
> least);
Well, of course the third is not to use CDI at all.
> True, but at the cost of future performance enhancement and complexity
> reduction
How complex would it be to create a dynamic runtime loaded module system for plugins? Could it be done more easily in some other way with less complexity?
In general, performance won't be affected by CDI. DI is an architectural pattern, not a performance improvement. As a pattern, it does reduce complexity, but more by creating a standard pattern for object aggregation, not because the patterns that DI promotes could not be done without CDI or a container that implements it like Spring. If developers write more efficient code because formalized DI forces them to, it's a little hard to argue that CDI was the source of the performance enhancement.
It's all semantics, I just want to make sure we're talking about the same thing and fill in any gaps I might have along the way.
Thus, when a static Brix instance is loaded inside an OSGi container, it does so exactly like it is done with a non-OSGi container and the lifecycle of the Brix instance is indistinguishable. Classes ask the classloader where to resolve a reference and the transitive closure of linkages are resolved. There is no dependency by any class on org.osgi.* from any class in a static Brix instance and CDI would work fine.
The problem with annotated DI references is they are *only* resolved and injected by the DI container when a service is loaded. Unless there is some hotshot dynamic proxy voodoo going on with the injected dependencies, a problem occurs when a service is dynamically unloaded because now you have a stale reference to an unloaded OSGi service sitting in some other service.
Note that an @ApplicationScoped injection is probably not going to cause any problem if it is never unloaded. I don't see why that would require different APIs, but differences in how Brix is bootstrapped between static and dynamic classpathing is probably going to be required.
The key to me is what classes depend on org.osgi.*. The implementation needs to have strong containment for these compile-time dependencies to a small section of code (not plugins). If we can pull that off, we should be good.
For my part in this, I am not against CDI. Quite to the contrary it would may well be a benefit for deploying OSGi.
> I somehow fear we come too close to reinventing OSGI at some
> point...
Exactly my point.
I just pushed my 'wicket6' branch to
https://github.com/brix-cms/brix-cms/tree/wicket6.
About OSGi+CDI: I guess you are aware of PAX-Wicket
(https://github.com/ops4j/org.ops4j.pax.wicket). It provides
integrations with Aries Blueprint and SpringDM. I guess it wont be
hard to add yet another integration for CDI. Andreas PIeber is
subscribed here so he can help with anything related to PAX.
Basically implementing CDI iteself wouldn't be too hard. Everything
required therefore should be already available in pax-wicket. I see
ways bigger problems in the conceptional planning of the integration
instead of the real implementation. For example: I assume you would
like to source the beans directly from the OSGi registry? From spring
and blueprint? An problem here (independent of the source) is that
osgi does not know any concept of stateful beans. There is no concept
to create new instances of services for each injection. Therefore
we'll also need to add factories here... Just to name one of (as I
assume) many problems.
Kind regards,
Andreas
Yes. The transition to 6.0 should be much easier than 1.4->1.5.
Roadmap: https://cwiki.apache.org/confluence/display/WICKET/Wicket+6.0+Roadmap
Migration: https://cwiki.apache.org/confluence/x/oayoAQ
I'm moving some more classes around atm to make Wicket more friendly
for OSGi users.
Kind regards,
Andreas
Thx for the pointer Martin.
Kind regards,
Andreas