You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Alex Karasulu <ak...@apache.org> on 2007/03/01 07:50:46 UTC

Re: How to plug in custom Partition

Juergen,

Sorry to hear your woes regarding adding a new partition to ADS.  I whipped
together
a little example project in my sandbox to demonstrate how you can get a
custom
partition up and running within the server with the least functionality.

Take a look at this for now and let me know if it helps show you what's
going on.  I
will try to look at your problem once again tomorrow if the example does not
help.

Thanks,
Alex

On 2/28/07, Juergen Weber <we...@gmail.com> wrote:
>
> Hi,
>
> OK, I understand that my custom Partition should extend
> org.apache.directory.server.core.partition.AbstractPartition.
>
> But I am lacking a little to get it to run.
>
> I have added a
>   <bean id="myPartition" class="test.MyPartition">
>     <property name="name" value="test" />
>   </bean>
>
> the constructor gets called, my Eclipse breakpoint stops.
> But nothing more gets called, I assume
> init( DirectoryServiceConfiguration factoryCfg, PartitionConfiguration cfg
> )
> should be called, too, should it?
>
> I copyied and adapted the examplePartitionConfiguration from
> http://directory.apache.org/apacheds/1.0/14-basic-configuration-tasks.html
> but where is the connection between my PartitionConfiguration and the
> actual Partition code?
>
> Please do answer to
>
> http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=DIRxSRVx10&title=Implementing%20an%20alternative%20Backend&linkCreation=true&fromPageId=31355
> ;-)
>
> Thanks,
> Jürgen
>

Re: How to plug in custom Partition

Posted by Alex Karasulu <ak...@apache.org>.
Oooops forgot the URL to the example project:


http://svn.apache.org/viewvc/directory/sandbox/akarasulu/custom-partition/

On 3/1/07, Alex Karasulu <ak...@apache.org> wrote:
>
> Juergen,
>
> Sorry to hear your woes regarding adding a new partition to ADS.  I
> whipped together
> a little example project in my sandbox to demonstrate how you can get a
> custom
> partition up and running within the server with the least functionality.
>
> Take a look at this for now and let me know if it helps show you what's
> going on.  I
> will try to look at your problem once again tomorrow if the example does
> not help.
>
> Thanks,
> Alex
>
> On 2/28/07, Juergen Weber <we...@gmail.com> wrote:
> >
> > Hi,
> >
> > OK, I understand that my custom Partition should extend
> > org.apache.directory.server.core.partition.AbstractPartition.
> >
> > But I am lacking a little to get it to run.
> >
> > I have added a
> >   <bean id="myPartition" class=" test.MyPartition">
> >     <property name="name" value="test" />
> >   </bean>
> >
> > the constructor gets called, my Eclipse breakpoint stops.
> > But nothing more gets called, I assume
> > init( DirectoryServiceConfiguration factoryCfg, PartitionConfiguration
> > cfg )
> > should be called, too, should it?
> >
> > I copyied and adapted the examplePartitionConfiguration from
> >
> > http://directory.apache.org/apacheds/1.0/14-basic-configuration-tasks.html
> > but where is the connection between my PartitionConfiguration and the
> > actual Partition code?
> >
> > Please do answer to
> >
> > http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=DIRxSRVx10&title=Implementing%20an%20alternative%20Backend&linkCreation=true&fromPageId=31355
> > ;-)
> >
> > Thanks,
> > Jürgen
> >
>
>

Re: How to plug in custom Partition

Posted by Juergen Weber <we...@gmail.com>.
OK, I figured it out:

in server.xml add a PartitionConfiguration to
contextPartitionConfigurations by copying and adapting
examplePartitionConfiguration.

The trick is to use an subclass PartitionConfiguration that overwrites
the contextPartition attribute (which is JdbmPartition() in
PartitionConfiguration.java).

Thanks,
Jürgen

Re: How to plug in custom Partition

Posted by Juergen Weber <we...@gmail.com>.
Hi Alex,

I had figured out how to extend AbstractPartition, but I did not find
out, how to make the server aware of my Partition. Unfortunately your
repository does not show to add a custom partition to server.xml, does
it?
The constructor of my partition gets called, but I believe this is
Spring-only and the server does not really know my partition.

Thanks,
Juergen


On 3/1/07, Alex Karasulu <ak...@apache.org> wrote:
> Juergen,
>
> Sorry to hear your woes regarding adding a new partition to ADS.  I whipped
> together
> a little example project in my sandbox to demonstrate how you can get a
> custom
> partition up and running within the server with the least functionality.
>
> Take a look at this for now and let me know if it helps show you what's
> going on.  I
> will try to look at your problem once again tomorrow if the example does not
> help.
>
> Thanks,
> Alex
>
> On 2/28/07, Juergen Weber <we...@gmail.com> wrote:
> >
> > Hi,
> >
> > OK, I understand that my custom Partition should extend
> > org.apache.directory.server.core.partition.AbstractPartition.
> >
> > But I am lacking a little to get it to run.
> >
> > I have added a
> >   <bean id="myPartition" class="test.MyPartition">
> >     <property name="name" value="test" />
> >   </bean>
> >
> > the constructor gets called, my Eclipse breakpoint stops.
> > But nothing more gets called, I assume
> > init( DirectoryServiceConfiguration factoryCfg, PartitionConfiguration cfg
> > )
> > should be called, too, should it?
> >
> > I copyied and adapted the examplePartitionConfiguration from
> > http://directory.apache.org/apacheds/1.0/14-basic-configuration-tasks.html
> > but where is the connection between my PartitionConfiguration and the
> > actual Partition code?
> >
> > Please do answer to
> >
> > http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=DIRxSRVx10&title=Implementing%20an%20alternative%20Backend&linkCreation=true&fromPageId=31355
> > ;-)
> >
> > Thanks,
> > Jürgen
> >
>