[ 
https://issues.apache.org/jira/browse/CMIS-166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846854#action_12846854
 ] 

Dominique Pfister commented on CMIS-166:
----------------------------------------

Never mind. I'd like to add a method:

    /**
     * Return the repository. Allows subclasses to create the repository if 
necessary.
     *
     * @return repository
     */
    protected Repository getRepository() {
        return repository;
    }

and in a derived class I could, e.g.

    @Override
    protected Repository getRepository() {
        if (repository == null) {
            repository = new 
JcrRepository2(RepositoryAccessServlet.getRepository(getServletContext()));
        }
        return repository;
    }

Sounds good?


> Allow CMISServlet to get repository after instance creation
> -----------------------------------------------------------
>
>                 Key: CMIS-166
>                 URL: https://issues.apache.org/jira/browse/CMIS-166
>             Project: Chemistry
>          Issue Type: Bug
>          Components: chemistry-atompub
>            Reporter: Dominique Pfister
>            Assignee: Dominique Pfister
>
> The RepositoryFactory class, introduced in CMIS-12, is no longer available. 
> Therefore, it is not possible to use CMISServlet with the default 
> constructor, because the private createRepository() method will always throw 
> an UnsupportedOperationException.
> I'd like to replace this mechanism by a protected getRepository() method that 
> will simply return the repository instance member, allowing derived classes 
> to actually create the repository at that point if needed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to