Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.openl.rules.repository.jcr;
 
 import javax.jcr.Node;
 
public abstract class BaseJcrRepository implements RRepositoryEventListener{
    private final Log log = LogFactory.getLog(BaseJcrRepository.class);
    private final String name;
    
JCR Session
    private final Session session;
    private final RTransactionManager transactionManager;
    public BaseJcrRepository(String nameSession sessionRTransactionManager transactionManager) {
        this. = name;
        this. = session;
        this. = transactionManager;
    }
    protected Node checkPath(String aPaththrows RepositoryException {
        Node node = .getRootNode();
        String[] paths = aPath.split("/");
        for (String path : paths) {
            if (path.length() == 0) {
                continue// first element (root folder) or illegal path
            }
            if (node.hasNode(path)) {
                // go deeper
                node = node.getNode(path);
            } else {
                // create new
                node = node.addNode(path);
            }
        }
        return node;
    }

    
Returns name of the repository. It can be type of repository plus location.

Returns:
name of repository
    public String getName() {
        return ;
    }
    protected Session getSession() {
        return ;
    }
        return ;
    }

    
Releases resources allocated by this Rules Repository instance.
    public void release() {
        try {
        } catch (RepositoryException e) {
            if (.isDebugEnabled()) {
                .debug("release"e);
            }
        }
        if ( != null && .isLive()) {
            .logout();
        }
    }
New to GrepCode? Check out our FAQ X