pmcontext.java

来自「jsr170接口的java实现。是个apache的开源项目。」· Java 代码 · 共 124 行

JAVA
124
字号
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements.  See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License.  You may obtain a copy of the License at * *      http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package org.apache.jackrabbit.core.persistence;import org.apache.jackrabbit.core.fs.FileSystem;import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;import org.apache.jackrabbit.core.NodeId;import org.apache.jackrabbit.core.persistence.PersistenceManager;import javax.jcr.NamespaceRegistry;import java.io.File;/** * A <code>PMContext</code> is used to provide context information for a * <code>PersistenceManager</code>. * * @see PersistenceManager#init(PMContext) */public class PMContext {    /**     * the physcial home dir     */    private final File physicalHomeDir;    /**     * the virtual jackrabbit filesystem     */    private final FileSystem fs;    /**     * namespace registry     */    private final NamespaceRegistry nsReg;    /**     * node type registry     */    private final NodeTypeRegistry ntReg;    /**     * uuid of the root node     */    private final NodeId rootNodeId;    /**     * Creates a new <code>PMContext</code>.     *     * @param homeDir the physical home directory     * @param fs the virtual jackrabbit filesystem     * @param rootNodeId id of the root node     * @param nsReg        namespace registry     * @param ntReg        node type registry     */    public PMContext(File homeDir,                     FileSystem fs,                     NodeId rootNodeId,                     NamespaceRegistry nsReg,                     NodeTypeRegistry ntReg) {        this.physicalHomeDir = homeDir;        this.fs = fs;        this.rootNodeId = rootNodeId;        this.nsReg = nsReg;        this.ntReg = ntReg;    }    /**     * Returns the physical home directory for this persistence manager     * @return the physical home directory for this persistence manager     */    public File getHomeDir() {        return physicalHomeDir;    }    /**     * Returns the virtual filesystem for this persistence manager     * @return the virtual filesystem for this persistence manager     */    public FileSystem getFileSystem() {        return fs;    }    /**     * Returns the id of the root node     * @return the id of the root node     */    public NodeId getRootNodeId() {        return rootNodeId;    }    /**     * Returns the namespace registry     *     * @return the namespace registry     */    public NamespaceRegistry getNamespaceRegistry() {        return nsReg;    }    /**     * Returns the node type registry     *     * @return the node type registry     */    public NodeTypeRegistry getNodeTypeRegistry() {        return ntReg;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?