You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lecharny <el...@gmail.com> on 2011/05/16 18:31:18 UTC

Experiment about extension points OSGi/ClassLoading initialization

Hi guys,

just to inform you that I created a branc 
(https://svn.apache.org/repos/asf/directory/shared/branches/shared-osgi) 
to play with some of the ideas around using a class loader when there is 
no OSGi container.

I just implemented the controls loading atm. What I did is that I 
defined a System property (called default.controls) listing the controls 
to be loaded by the StandaloneLdapApiService class. I still have to do 
the same thing for the other elements. Btw, it won't work when running 
tests in eclipse, because the system property won't be set.

Here is what looks like the pom.xml now :

<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<configuration>
<systemPropertyVariables>
<default.controls>
               
org.apache.directory.shared.ldap.codec.controls.cascade.CascadeFactory,
               
org.apache.directory.shared.ldap.codec.controls.manageDsaIT.ManageDsaITFactory,
               
org.apache.directory.shared.ldap.codec.controls.search.entryChange.EntryChangeFactory,
               
org.apache.directory.shared.ldap.codec.controls.search.pagedSearch.PagedResultsFactory,
               
org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory,
               
org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory
</default.controls>
<extra.controls>
</extra.controls>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: Experiment about extension points OSGi/ClassLoading initialization

Posted by Alex Karasulu <ak...@apache.org>.
Hi Emmanuel,

On Mon, May 16, 2011 at 7:31 PM, Emmanuel Lecharny <el...@gmail.com>wrote:

> Hi guys,
>
> just to inform you that I created a branc (
> https://svn.apache.org/repos/asf/directory/shared/branches/shared-osgi) to
> play with some of the ideas around using a class loader when there is no
> OSGi container.
>

Thanks for the heads up.


> I just implemented the controls loading atm. What I did is that I defined a
> System property (called default.controls) listing the controls to be loaded
> by the StandaloneLdapApiService class. I still have to do the same thing for
> the other elements. Btw, it won't work when running tests in eclipse,
> because the system property won't be set.
>
>
I know you hate this too: regarding the tests not working in eclipse due to
the need to set a system property.

There's got to be a slick way we can enable a zero configuration default
setup to avoid having to set these damn system properties. Only on
exceptional cases should we have to use the system property.


> Here is what looks like the pom.xml now :
>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-surefire-plugin</artifactId>
> <groupId>org.apache.maven.plugins</groupId>
> <configuration>
> <systemPropertyVariables>
> <default.controls>
>
>  org.apache.directory.shared.ldap.codec.controls.cascade.CascadeFactory,
>
>  org.apache.directory.shared.ldap.codec.controls.manageDsaIT.ManageDsaITFactory,
>
>  org.apache.directory.shared.ldap.codec.controls.search.entryChange.EntryChangeFactory,
>
>  org.apache.directory.shared.ldap.codec.controls.search.pagedSearch.PagedResultsFactory,
>
>  org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory,
>
>  org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory
> </default.controls>
> <extra.controls>
> </extra.controls>
> </systemPropertyVariables>
>

OK I see these are the implementations to class load dynamically. You're
setting up the system property to configure they're load.

Sure would be nice to have a discovery mechanism for this and not have to
deal with eclipse blowing chunks.

Regards,
Alex

Re: Experiment about extension points OSGi/ClassLoading initialization

Posted by Alex Karasulu <ak...@apache.org>.
On Mon, May 16, 2011 at 9:36 PM, Kiran Ayyagari <ka...@apache.org>wrote:

> can we use a set of package names as input rather than individual
> class names. I know it is a bit more work, but makes is a lot easier
> to
> configure and less input statements.
>
>
+1


> not very urgent to have it now, we can change the way controls are
> detected later, just wanted to know if there are any known limitations
> that prevent
> using package names.
>
>
Don't think there should be issues with this. Basically we can search the
package to see if there are classes implementing the required interfaces.

Regards,
-Alex

Re: Experiment about extension points OSGi/ClassLoading initialization

Posted by Kiran Ayyagari <ka...@apache.org>.
can we use a set of package names as input rather than individual
class names. I know it is a bit more work, but makes is a lot easier
to
configure and less input statements.

not very urgent to have it now, we can change the way controls are
detected later, just wanted to know if there are any known limitations
that prevent
using package names.

On Mon, May 16, 2011 at 10:01 PM, Emmanuel Lecharny <el...@gmail.com> wrote:
> Hi guys,
>
> just to inform you that I created a branc
> (https://svn.apache.org/repos/asf/directory/shared/branches/shared-osgi) to
> play with some of the ideas around using a class loader when there is no
> OSGi container.
>
> I just implemented the controls loading atm. What I did is that I defined a
> System property (called default.controls) listing the controls to be loaded
> by the StandaloneLdapApiService class. I still have to do the same thing for
> the other elements. Btw, it won't work when running tests in eclipse,
> because the system property won't be set.
>
> Here is what looks like the pom.xml now :
>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-surefire-plugin</artifactId>
> <groupId>org.apache.maven.plugins</groupId>
> <configuration>
> <systemPropertyVariables>
> <default.controls>
>
>  org.apache.directory.shared.ldap.codec.controls.cascade.CascadeFactory,
>
>  org.apache.directory.shared.ldap.codec.controls.manageDsaIT.ManageDsaITFactory,
>
>  org.apache.directory.shared.ldap.codec.controls.search.entryChange.EntryChangeFactory,
>
>  org.apache.directory.shared.ldap.codec.controls.search.pagedSearch.PagedResultsFactory,
>
>  org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory,
>
>  org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory
> </default.controls>
> <extra.controls>
> </extra.controls>
> </systemPropertyVariables>
> </configuration>
> </plugin>
> </plugins>
> </build>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>



-- 
Kiran Ayyagari