Package org.omg.TimeBase

Examples of org.omg.TimeBase.UtcT


        // Compute the deadlines for this request based on any absolute or
        // relative timing policies that have been specified.  Compute this
        // now, because it is the earliest possible time, and therefore any
        // relative timeouts will cover the entire invocation.

        UtcT requestEndTime = getRequestEndTime();
        long requestTimeout = getRelativeRequestTimeout();

        if ((requestTimeout != 0) || (requestEndTime != null))
        {
            requestEndTime = Time.earliest(Time.corbaFuture (requestTimeout),
                                           requestEndTime);
            if (Time.hasPassed(requestEndTime))
            {
                throw new TIMEOUT("Request End Time exceeded prior to invocation",
                                  0, CompletionStatus.COMPLETED_NO);
            }
        }

        UtcT replyEndTime     = getReplyEndTime();
        long roundtripTimeout = getRelativeRoundtripTimeout();

        if ((roundtripTimeout != 0) || (replyEndTime != null))
        {
            replyEndTime = Time.earliest(Time.corbaFuture (roundtripTimeout),
View Full Code Here


    public EvaluationResult evaluate(EvaluationContext context) throws EvaluationException
    {
        EvaluationResult _result = new EvaluationResult();

        UtcT _curtime = context.getCurrentTime();

        Any _curAny = orb_.create_any();

        UtcTHelper.insert(_curAny, _curtime);
View Full Code Here

    }

    @Test
    public void testReplyEndTimePolicy()
    {
        UtcT time = new UtcT(12, 34, (short)56, (short)78);
        Any value = create_any();
        UtcTHelper.insert (value, time);
        ReplyEndTimePolicy p = (ReplyEndTimePolicy)create_policy
        (
            REPLY_END_TIME_POLICY_TYPE.value,
            value
        );
        assertEquals (REPLY_END_TIME_POLICY_TYPE.value, p.policy_type());
        UtcT outTime = p.end_time();
        assertEquals (time.time, outTime.time);
        assertEquals (time.inacchi, outTime.inacchi);
        assertEquals (time.inacclo, outTime.inacclo);
        assertEquals (time.tdf, outTime.tdf);

        ReplyEndTimePolicy p2 = (ReplyEndTimePolicy)p.copy();
        UtcT otherTime = p2.end_time();
        assertEquals (otherTime.time, outTime.time);
        assertEquals (otherTime.inacchi, outTime.inacchi);
        assertEquals (otherTime.inacclo, outTime.inacclo);
        assertEquals (otherTime.tdf, outTime.tdf);
View Full Code Here

    }

    @Test
    public void testReplyStartTimePolicy()
    {
        UtcT time = new UtcT(12, 34, (short)56, (short)78);
        Any value = create_any();
        UtcTHelper.insert (value, time);
        ReplyStartTimePolicy p = (ReplyStartTimePolicy)create_policy
        (
            REPLY_START_TIME_POLICY_TYPE.value,
            value
        );
        assertEquals (REPLY_START_TIME_POLICY_TYPE.value, p.policy_type());
        UtcT outTime = p.start_time();
        assertEquals (time.time, outTime.time);
        assertEquals (time.inacchi, outTime.inacchi);
        assertEquals (time.inacclo, outTime.inacclo);
        assertEquals (time.tdf, outTime.tdf);

        ReplyStartTimePolicy p2 = (ReplyStartTimePolicy)p.copy();
        UtcT otherTime = p2.start_time();
        assertEquals (otherTime.time, outTime.time);
        assertEquals (otherTime.inacchi, outTime.inacchi);
        assertEquals (otherTime.inacclo, outTime.inacclo);
        assertEquals (otherTime.tdf, outTime.tdf);
View Full Code Here

    }

    @Test
    public void testRequestEndTimePolicy()
    {
        UtcT time = new UtcT(12, 34, (short)56, (short)78);
        Any value = create_any();
        UtcTHelper.insert (value, time);
        RequestEndTimePolicy p = (RequestEndTimePolicy)create_policy
        (
            REQUEST_END_TIME_POLICY_TYPE.value,
            value
        );
        assertEquals (REQUEST_END_TIME_POLICY_TYPE.value, p.policy_type());
        UtcT outTime = p.end_time();
        assertEquals (time.time, outTime.time);
        assertEquals (time.inacchi, outTime.inacchi);
        assertEquals (time.inacclo, outTime.inacclo);
        assertEquals (time.tdf, outTime.tdf);

        RequestEndTimePolicy p2 = (RequestEndTimePolicy)p.copy();
        UtcT otherTime = p2.end_time();
        assertEquals (otherTime.time, outTime.time);
        assertEquals (otherTime.inacchi, outTime.inacchi);
        assertEquals (otherTime.inacclo, outTime.inacclo);
        assertEquals (otherTime.tdf, outTime.tdf);
View Full Code Here

    }

    @Test
    public void testRequestStartTimePolicy()
    {
        UtcT time = new UtcT(12, 34, (short)56, (short)78);
        Any value = create_any();
        UtcTHelper.insert (value, time);
        RequestStartTimePolicy p = (RequestStartTimePolicy)create_policy
        (
            REQUEST_START_TIME_POLICY_TYPE.value,
            value
        );
        assertEquals (REQUEST_START_TIME_POLICY_TYPE.value, p.policy_type());
        UtcT outTime = p.start_time();
        assertEquals (time.time, outTime.time);
        assertEquals (time.inacchi, outTime.inacchi);
        assertEquals (time.inacclo, outTime.inacclo);
        assertEquals (time.tdf, outTime.tdf);

        RequestStartTimePolicy p2 = (RequestStartTimePolicy)p.copy();
        UtcT otherTime = p2.start_time();
        assertEquals (otherTime.time, outTime.time);
        assertEquals (otherTime.inacchi, outTime.inacchi);
        assertEquals (otherTime.inacclo, outTime.inacclo);
        assertEquals (otherTime.tdf, outTime.tdf);
View Full Code Here

        return REPLY_END_TIME_POLICY_TYPE.value;
    }

    public Policy copy()
    {
        UtcT copy_time = new UtcT (end_time.time,
                                   end_time.inacclo,
                                   end_time.inacchi,
                                   end_time.tdf);

        return new ReplyEndTimePolicy (copy_time);
View Full Code Here

    public void testVariableCurtime() throws Exception
    {
        runEvaluation(testPerson_, "$curtime._repos_id == 'IDL:omg.org/TimeBase/UtcT:1.0'");

        Any _timeAny = getORB().create_any();
        UtcT _time = org.jacorb.util.Time.corbaTime();
        UtcTHelper.insert(_timeAny, _time);

        runEvaluation(_timeAny, "$curtime._repos_id == $._repos_id");
        runEvaluation(_timeAny, "$.time <= $curtime.time");
        runEvaluation(_timeAny, "$.time + 1 >= $.time");
View Full Code Here

        return TimingServerHelper.narrow (r);
    }

    private TimingServer setRequestStartTime (TimingServer server, long unixTime)
    {
        UtcT corbaTime = Time.corbaTime (unixTime);

        org.omg.CORBA.ORB orb = setup.getClientOrb();
        org.omg.CORBA.Any any = orb.create_any();
        UtcTHelper.insert (any, corbaTime);
        try
View Full Code Here

        }
    }

    private TimingServer setRequestEndTime (TimingServer server, long unixTime)
    {
        UtcT corbaTime = Time.corbaTime (unixTime);

        org.omg.CORBA.ORB orb = setup.getClientOrb();
        org.omg.CORBA.Any any = orb.create_any();
        UtcTHelper.insert (any, corbaTime);
        try
View Full Code Here

TOP

Related Classes of org.omg.TimeBase.UtcT

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.