]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics/src/org/simantics/PlatformException.java
SimanticsPlatform.startUp ensures updateness of installed feature groups
[simantics/platform.git] / bundles / org.simantics / src / org / simantics / PlatformException.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2014 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *     Semantum Oy - optional fillStackTrace
12  *******************************************************************************/
13 package org.simantics;
14
15 /**
16  * @author Toni Kalajainen
17  */
18 public class PlatformException extends Exception {
19
20     private static final long serialVersionUID = -2967261259650645038L;
21
22     private final boolean fillStackTrace;
23
24     public PlatformException() {
25         this(true);
26     }
27
28     public PlatformException(String message) {
29         this(message, true);
30     }
31
32     public PlatformException(Throwable cause) {
33         this(cause, true);
34     }
35
36     public PlatformException(String message, Throwable cause) {
37         this(message, cause, true);
38     }
39
40     /**
41      * @since Simantics 1.15
42      */
43     public PlatformException(boolean fillStackTrace) {
44         this.fillStackTrace = fillStackTrace;
45     }
46
47     /**
48      * @since Simantics 1.15
49      */
50     public PlatformException(String message, boolean fillStackTrace) {
51         super(message);
52         this.fillStackTrace = fillStackTrace;
53     }
54
55     /**
56      * @since Simantics 1.15
57      */
58     public PlatformException(Throwable cause, boolean fillStackTrace) {
59         super(cause);
60         this.fillStackTrace = fillStackTrace;
61     }
62
63     /**
64      * @since Simantics 1.15
65      */
66     public PlatformException(String message, Throwable cause, boolean fillStackTrace) {
67         super(message, cause);
68         this.fillStackTrace = fillStackTrace;
69     }
70
71     @Override
72     public synchronized Throwable fillInStackTrace() {
73         return fillStackTrace ? super.fillInStackTrace() : this;
74     }
75
76 }