[ 
https://issues.apache.org/jira/browse/DIRSERVER-1920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13833096#comment-13833096
 ] 

Kevin Minder commented on DIRSERVER-1920:
-----------------------------------------

Motivation for doing this was to be able to create these two simple extension 
to eliminate some startup warnings 

The prevents an WARNing about the shutdown hook not being registered.
{code}
public class SimpleDirectoryServiceFactory extends 
DefaultDirectoryServiceFactory {

  protected DirectoryService createDirectoryService() {
    DirectoryService result;
    try {
      result = new SimpleDirectoryService();
    } catch( Exception e ) {
      throw new RuntimeException( e );
    }
    return result;
  }

}
{code}

This prevents startup warnings about the default admin password needing to be 
changed.
{code}
public class SimpleDirectoryService extends DefaultDirectoryService {

  public SimpleDirectoryService() throws Exception {
  }

  protected void showSecurityWarnings() throws Exception {
    // NoOp - This prevents confusing warnings from being output.
  }

}
{code}

> Refactor DefaultDirectoryServiceFactory/DefaultDirectoryService for 
> extensability
> ---------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1920
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1920
>             Project: Directory ApacheDS
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 2.0.0-M15
>            Reporter: Kevin Minder
>         Attachments: 
> DIRSERVER_1920__Refactor_DefaultDirectoryServiceFactory_DefaultDirectoryService_for_extensability.patch
>
>
> Enhance the extensibility and reusability of 
> apacheds/apacheds/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
> apacheds/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
> For DefaultDirectoryServiceFactory create overridable methods for the 
> creation of the DirectoryService and PartitionFactory.
> For DefaultDirectoryService make showSecuirtyWarnings to allow control for 
> that behavior in subclasses.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to