@ -97,25 +90,8 @@ public class LdapServerBeanDefinitionParser implements BeanDefinitionParser {
@@ -97,25 +90,8 @@ public class LdapServerBeanDefinitionParser implements BeanDefinitionParser {
@ -123,25 +99,12 @@ public class LdapServerBeanDefinitionParser implements BeanDefinitionParser {
@@ -123,25 +99,12 @@ public class LdapServerBeanDefinitionParser implements BeanDefinitionParser {
suffix=OPT_DEFAULT_ROOT_SUFFIX;
}
partition.addPropertyValue("suffix",suffix);
ManagedSetpartitions=newManagedSet(1);
partitions.add(partition.getBeanDefinition());
Stringport=element.getAttribute(ATT_PORT);
if(!StringUtils.hasText(port)){
port=OPT_DEFAULT_PORT;
}
configuration.addPropertyValue("ldapPort",port);
// We shut down the server ourself when the app context is closed so we don't need
@ -151,8 +114,7 @@ public class LdapServerBeanDefinitionParser implements BeanDefinitionParser {
@@ -151,8 +114,7 @@ public class LdapServerBeanDefinitionParser implements BeanDefinitionParser {
@ -160,6 +122,7 @@ public class LdapServerBeanDefinitionParser implements BeanDefinitionParser {
@@ -160,6 +122,7 @@ public class LdapServerBeanDefinitionParser implements BeanDefinitionParser {
@ -73,6 +80,10 @@ public class ApacheDSContainer implements InitializingBean, DisposableBean, Life
@@ -73,6 +80,10 @@ public class ApacheDSContainer implements InitializingBean, DisposableBean, Life
setWorkingDirectory(newFile(apacheWorkDir));
}
server=newLdapServer();
server.setDirectoryService(service);
server.setTransports(newTcpTransport(port));
start();
}
@ -84,20 +95,6 @@ public class ApacheDSContainer implements InitializingBean, DisposableBean, Life
@@ -84,20 +95,6 @@ public class ApacheDSContainer implements InitializingBean, DisposableBean, Life
@ -112,37 +109,54 @@ public class ApacheDSContainer implements InitializingBean, DisposableBean, Life
@@ -112,37 +109,54 @@ public class ApacheDSContainer implements InitializingBean, DisposableBean, Life
@ -152,7 +166,29 @@ public class ApacheDSContainer implements InitializingBean, DisposableBean, Life
@@ -152,7 +166,29 @@ public class ApacheDSContainer implements InitializingBean, DisposableBean, Life
logger.info("Shutting down directory server ...");
try{
server.stop();
service.shutdown();
}catch(Exceptione){
logger.error("Shutdown failed",e);
return;
}
running=false;
if(workingDir.exists()){
logger.info("Deleting working directory "+workingDir.getAbsolutePath());
deleteDir(workingDir);
}
}
privatevoidimportLdifs()throwsException{
// Import any ldif files
Resource[]ldifs;
@ -166,51 +202,28 @@ public class ApacheDSContainer implements InitializingBean, DisposableBean, Life
@@ -166,51 +202,28 @@ public class ApacheDSContainer implements InitializingBean, DisposableBean, Life
// Note that we can't just import using the ServerContext returned
// from starting Apace DS, apparently because of the long-running issue DIRSERVER-169.