You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Göktürk Gezer <go...@gmail.com> on 2011/10/10 18:38:25 UTC
[ApacheDS 2.0] OSGI, Implementing modularity
Package conflicts are almost completely resolved. So we can begin
implementing OSGI modularity into ApacheDS. To pass through the list again,
we must do following:
* 3.th party dependencies must be bundleized. Apache commons that we are
dependent on are already osgi bundles. Some of the remainings are already
bundleized(antlr, slf4j, log4j, mina-core). Some of them are just jar files,
no POM supplied. We must transform and maintain the nonOSGI dependencies by
ourselves. There are not much of them. Bouncycastle is somewhat problematic
with maven-bundle-plugin. I'll do some workaround for it specially.
* Shared libraries are already OSGI bundles, but their usage of OSGI
services in their BundleActivator classes are not designed for OSGI
dynamism. They assume the ApacheDS is one big megabundle(it is now). We're
going to handle that problem with OSGI Start Levels until we start
implementing service layer using IPojo.
* All submodules of ApacheDS will be modified to generate OSGI bundles.
* The existing apachads-service module can be left here, but we'll need new
service implementation that utilize Apache Karaf. New project will create
custom Karaf distribution, which will has all dependencies and all core
bundles to start ApacheDS. And we will custom tailor Karaf's configuration
for our needs.
* At that stage we'll have around 65 bundle to start ApacheDS on OSGI. For
people using our custom Karaf distribution, this will not be a problem. But
for others who want to install ApacheDS on their own, we must provide an
easy mechanism to deploy the ApacheDS without messing with 65 bundles
directly. We'll already have a Karaf Feature Descriptor at that stage for
Karaf users. But we must also provide an OBR repository for our builds.As
abridged version, OBR repository is just an xml file, keeps dependency
information between bundles, so clients can deploy one core bundle using
OBR, and then its dependencies are automatically resolved and deployed by
OBR agent. If Apache have some central OBR repository, we can use that?
* After we completed above steps, we can start implementing services using
IPojo.
Lets talk more about it and elaborate the details. I'm on those steps,
starting tomorrow. I'll let you know the current status regularly.
Regards,
Gokturk
Re: [ApacheDS 2.0] OSGI, Implementing modularity
Posted by Alex Karasulu <ak...@apache.org>.
On Mon, Oct 17, 2011 at 7:02 PM, Pierre-Arnaud Marcelot <pa...@marcelot.net>wrote:
> Hi Göktürk,
>
> On 17 oct. 2011, at 17:57, Göktürk Gezer wrote:
>
> Hi,
>
> On Mon, Oct 17, 2011 at 6:52 PM, Kiran Ayyagari <ka...@apache.org>wrote:
>
>> thanks Gokturk for the details, have another q. what will happen if I
>> try to run the server in another OSGi runtime? will the server still
>> start its own
>> OSGi runtime?
>
>
> I just embedded Felix as debug platform. Custumization i've done on Felix
> is only configuration and management details. By deploying the same set of
> bundles into another Framework, you can make it run on it too.
>
>
> In the end, we'll probably need to update the way we start the server in
> the 'apacheds-service' project and start Felix or Karaf there.
>
Exactly! Here instead of running it as a standalone application from the
shell we will launch Karaf (better) or Felix with ApacheDS feature.
--
Best Regards,
-- Alex
Re: [ApacheDS 2.0] OSGI, Implementing modularity
Posted by Pierre-Arnaud Marcelot <pa...@marcelot.net>.
Hi Göktürk,
On 17 oct. 2011, at 17:57, Göktürk Gezer wrote:
> Hi,
>
> On Mon, Oct 17, 2011 at 6:52 PM, Kiran Ayyagari <ka...@apache.org> wrote:
> thanks Gokturk for the details, have another q. what will happen if I
> try to run the server in another OSGi runtime? will the server still
> start its own
> OSGi runtime?
>
> I just embedded Felix as debug platform. Custumization i've done on Felix is only configuration and management details. By deploying the same set of bundles into another Framework, you can make it run on it too.
In the end, we'll probably need to update the way we start the server in the 'apacheds-service' project and start Felix or Karaf there.
> For that purpose we can also create a project that only copies all artifacts and dependencies into some directory.
Indeed, that's a thing we'll to build and distribute aside the existing ApacheDS installers.
Regards,
Pierre-Arnaud
> Regards,
> Gokturk
Re: [ApacheDS 2.0] OSGI, Implementing modularity
Posted by Göktürk Gezer <go...@gmail.com>.
Hi,
On Mon, Oct 17, 2011 at 6:52 PM, Kiran Ayyagari <ka...@apache.org>wrote:
> thanks Gokturk for the details, have another q. what will happen if I
> try to run the server in another OSGi runtime? will the server still
> start its own
> OSGi runtime?
I just embedded Felix as debug platform. Custumization i've done on Felix is
only configuration and management details. By deploying the same set of
bundles into another Framework, you can make it run on it too.
For that purpose we can also create a project that only copies all artifacts
and dependencies into some directory.
Regards,
Gokturk
Re: [ApacheDS 2.0] OSGI, Implementing modularity
Posted by Kiran Ayyagari <ka...@apache.org>.
thanks Gokturk for the details, have another q. what will happen if I
try to run the server in another OSGi runtime? will the server still
start its own
OSGi runtime?
On Mon, Oct 17, 2011 at 11:42 AM, Göktürk Gezer <go...@gmail.com> wrote:
> Hi Kiran, Pierre
> Answer depends on which level we'll use OSGI. If we'll only support OSGI,
> the answer is yes. If we'll use OSGI as our fuel to make ApacheDS
> extendable, the answer is no.
> But only supporting is not a good decision for ApacheDS. As OSGI support, we
> can only separate 3.th party dependencies for now and make ApacheDS
> megabundle, so that users can install ApacheDS on their OSGI frameworks
> without causing library dependency problems. This can already be implemented
> in no time.
> However as we use OSGI to actually make ApacheDS extendable , we have to use
> other features of OSGI other than modularity. And that makes us dependent on
> OSGI Framework. Any other solution for extendability other than OSGI will
> also broke your current way of running ApacheDS.
> So, OSGI support is something meaningful for libraries only. For an
> application like ApacheDS, we must sit on top of OSGI. That will change our
> way of deploying, installing and running ApacheDS.
>
> Regards,
> Gokturk
>
> On Mon, Oct 17, 2011 at 5:16 PM, Pierre-Arnaud Marcelot <pa...@marcelot.net>
> wrote:
>>
>> Hi Kiran,
>>
>> That's a very good and important question.
>>
>> It would be cool if we could do the same thing we did with the API
>> (Shared) which is OSGI-ready but also works perfectly as a set of simple
>> (good old) jar files.
>>
>> Regards,
>> Pierre-Arnaud
>>
>> On 17 oct. 2011, at 16:10, Kiran Ayyagari wrote:
>>
>> > Is it possible to start the server without using karaf at all after
>> > complete OSGification of the server?
>> > put it in another way, would it be possible to start the server using
>> > the existing apacheds.sh script, without loading karaf?
>> >
>> >
>> > On Mon, Oct 17, 2011 at 1:04 AM, Göktürk Gezer <go...@gmail.com>
>> > wrote:
>> >> Hi Emmanuel,
>> >> I attached "custom felix framework distribution" patch at
>> >> #DIRSERVER-1669 .
>> >> This custom framework will let us run and debug our OSGI based codes
>> >> inside
>> >> Eclipse. To use it properly, there are two additional steps:
>> >> ...after mvn install, mvn eclipse:eclipse and importing projects into
>> >> Eclipse
>> >> 1-) Add apache-felix/bin/felix.jar to project's Build Path ( to use
>> >> ApacheDS-OSGI.launcher )
>> >> 2-) In apache-felix project's Build Path, add all projects in
>> >> workspace as
>> >> project dependencies. ( to enable source viewing while debugging
>> >> (requires
>> >> Eclipse restart) )
>> >> With this in our hands, we can work on OSGI faster than ever.
>> >>
>> >> Regards,
>> >> Göktürk
>> >
>> >
>> >
>> > --
>> > Kiran Ayyagari
>>
>
>
--
Kiran Ayyagari
Re: [ApacheDS 2.0] OSGI, Implementing modularity
Posted by Göktürk Gezer <go...@gmail.com>.
Hi Kiran, Pierre
Answer depends on which level we'll use OSGI. If we'll only support OSGI,
the answer is yes. If we'll use OSGI as our fuel to make ApacheDS
extendable, the answer is no.
But only supporting is not a good decision for ApacheDS. As OSGI support, we
can only separate 3.th party dependencies for now and make ApacheDS
megabundle, so that users can install ApacheDS on their OSGI frameworks
without causing library dependency problems. This can already be implemented
in no time.
However as we use OSGI to actually make ApacheDS extendable , we have to use
other features of OSGI other than modularity. And that makes us dependent on
OSGI Framework. Any other solution for extendability other than OSGI will
also broke your current way of running ApacheDS.
So, OSGI support is something meaningful for libraries only. For an
application like ApacheDS, we must sit on top of OSGI. That will change our
way of deploying, installing and running ApacheDS.
Regards,
Gokturk
On Mon, Oct 17, 2011 at 5:16 PM, Pierre-Arnaud Marcelot <pa...@marcelot.net>wrote:
> Hi Kiran,
>
> That's a very good and important question.
>
> It would be cool if we could do the same thing we did with the API (Shared)
> which is OSGI-ready but also works perfectly as a set of simple (good old)
> jar files.
>
> Regards,
> Pierre-Arnaud
>
> On 17 oct. 2011, at 16:10, Kiran Ayyagari wrote:
>
> > Is it possible to start the server without using karaf at all after
> > complete OSGification of the server?
> > put it in another way, would it be possible to start the server using
> > the existing apacheds.sh script, without loading karaf?
> >
> >
> > On Mon, Oct 17, 2011 at 1:04 AM, Göktürk Gezer <go...@gmail.com>
> wrote:
> >> Hi Emmanuel,
> >> I attached "custom felix framework distribution" patch at
> #DIRSERVER-1669 .
> >> This custom framework will let us run and debug our OSGI based codes
> inside
> >> Eclipse. To use it properly, there are two additional steps:
> >> ...after mvn install, mvn eclipse:eclipse and importing projects into
> >> Eclipse
> >> 1-) Add apache-felix/bin/felix.jar to project's Build Path ( to use
> >> ApacheDS-OSGI.launcher )
> >> 2-) In apache-felix project's Build Path, add all projects in workspace
> as
> >> project dependencies. ( to enable source viewing while debugging
> (requires
> >> Eclipse restart) )
> >> With this in our hands, we can work on OSGI faster than ever.
> >>
> >> Regards,
> >> Göktürk
> >
> >
> >
> > --
> > Kiran Ayyagari
>
>
Re: [ApacheDS 2.0] OSGI, Implementing modularity
Posted by Pierre-Arnaud Marcelot <pa...@marcelot.net>.
Hi Kiran,
That's a very good and important question.
It would be cool if we could do the same thing we did with the API (Shared) which is OSGI-ready but also works perfectly as a set of simple (good old) jar files.
Regards,
Pierre-Arnaud
On 17 oct. 2011, at 16:10, Kiran Ayyagari wrote:
> Is it possible to start the server without using karaf at all after
> complete OSGification of the server?
> put it in another way, would it be possible to start the server using
> the existing apacheds.sh script, without loading karaf?
>
>
> On Mon, Oct 17, 2011 at 1:04 AM, Göktürk Gezer <go...@gmail.com> wrote:
>> Hi Emmanuel,
>> I attached "custom felix framework distribution" patch at #DIRSERVER-1669 .
>> This custom framework will let us run and debug our OSGI based codes inside
>> Eclipse. To use it properly, there are two additional steps:
>> ...after mvn install, mvn eclipse:eclipse and importing projects into
>> Eclipse
>> 1-) Add apache-felix/bin/felix.jar to project's Build Path ( to use
>> ApacheDS-OSGI.launcher )
>> 2-) In apache-felix project's Build Path, add all projects in workspace as
>> project dependencies. ( to enable source viewing while debugging (requires
>> Eclipse restart) )
>> With this in our hands, we can work on OSGI faster than ever.
>>
>> Regards,
>> Göktürk
>
>
>
> --
> Kiran Ayyagari
Re: [ApacheDS 2.0] OSGI, Implementing modularity
Posted by Kiran Ayyagari <ka...@apache.org>.
Is it possible to start the server without using karaf at all after
complete OSGification of the server?
put it in another way, would it be possible to start the server using
the existing apacheds.sh script, without loading karaf?
On Mon, Oct 17, 2011 at 1:04 AM, Göktürk Gezer <go...@gmail.com> wrote:
> Hi Emmanuel,
> I attached "custom felix framework distribution" patch at #DIRSERVER-1669 .
> This custom framework will let us run and debug our OSGI based codes inside
> Eclipse. To use it properly, there are two additional steps:
> ...after mvn install, mvn eclipse:eclipse and importing projects into
> Eclipse
> 1-) Add apache-felix/bin/felix.jar to project's Build Path ( to use
> ApacheDS-OSGI.launcher )
> 2-) In apache-felix project's Build Path, add all projects in workspace as
> project dependencies. ( to enable source viewing while debugging (requires
> Eclipse restart) )
> With this in our hands, we can work on OSGI faster than ever.
>
> Regards,
> Göktürk
--
Kiran Ayyagari
Re: [ApacheDS 2.0] OSGI, Implementing modularity
Posted by Göktürk Gezer <go...@gmail.com>.
Hi Emmanuel,
I attached "custom felix framework distribution" patch at #DIRSERVER-1669 .
This custom framework will let us run and debug our OSGI based codes inside
Eclipse. To use it properly, there are two additional steps:
...after mvn install, mvn eclipse:eclipse and importing projects into
Eclipse
1-) Add apache-felix/bin/felix.jar to project's Build Path ( to use
ApacheDS-OSGI.launcher )
2-) In apache-felix project's Build Path, add all projects in workspace as
project dependencies. ( to enable source viewing while debugging (requires
Eclipse restart) )
With this in our hands, we can work on OSGI faster than ever.
Regards,
Göktürk
Re: [ApacheDS 2.0] OSGI, Implementing modularity
Posted by Göktürk Gezer <go...@gmail.com>.
Hi Stefan,
On Sat, Oct 15, 2011 at 9:07 PM, Stefan Seelmann <se...@apache.org>wrote:
> Hi Göktürk,
>
> can you please create a Jira issue and attach the patch there? That's
> the common way we handle contributions. When attaching the patch there
> is also a checkbox "Grant license to ASF for inclusion in ASF works"
> that you should check after you read and agreed to the license.
>
> Thanks,
> Stefan
>
>
I raised the issue attached the patch there.
Regards,
Gokturk
Re: [ApacheDS 2.0] OSGI, Implementing modularity
Posted by Stefan Seelmann <se...@apache.org>.
Hi Götürk,
can you please create a Jira issue and attach the patch there? That's
the common way we handle contributions. When attaching the patch there
is also a checkbox "Grant license to ASF for inclusion in ASF works"
that you should check after you read and agreed to the license.
Thanks,
Stefan
On Sat, Oct 15, 2011 at 4:57 PM, Göktürk Gezer <go...@gmail.com> wrote:
> Hi,
> All necessary project poms are modified to generate OSGI headers. Diff is
> attached.
> Both apacheds and shared modules are changed in a way that they export all
> of their local packages with corresponding parent's version number. I didn't
> specified "Private-Package" for any at that time, because its nonsense for
> now. We can specify them after finishing our OSGI stuff.
> As next step i will try to implement new apacheds-service-osgi project which
> will contain necessary eclipse descriptors to launch and debug ApacheDS on
> Felix Framework in Eclipse. I will most probably implement OSGI version of
> the service-builder for that purpose.
> Then custom karaf distribution will be added.
> Soon after these goals, we'll be able to implement Service Layer, and play
> with it easily.
>
> Regards,
> Gokturk
Re: [ApacheDS 2.0] OSGI, Implementing modularity
Posted by Göktürk Gezer <go...@gmail.com>.
Hi,
All necessary project poms are modified to generate OSGI headers. Diff is
attached.
Both apacheds and shared modules are changed in a way that they export all
of their local packages with corresponding parent's version number. I didn't
specified "Private-Package" for any at that time, because its nonsense for
now. We can specify them after finishing our OSGI stuff.
As next step i will try to implement new apacheds-service-osgi project which
will contain necessary eclipse descriptors to launch and debug ApacheDS on
Felix Framework in Eclipse. I will most probably implement OSGI version of
the service-builder for that purpose.
Then custom karaf distribution will be added.
Soon after these goals, we'll be able to implement Service Layer, and play
with it easily.
Regards,
Gokturk
Re: [ApacheDS 2.0] OSGI, Implementing modularity
Posted by Emmanuel Lecharny <el...@gmail.com>.
On 10/10/11 6:38 PM, Göktürk Gezer wrote:
> Package conflicts are almost completely resolved. So we can begin
> implementing OSGI modularity into ApacheDS. To pass through the list again,
> we must do following:
>
> * 3.th party dependencies must be bundleized. Apache commons that we are
> dependent on are already osgi bundles. Some of the remainings are already
> bundleized(antlr, slf4j, log4j, mina-core). Some of them are just jar files,
> no POM supplied. We must transform and maintain the nonOSGI dependencies by
> ourselves. There are not much of them. Bouncycastle is somewhat problematic
> with maven-bundle-plugin. I'll do some workaround for it specially.
We should check on Studio, lots of libs we are using in ADS are already
bundleized there.
Having a list of jars would help at this point.
>
> * Shared libraries are already OSGI bundles, but their usage of OSGI
> services in their BundleActivator classes are not designed for OSGI
> dynamism. They assume the ApacheDS is one big megabundle(it is now). We're
> going to handle that problem with OSGI Start Levels until we start
> implementing service layer using IPojo.
Ok
>
> * All submodules of ApacheDS will be modified to generate OSGI bundles.
Yes.
>
> * The existing apachads-service module can be left here, but we'll need new
> service implementation that utilize Apache Karaf. New project will create
> custom Karaf distribution, which will has all dependencies and all core
> bundles to start ApacheDS. And we will custom tailor Karaf's configuration
> for our needs.
Yes, that's a mandatory step.
>
> * At that stage we'll have around 65 bundle to start ApacheDS on OSGI. For
> people using our custom Karaf distribution, this will not be a problem. But
> for others who want to install ApacheDS on their own, we must provide an
> easy mechanism to deploy the ApacheDS without messing with 65 bundles
> directly. We'll already have a Karaf Feature Descriptor at that stage for
> Karaf users. But we must also provide an OBR repository for our builds.As
> abridged version, OBR repository is just an xml file, keeps dependency
> information between bundles, so clients can deploy one core bundle using
> OBR, and then its dependencies are automatically resolved and deployed by
> OBR agent. If Apache have some central OBR repository, we can use that?
Can't we create a bundle of bundles?
>
> * After we completed above steps, we can start implementing services using
> IPojo.
>
> Lets talk more about it and elaborate the details. I'm on those steps,
> starting tomorrow. I'll let you know the current status regularly.
Thanks a lot for handling those "details" !
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
Re: [ApacheDS 2.0] OSGI, Implementing modularity
Posted by Emmanuel Lecharny <el...@gmail.com>.
On 10/11/11 5:27 PM, Göktürk Gezer wrote:
> Hi,
>
> I bundelized all submodules of apacheds and shared properly. Temporarily
> pushed all dependencies into a new bundle and serving them from it.
>
> Unfortunately. the first problem arised. Interceptors are hardcoded into
> config.ldif file, and being load using reflection.
Yeah, we need to bundlezie them. That means create new projects for each
of them. Not really a big trouble though.
We will have more of such issues, for instance for schema elements.
> So OSGIfication broke
> that connection. I'm gonna handle that by using OSGI services (IPojo
> Components). So maybe we have to go parallel with both modularity and
> service interactions. If you have any new design idea for interceptors as
> first, just put it here and i'll deploy it too.
Se above. Not sure if we can do better.
> That kind of problems are likely to happen as we progress, so we must go
> into private branch for whole process.
That's an option. But we can also do that in the trunk, controlling that
the build is never broken as we change things. This is what Alex did
when h reorganized the code earlier this year. The only thing we have to
take care about is that we don't do big modifications aside.
The problem in doing all those big structural modifications in a branch
is taht it will be *very* painful to merge the branch back into trunk
later :/
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
Re: [ApacheDS 2.0] OSGI, Implementing modularity
Posted by Göktürk Gezer <go...@gmail.com>.
Hi,
I bundelized all submodules of apacheds and shared properly. Temporarily
pushed all dependencies into a new bundle and serving them from it.
Unfortunately. the first problem arised. Interceptors are hardcoded into
config.ldif file, and being load using reflection. So OSGIfication broke
that connection. I'm gonna handle that by using OSGI services (IPojo
Components). So maybe we have to go parallel with both modularity and
service interactions. If you have any new design idea for interceptors as
first, just put it here and i'll deploy it too.
That kind of problems are likely to happen as we progress, so we must go
into private branch for whole process.
Regards,
Gokturk