rt/vm/src/test/java/org/apidesign/vm4brwsr/Hello.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Mon, 14 Oct 2013 16:44:55 +0200
changeset 1373 c4e57ec5f0df
child 1787 ea12a3bb4b33
permissions -rw-r--r--
VM.reload can now reload a class in existing virtual machine
jaroslav@1373
     1
/**
jaroslav@1373
     2
 * Back 2 Browser Bytecode Translator
jaroslav@1373
     3
 * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jaroslav@1373
     4
 *
jaroslav@1373
     5
 * This program is free software: you can redistribute it and/or modify
jaroslav@1373
     6
 * it under the terms of the GNU General Public License as published by
jaroslav@1373
     7
 * the Free Software Foundation, version 2 of the License.
jaroslav@1373
     8
 *
jaroslav@1373
     9
 * This program is distributed in the hope that it will be useful,
jaroslav@1373
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
jaroslav@1373
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
jaroslav@1373
    12
 * GNU General Public License for more details.
jaroslav@1373
    13
 *
jaroslav@1373
    14
 * You should have received a copy of the GNU General Public License
jaroslav@1373
    15
 * along with this program. Look for COPYING file in the top folder.
jaroslav@1373
    16
 * If not, see http://opensource.org/licenses/GPL-2.0.
jaroslav@1373
    17
 */
jaroslav@1373
    18
package org.apidesign.vm4brwsr;
jaroslav@1373
    19
jaroslav@1373
    20
import java.io.IOException;
jaroslav@1373
    21
jaroslav@1373
    22
/**
jaroslav@1373
    23
 *
jaroslav@1373
    24
 * @author Jaroslav Tulach <jtulach@netbeans.org>
jaroslav@1373
    25
 */
jaroslav@1373
    26
public class Hello {
jaroslav@1373
    27
    public static String hello() {
jaroslav@1373
    28
        return "Hello World!";
jaroslav@1373
    29
    }
jaroslav@1373
    30
    
jaroslav@1373
    31
    public static Object reloadYourSelf(byte[] arr) throws IOException {
jaroslav@1373
    32
        org.apidesign.vm4brwsr.api.VM.reload(Hello.class, arr);
jaroslav@1373
    33
        return null;
jaroslav@1373
    34
    }
jaroslav@1373
    35
}