public ApacheDSContainer(String root, String ldifs) throws Exception {
    this.ldifResources = ldifs;
    service = new DefaultDirectoryService();
    List<Interceptor> list = new ArrayList<Interceptor>();

    list.add(new NormalizationInterceptor());
    list.add(new AuthenticationInterceptor());
    list.add(new ReferralInterceptor());
    //        list.add( new AciAuthorizationInterceptor() );
    //        list.add( new DefaultAuthorizationInterceptor() );
    list.add(new ExceptionInterceptor());
    //       list.add( new ChangeLogInterceptor() );
    list.add(new OperationalAttributeInterceptor());
    //        list.add( new SchemaInterceptor() );
    list.add(new SubentryInterceptor());
    //        list.add( new CollectiveAttributeInterceptor() );
    //        list.add( new EventInterceptor() );
    //        list.add( new TriggerInterceptor() );
    //        list.add( new JournalInterceptor() );

    service.setInterceptors(list);
    partition = new JdbmPartition();
    partition.setId("rootPartition");
    partition.setSuffix(root);
    this.root = root;
    service.addPartition(partition);
    service.setExitVmOnShutdown(false);
    service.setShutdownHookEnabled(false);
    service.getChangeLog().setEnabled(false);
    service.setDenormalizeOpAttrsEnabled(true);
  }
  /**
   * Add a default partition to the server
   *
   * @param partitionId The partition Id
   * @param partitionDn The partition DN
   * @return The newly added partition
   * @throws Exception If the partition can't be added
   */
  private void createDefaultPartition() throws Exception {
    Partition partition = new JdbmPartition();
    partition.setId("jboss");
    partition.setSuffix("dc=jboss,dc=org");

    service.addPartition(partition);
  }