Package javax.jcr

Examples of javax.jcr.Property.save()


                            Object ret = new Locked() {
                                protected Object run(Node n) throws RepositoryException {
                                    Property seqProp = n.getProperty("value");
                                    long value = seqProp.getLong();
                                    seqProp.setValue(++value);
                                    seqProp.save();
                                    return new Long(value);
                                }
                            }.with(n, false, 10 * 1000); // expect a value after ten seconds
                            if (ret == Locked.TIMED_OUT) {
                                log.println("Thread" + threadNumber + ": could not get a sequence number within 10 seconds");
View Full Code Here


        // check lock status
        checkLock();

        Version v = session.getVersionManager().checkin(this);
        Property prop = internalSetProperty(QName.JCR_ISCHECKEDOUT, InternalValue.create(false));
        prop.save();
        prop = internalSetProperty(QName.JCR_BASEVERSION, InternalValue.create(new UUID(v.getUUID())));
        prop.save();
        prop = internalSetProperty(QName.JCR_PREDECESSORS, InternalValue.EMPTY_ARRAY, PropertyType.REFERENCE);
        prop.save();
        return v;
View Full Code Here

        Version v = session.getVersionManager().checkin(this);
        Property prop = internalSetProperty(QName.JCR_ISCHECKEDOUT, InternalValue.create(false));
        prop.save();
        prop = internalSetProperty(QName.JCR_BASEVERSION, InternalValue.create(new UUID(v.getUUID())));
        prop.save();
        prop = internalSetProperty(QName.JCR_PREDECESSORS, InternalValue.EMPTY_ARRAY, PropertyType.REFERENCE);
        prop.save();
        return v;
    }
View Full Code Here

        Property prop = internalSetProperty(QName.JCR_ISCHECKEDOUT, InternalValue.create(false));
        prop.save();
        prop = internalSetProperty(QName.JCR_BASEVERSION, InternalValue.create(new UUID(v.getUUID())));
        prop.save();
        prop = internalSetProperty(QName.JCR_PREDECESSORS, InternalValue.EMPTY_ARRAY, PropertyType.REFERENCE);
        prop.save();
        return v;
    }

    /**
     * {@inheritDoc}
 
View Full Code Here

    public void testSetValue() throws RepositoryException {
        Property p = (Property) readOnlySession.getItem(testPropertyPath);
        try {
            p.setValue("otherValue");
            p.save();
            fail("A read only session must not be allowed to modify a property value");
        } catch (AccessDeniedException e) {
            // success
        }
    }
View Full Code Here

    public void testSetValue() throws RepositoryException {
        Property p = (Property) readOnlySession.getItem(testPropertyPath);
        try {
            p.setValue("otherValue");
            p.save();
            fail("A read only session must not be allowed to modify a property value");
        } catch (AccessDeniedException e) {
            // success
        }
    }
View Full Code Here

                            long currentValue = ((Long) new Locked() {
                                protected Object run(Node n) throws RepositoryException {
                                    Property seqProp = n.getProperty("value");
                                    long value = seqProp.getLong();
                                    seqProp.setValue(++value);
                                    seqProp.save();
                                    return new Long(value);
                                }
                            }.with(n, false)).longValue();
                            log.println("Thread" + threadNumber + ": got sequence number: " + currentValue);
                            // do a random wait
View Full Code Here

                            Object ret = new Locked() {
                                protected Object run(Node n) throws RepositoryException {
                                    Property seqProp = n.getProperty("value");
                                    long value = seqProp.getLong();
                                    seqProp.setValue(++value);
                                    seqProp.save();
                                    return new Long(value);
                                }
                            }.with(n, false, 10 * 1000); // expect a value after ten seconds
                            if (ret == Locked.TIMED_OUT) {
                                log.println("Thread" + threadNumber + ": could not get a sequence number within 10 seconds");
View Full Code Here

        // check lock status
        checkLock();

        Version v = session.getVersionManager().checkin(this);
        Property prop = internalSetProperty(QName.JCR_ISCHECKEDOUT, InternalValue.create(false));
        prop.save();
        prop = internalSetProperty(QName.JCR_BASEVERSION, InternalValue.create(new UUID(v.getUUID())));
        prop.save();
        prop = internalSetProperty(QName.JCR_PREDECESSORS, InternalValue.EMPTY_ARRAY, PropertyType.REFERENCE);
        prop.save();
        return v;
View Full Code Here

        Version v = session.getVersionManager().checkin(this);
        Property prop = internalSetProperty(QName.JCR_ISCHECKEDOUT, InternalValue.create(false));
        prop.save();
        prop = internalSetProperty(QName.JCR_BASEVERSION, InternalValue.create(new UUID(v.getUUID())));
        prop.save();
        prop = internalSetProperty(QName.JCR_PREDECESSORS, InternalValue.EMPTY_ARRAY, PropertyType.REFERENCE);
        prop.save();
        return v;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.