Package com.sun.cldc.isolate

Examples of com.sun.cldc.isolate.Isolate


    /**
     * Tests send-then-receive of a byte array subrange.
     */
    void testSendDataRange() throws IOException {
        Isolate i = Isolate.currentIsolate();
        Link link = Link.newLink(i, i);
        byte[] sendarr = new byte[100];
        Utils.fillRandom(sendarr);
        Sender sender = new Sender(link,
            LinkMessage.newDataMessage(sendarr, 47, 22));
View Full Code Here


    /**
     * Tests the transfer of a message containing a link, where the receiver
     * thread blocks first.
     */
    void testReceiveLink() throws IOException {
        Isolate i = Isolate.currentIsolate();
        Link link = Link.newLink(i, i);
        Link sentlink = Link.newLink(i, i);
        Receiver receiver = new Receiver(link);

        link.send(LinkMessage.newLinkMessage(sentlink));
View Full Code Here

    /**
     * Tests the transfer of a message containing a link, where the sender
     * thread blocks first.
     */
    void testSendLink() throws IOException {
        Isolate i = Isolate.currentIsolate();
        Link link = Link.newLink(i, i);
        Link sentlink = Link.newLink(i, i);
        Sender sender = new Sender(link,
            LinkMessage.newLinkMessage(sentlink));

View Full Code Here

     * remove the MIDlet from the monitor's MIDlet list.
     *
     * @param proxy proxy of MIDlet
     */
    private void startNotificationThread(MIDletProxy proxy) {
        Isolate isolate = (Isolate)isolates.get(proxy);
        TerminationNotifier notifier = new TerminationNotifier();

        notifier.midlet = proxy;
        notifier.isolate = isolate;
        notifier.parent = this;
View Full Code Here

        mainArgs[1] = binFile;
        mainArgs[2] = String.valueOf(flags);
                   
        try {
            // IMPL NOTE: eliminate the hardcoded string constants
            Isolate iso =  new Isolate("com.sun.midp.main.AppImageWriter",
                    mainArgs, classpath);
            iso.setAPIAccess(true);
            iso.start();
            iso.waitForExit();

            code = iso.exitCode();
        }
        catch (IsolateStartupException ise) {
            if (Logging.REPORT_LEVEL <= Logging.ERROR) {
                Logging.report(Logging.ERROR, LogChannels.LC_AMS,
                "Cannot startup isolate: " + ise);
View Full Code Here

     * Set the MIDletProxy to run with the Minimum Isolate Priority
     *
     * @param mp MIDletProxy
     */
    public static void minPriority(MIDletProxy mp) {
        Isolate isolate = getIsolateFromId(mp.getIsolateId());
        if (isolate != null) {
            isolate.setPriority(Isolate.MIN_PRIORITY);
        }
    }
View Full Code Here

     * Set the MIDletProxy to run with the Normal Isolate Priority
     *
     * @param mp MIDletProxy
     */
    public static void normalPriority(MIDletProxy mp) {
        Isolate isolate = getIsolateFromId(mp.getIsolateId());
        if (isolate != null) {
          isolate.setPriority(Isolate.NORM_PRIORITY);
        }
    }
View Full Code Here

     * Waits for termination completion.
     * @param mp MIDlet proxy for the isolate to be terminated
     * @param mpl the MIDlet proxy list
     */
    static void terminateMIDletIsolate(MIDletProxy mp, MIDletProxyList mpl) {
        Isolate isolate = getIsolateFromId(mp.getIsolateId());
         if (isolate != null) {
            mp.setTimer(null);
            isolate.exit(0);
            // IMPL_NOTE: waiting for termination completion may be useless.
            isolate.waitForExit();
            mpl.removeIsolateProxies(mp.getIsolateId());
        }
    }
View Full Code Here

     * Tests passing illegal arguments.
     */
    void testIllegals1() throws InterruptedIOException, IOException {
        boolean thrown;

        Isolate is = Isolate.currentIsolate();
        Link sendLink = Link.newLink(is, is);
        Link[] links = new Link[3];
        links[0] = Link.newLink(is, is);
        links[1] = Link.newLink(is, is);
        links[2] = Link.newLink(is, is);
View Full Code Here

    /**
     * Tests setting and getting of actual data.
     */
    void testActual() throws InterruptedIOException, IOException {
        Isolate is = Isolate.currentIsolate();

        Link sendLink = Link.newLink(is, is);
        Link[] links = new Link[3];
        links[0] = Link.newLink(is, is);
        links[1] = Link.newLink(is, is);
View Full Code Here

TOP

Related Classes of com.sun.cldc.isolate.Isolate

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.