Hi all Following the ML I recently saw multiple questions about writing a custom partition so there seems to be an interest in this topic.
Now I'm just following Stefans (big thanks about this howto!) and hit on the needs to change the server.xml when adding a custom partition. I'd like to raise a discussion about this. Is it really needed to do this?! Isn't a new partition just a module to plug into an existing server? Wouldn't it be nice just to drop in the jar containing the custom partition and restart the server? No need to change any configurations? Why not let spring detecting all the existing partition modules for us? It could be nicely done as all partitions implements the same interface. So get all beans implementing this interaface and load them as partition. This way any partition module (=jar) contains its own definition. Adding the jar to the ds servers lib directory and restarting the server we be enough to get a new partition. See also springs ListableBeanFactory [1] or [2] [1] http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/beans/factory/ListableBeanFactory.html [2] http://forum.springframework.org/showthread.php?t=48066 Switching to such a module plug in way for partitions would it also make easy to create a maven archetype for creating a custom partition. WDOT? Regards Felix [EMAIL PROTECTED] schrieb: > > Page Edited : DIRxSBOX > <http://cwiki.apache.org/confluence/display/DIRxSBOX> : Draft - How to > write a simple custom partition for ApacheDS > <http://cwiki.apache.org/confluence/display/DIRxSBOX/Draft+-+How+to+write+a+simple+custom+partition+for+ApacheDS> <snip/> > Adding it to a server.xml file > > In order to use the partition in a standard installation of ApacheDS, we > simply add it to the /server.xml/ configuration. We have not used > annotations (xbean) to ease XML editing, so we have to provide a > "native" Spring bean. > > *server.xml* > > <spring:beans xmlns:spring="http://xbean.apache.org/schemas/spring/1.0" > xmlns:s="http://www.springframework.org/schema/beans" > xmlns="http://apacheds.org/config/1.0"> > > ... > <defaultDirectoryService ...> > ... > <partitions> > ... > <s:bean > id="helloPartition" > > class="org.apache.directory.samples.partition.hello.HelloWorldPartition"> > <s:property name="suffix" value="ou=helloWorld" /> > </s:bean> > </partitions> > ... > </defaultDirectoryService> > ... >
