Package org.apache.jackrabbit.core

Examples of org.apache.jackrabbit.core.ItemId


    /**
     * {@inheritDoc}
     */
    public void cache(ItemState state) {
        ItemId id = state.getId();
        if (cache.containsKey(id)) {
            log.warn("overwriting cached entry " + id);
        }
        cache.put(id, state);
    }
View Full Code Here


    /**
     * {@inheritDoc}
     */
    public void cache(ItemState state) {
        ItemId id = state.getId();
        if (refs.contains(id)) {
            log.warn("overwriting cached entry " + id);
        }
        // fake call to update stats of secondary cache
        cache.cache(state);
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void cache(ItemState state) {
        synchronized (cache) {
            ItemId id = state.getId();
            if (cache.containsKey(id)) {
                log.warn("overwriting cached entry " + id);
                evict(id);
            }
            Entry entry = new Entry(state);
View Full Code Here

     * @throws ItemStateException
     */
    public NodeState createTransientNodeState(NodeState overlayedState, int initialStatus)
            throws ItemStateException {

        ItemId id = overlayedState.getNodeId();

        // check map; synchronized to ensure an entry is not created twice.
        synchronized (transientStore) {
            if (transientStore.contains(id)) {
                String msg = "there's already a node state instance with id " + id;
View Full Code Here

        try {
            int n = in.readInt();   // number of entries
            while (n-- > 0) {
                byte type = in.readByte()// entry type
                ItemId id;
                if (type == NODE_ENTRY) {
                    // entry type: node
                    String s = in.readUTF();    // id
                    id = NodeId.valueOf(s);
                } else {
View Full Code Here

            out.writeInt(stateStore.size());    // number of entries
            // entries
            Iterator iterKeys = stateStore.keySet().iterator();
            while (iterKeys.hasNext()) {
                ItemId id = (ItemId) iterKeys.next();
                if (id.denotesNode()) {
                    out.writeByte(NODE_ENTRY)// entry type
                } else {
                    out.writeByte(PROP_ENTRY)// entry type
                }
                out.writeUTF(id.toString());    // id
                byte[] data = (byte[]) stateStore.get(id);
                out.writeInt(data.length)// data length
                out.write(data);    // data
            }
        } finally {
            out.close();
        }

        // write references
        fsRes = new FileSystemResource(wspFS, REFS_FILE_PATH);
        fsRes.makeParentDirs();
        bos = new BufferedOutputStream(fsRes.getOutputStream());
        out = new DataOutputStream(bos);

        try {
            out.writeInt(refsStore.size()); // number of entries
            // entries
            Iterator iterKeys = refsStore.keySet().iterator();
            while (iterKeys.hasNext()) {
                NodeReferencesId id = (NodeReferencesId) iterKeys.next();
                out.writeUTF(id.toString());    // target id
                byte[] data = (byte[]) refsStore.get(id);
                out.writeInt(data.length)// data length
                out.write(data);    // data
            }
        } finally {
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void cache(ItemState state) {
        ItemId id = state.getId();
        if (cache.containsKey(id)) {
            log.warn("overwriting cached entry " + id);
        }
        cache.put(id, state);
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void cache(ItemState state) {
        ItemId id = state.getId();
        if (refs.contains(id)) {
            log.warn("overwriting cached entry " + id);
        }
        // fake call to update stats of secondary cache
        cache.cache(state);
View Full Code Here

     * {@inheritDoc}
     */
    public void cache(ItemState state) {
        touch();
        synchronized (cache) {
            ItemId id = state.getId();
            if (cache.containsKey(id)) {
                log.warn("overwriting cached entry " + id);
                evict(id);
            }
            Entry entry = new Entry(state);
View Full Code Here

    private void shrinkIfRequired() {
        // remove items, if too many
        synchronized (cache) {
            while (totalMem > maxMem) {
                ItemId id = (ItemId) cache.firstKey();
                Entry entry = (Entry) cache.remove(id);
                totalMem -= entry.size;
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.ItemId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.