Package net.jini.core.transaction

Examples of net.jini.core.transaction.Transaction


     * section 2.5.</P>
     */
    public void run() throws Exception {
        SimpleEntry sampleEntry = new SimpleEntry("TestEntry #1", 1);
        SimpleEntry result;
        Transaction txn;
        long leaseFor = timeout2;

        // first check that space is empty
        if (!checkSpace(space)) {
            throw new TestException(
View Full Code Here


    public void run() throws Exception {
        SimpleEntry sampleEntry1 = new SimpleEntry("TestEntry #1", 1);
        SimpleEntry sampleEntry2 = new SimpleEntry("TestEntry #2", 2);
        SimpleEntry sampleEntry3 = new SimpleEntry("TestEntry #1", 2);
        SimpleEntry template;
        Transaction txn;
        String msg;

        // first check that space is empty
        if (!checkSpace(space)) {
            throw new TestException("Space is not empty in the beginning.");
View Full Code Here

     * section 3.1.</P>
     */
    public void run() throws Exception {
        SimpleEntry sampleEntry = new SimpleEntry("TestEntry #1", 1);
        SimpleEntry result;
        Transaction txn1, txn2;

        // first check that space is empty
        if (!checkSpace(space)) {
            throw new TestException(
                    "Space is not empty in the beginning.");
View Full Code Here

        Entry snapshot1;
        Entry snapshot2;
        SimpleEntry origEntry1;
        SimpleEntry origEntry2;
        SimpleEntry result;
        Transaction txn;

        // first check that space is empty
        if (!checkSpace(space)) {
            throw new TestException(
                    "Space is not empty in the beginning.");
View Full Code Here

        SimpleEntry sampleEntry1 = new SimpleEntry("TestEntry #1", 1);
        SimpleEntry sampleEntry2 = new SimpleEntry("TestEntry #2", 2);
        SimpleEntry result;
        long curTime1;
        long curTime2;
        Transaction txn;
        long timeout = leaseForeverTime;
        long leaseTime;

        // first check that space is empty
        if (!checkSpace(space)) {
View Full Code Here

     */
    public void run() throws Exception {
        SimpleEntry sampleEntry = new SimpleEntry("TestEntry #1", 1);
        Entry snapshot;
        SimpleEntry result;
        Transaction txn1;
        Transaction txn2;

        // first check that space is empty
        if (!checkSpace(space)) {
            throw new TestException(
                    "Space is not empty in the beginning.");
View Full Code Here

        final Lease el = space.write(entry, null, 1000 * 60 * 60);
        logger.log(Level.INFO, "Wrote entry");
        addOutriggerLease(el, true);
        final Transaction.Created txnHolder =
                TransactionFactory.create(txnMgr, 1000 * 60 * 60);
        final Transaction txn = txnHolder.transaction;
        addMahaloLease(txnHolder.lease, true);

        if (null == space.take(entry, txn, 0)) {
            throw new TestException(
                    "Could not perform initial take");
View Full Code Here

        nonmatch.id = entry.id;
        start = System.currentTimeMillis();
        timeLog("started");

        // read the entry under one transaction
        Transaction t1 = createTransaction();
        Entry readResult = space.read(entry, t1, 0);
        assertEquals(entry, readResult, "read");
        timeLog("entry read under t1");

        // try to take it under the matching entry
        BlockAndTake shouldMatch = new BlockAndTake(entry);
        shouldMatch.start();
        shouldMatch.waitUntilTaking();

        // give time for takes to get well and truly blocked, then destroy
        timeLog("sleeping " + SLEEP_TIME);
        Thread.sleep(SLEEP_TIME);

        // read the entry under another transaction
        Transaction t2 = createTransaction();
        readResult = space.read(entry, t2, 0);
        assertEquals(entry, readResult, "read");
        timeLog("entry read under t2");
        timeLog("destroying");
View Full Code Here

    public void run() throws Exception {
        SimpleEntry sampleEntry1 = new SimpleEntry("TestEntry #1", 1);
        SimpleEntry sampleEntry2 = new SimpleEntry("TestEntry #2", 2);
        SimpleEntry sampleEntry3 = new SimpleEntry("TestEntry #1", 2);
        SimpleEntry template;
        Transaction txn;
        String msg;

        // first check that space is empty
        if (!checkSpace(space)) {
            throw new TestException("Space is not empty in the beginning.");
View Full Code Here

        SimpleEntry sampleEntry1 = new SimpleEntry("TestEntry #1", 1);
        SimpleEntry sampleEntry2 = new SimpleEntry("TestEntry #2", 2);
        SimpleEntry origEntry1;
        SimpleEntry origEntry2;
        SimpleEntry result;
        Transaction txn;
        long leaseTime1 = timeout1;
        long leaseTime2 = timeout2;
        long leaseTime3 = leaseTime1 + checkTime;

        // first check that space is empty
View Full Code Here

TOP

Related Classes of net.jini.core.transaction.Transaction

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.