Package agentj.nativeimp

Examples of agentj.nativeimp.ProtolibTimer


            controller.getThreadMonitor().threadPaused(threadName); // to sync up with signal...
            ++waiting;       
            conditionObject.await();
        } catch (InterruptedException e) {
            // Wait for ns-2
            ProtolibTimer timer = new ProtolibTimer(controller, 0, 0);
            timer.startTimerAndBlockUntilTimeout();
            throw e;
        } catch (IllegalMonitorStateException illmon) {
            logger.error("Error Message: " + illmon.getMessage());
            logger.error("Thread now =  " + Thread.currentThread());
            illmon.printStackTrace();
            System.exit(0);
        }

        Logging.conditionStatus(controller, Logging.ConditionStatusType.AWAIT_RELEASED, threadName);

        // Wait for ns-2
        ProtolibTimer timer = new ProtolibTimer(controller, 0, 0); // and then immediately stopping
        timer.startTimerAndBlockUntilTimeout(); // and then starting again once timer has returned
        // carry on now since we have woken up ns-2
    }
View Full Code Here


        Logging.conditionStatus(controller, Logging.ConditionStatusType.AWAIT, threadName);
        controller.getThreadMonitor().threadPaused(threadName); // we are stopping ...
        ++waiting;
        conditionObject.awaitUninterruptibly();
        Logging.conditionStatus(controller, Logging.ConditionStatusType.AWAIT_RELEASED, threadName);
        ProtolibTimer timer = new ProtolibTimer(controller, 0, 0);
        timer.startTimerAndBlockUntilTimeout(); // releases control
    }
View Full Code Here

        ++waiting;
        awaitObj.awaitNanos(nanosTimeout); // returns when done ...

        Logging.conditionStatus(controller, Logging.ConditionStatusType.AWAIT_RELEASED, threadName);
        ProtolibTimer timer = new ProtolibTimer(controller, 0, 0);
        timer.startTimerAndBlockUntilTimeout(); // and stopping
        // and starting again when ns-2 has caught up...

        if (awaitObj.getWasInterrupted()) throw awaitObj.getInterruptedException();

        return awaitObj.getNanosRetValue();
View Full Code Here

        ++waiting;
        awaitObj.awaitSecs(unit.toSeconds(time)); // returns when done ...

        Logging.conditionStatus(controller, Logging.ConditionStatusType.AWAIT_RELEASED, threadName);
        ProtolibTimer timer = new ProtolibTimer(controller, 0, 0);
        timer.startTimerAndBlockUntilTimeout(); // and stopping
        // and starting again when ns-2 has caught up...

        if (awaitObj.getWasInterrupted()) throw awaitObj.getInterruptedException();

        return awaitObj.getWasTimedOut();
View Full Code Here

    private long nanosRetValue;

    public AwaitTimeout(Controller controller) {
        this.controller = controller;
        timer=new ProtolibTimer(controller,0, 0);
        AgentJQueuedSynchronizer queue = new AgentJQueuedSynchronizer();
        this.conditionObject = queue.newCondition();
    }
View Full Code Here

    String threadName;

    public ParkTimeout(Controller controller, Thread threadparking) {
        this.controller = controller;
        this.threadparking = threadparking;
        timer=new ProtolibTimer(controller,0, 0);
        threadName = threadparking.getClass().getName();
    }
View Full Code Here

    private InterruptedException interruptedException;

    public WaitInvocation(Controller controller) {
        this.controller=controller;
        millisElapsed =-1;
        timer=new ProtolibTimer(controller,0, 0);
        logger.trace("Entering");
        logger.trace("Exiting");
    }
View Full Code Here

        logger.trace("Entering");


        Controller cont = AgentJVirtualMachine.getCurrentNS2NodeController();

        ProtolibTimer timer = new ProtolibTimer(cont, (double)millis /1000.0, 0);

        // set up the controller to be the socket listener

        timer.startTimerAndBlockUntilTimeout();
        logger.trace("Exiting");
    }
View Full Code Here

        getUnsafe().park(false, 0L);

        Logging.parkStatus(controller, Logging.ParkStatusType.PARKRELEASED, threadparkingName);

        // Wait for ns-2
        ProtolibTimer timer = new ProtolibTimer(controller, 0, 0); // and then immediately stopping
        timer.startTimerAndBlockUntilTimeout(); // and then starting again once timer has returned
        // timer does the release needed for the unpark handshake.

        AgentJVirtualMachine.setCurrentNode(controller.getNs2node());
        // carry on now since we have woken up ns-2
    }
View Full Code Here

        parkObj.parkNanos(nanos); // returns when done ...

        Logging.parkStatus(controller, Logging.ParkStatusType.PARKRELEASED, threadparkingName);

        // Wait for ns-2
        ProtolibTimer timer = new ProtolibTimer(controller, 0, 0); // and then immediately stopping
        timer.startTimerAndBlockUntilTimeout(); // and then starting again once timer has returned
        // timer does the release needed for the unpark handshake.

        AgentJVirtualMachine.setCurrentNode(controller.getNs2node());
        // carry on now since we have woken up ns-2
    }
View Full Code Here

TOP

Related Classes of agentj.nativeimp.ProtolibTimer

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.