langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/CompilationResult.java
author alundblad
Tue, 25 Aug 2015 15:14:41 +0200
changeset 32335 7df616378cf3
parent 31115 8d8e98052d5d
permissions -rw-r--r--
8048318: Refactor sjavac as a thin client Summary: Moved compilation logic from client to server. Reviewed-by: jlahoda
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25605
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
     1
/*
31115
8d8e98052d5d 8054717: SJavac should track changes in the public apis of classpath classes!
alundblad
parents: 26107
diff changeset
     2
 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
25605
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
     4
 *
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
    10
 *
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
    15
 * accompanied this code).
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
    16
 *
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
    20
 *
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
    23
 * questions.
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
    24
 */
c2d72342fe19 8050408: A few new Java src files for sjavac are missing copyright notices
jjg
parents: 25299
diff changeset
    25
25299
b4a7dcd657f5 8048594: The sjavac client/server protocol should be hidden behind an interface
alundblad
parents:
diff changeset
    26
package com.sun.tools.sjavac.server;
b4a7dcd657f5 8048594: The sjavac client/server protocol should be hidden behind an interface
alundblad
parents:
diff changeset
    27
26098
32588700060b 8048457: Sjavac should not use portfiles, sockets, etc if background=false
alundblad
parents: 25605
diff changeset
    28
import java.io.Serializable;
31115
8d8e98052d5d 8054717: SJavac should track changes in the public apis of classpath classes!
alundblad
parents: 26107
diff changeset
    29
26098
32588700060b 8048457: Sjavac should not use portfiles, sockets, etc if background=false
alundblad
parents: 25605
diff changeset
    30
/**
32588700060b 8048457: Sjavac should not use portfiles, sockets, etc if background=false
alundblad
parents: 25605
diff changeset
    31
 *  <p><b>This is NOT part of any supported API.
32588700060b 8048457: Sjavac should not use portfiles, sockets, etc if background=false
alundblad
parents: 25605
diff changeset
    32
 *  If you write code that depends on this, you do so at your own risk.
32588700060b 8048457: Sjavac should not use portfiles, sockets, etc if background=false
alundblad
parents: 25605
diff changeset
    33
 *  This code and its internal interfaces are subject to change or
32588700060b 8048457: Sjavac should not use portfiles, sockets, etc if background=false
alundblad
parents: 25605
diff changeset
    34
 *  deletion without notice.</b>
32588700060b 8048457: Sjavac should not use portfiles, sockets, etc if background=false
alundblad
parents: 25605
diff changeset
    35
 */
32588700060b 8048457: Sjavac should not use portfiles, sockets, etc if background=false
alundblad
parents: 25605
diff changeset
    36
public class CompilationResult implements Serializable {
32588700060b 8048457: Sjavac should not use portfiles, sockets, etc if background=false
alundblad
parents: 25605
diff changeset
    37
32588700060b 8048457: Sjavac should not use portfiles, sockets, etc if background=false
alundblad
parents: 25605
diff changeset
    38
    static final long serialVersionUID = 46739181113L;
25299
b4a7dcd657f5 8048594: The sjavac client/server protocol should be hidden behind an interface
alundblad
parents:
diff changeset
    39
b4a7dcd657f5 8048594: The sjavac client/server protocol should be hidden behind an interface
alundblad
parents:
diff changeset
    40
    // Return code constants
b4a7dcd657f5 8048594: The sjavac client/server protocol should be hidden behind an interface
alundblad
parents:
diff changeset
    41
    public final static int ERROR_FATAL = -1;
b4a7dcd657f5 8048594: The sjavac client/server protocol should be hidden behind an interface
alundblad
parents:
diff changeset
    42
32335
7df616378cf3 8048318: Refactor sjavac as a thin client
alundblad
parents: 31115
diff changeset
    43
    public String stdout;
7df616378cf3 8048318: Refactor sjavac as a thin client
alundblad
parents: 31115
diff changeset
    44
    public String stderr;
25299
b4a7dcd657f5 8048594: The sjavac client/server protocol should be hidden behind an interface
alundblad
parents:
diff changeset
    45
    public int returnCode;
b4a7dcd657f5 8048594: The sjavac client/server protocol should be hidden behind an interface
alundblad
parents:
diff changeset
    46
b4a7dcd657f5 8048594: The sjavac client/server protocol should be hidden behind an interface
alundblad
parents:
diff changeset
    47
    public CompilationResult(int returnCode) {
32335
7df616378cf3 8048318: Refactor sjavac as a thin client
alundblad
parents: 31115
diff changeset
    48
        this(returnCode, "", "");
7df616378cf3 8048318: Refactor sjavac as a thin client
alundblad
parents: 31115
diff changeset
    49
    }
7df616378cf3 8048318: Refactor sjavac as a thin client
alundblad
parents: 31115
diff changeset
    50
7df616378cf3 8048318: Refactor sjavac as a thin client
alundblad
parents: 31115
diff changeset
    51
    public CompilationResult(int returnCode, String stdout, String stderr) {
25299
b4a7dcd657f5 8048594: The sjavac client/server protocol should be hidden behind an interface
alundblad
parents:
diff changeset
    52
        this.returnCode = returnCode;
32335
7df616378cf3 8048318: Refactor sjavac as a thin client
alundblad
parents: 31115
diff changeset
    53
        this.stdout = stdout;
7df616378cf3 8048318: Refactor sjavac as a thin client
alundblad
parents: 31115
diff changeset
    54
        this.stderr = stderr;
25299
b4a7dcd657f5 8048594: The sjavac client/server protocol should be hidden behind an interface
alundblad
parents:
diff changeset
    55
    }
b4a7dcd657f5 8048594: The sjavac client/server protocol should be hidden behind an interface
alundblad
parents:
diff changeset
    56
b4a7dcd657f5 8048594: The sjavac client/server protocol should be hidden behind an interface
alundblad
parents:
diff changeset
    57
    public void setReturnCode(int returnCode) {
b4a7dcd657f5 8048594: The sjavac client/server protocol should be hidden behind an interface
alundblad
parents:
diff changeset
    58
        this.returnCode = returnCode;
b4a7dcd657f5 8048594: The sjavac client/server protocol should be hidden behind an interface
alundblad
parents:
diff changeset
    59
    }
b4a7dcd657f5 8048594: The sjavac client/server protocol should be hidden behind an interface
alundblad
parents:
diff changeset
    60
}