001/* 002 * Copyright (c) 2009 The openGion Project. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 013 * either express or implied. See the License for the specific language 014 * governing permissions and limitations under the License. 015 */ 016package org.opengion.hayabusa.common; 017 018import org.opengion.fukurou.system.OgRuntimeException ; // 6.4.2.0 (2016/01/29) 019 020/** 021 * 共通的に使用されるエクセプションクラスです。 022 * 023 * RuntimeException を継承しているため、try{} catch() {} は不要です。 024 * 本システムでは、すべてこのエクセプションクラスを継承させたクラスを作成し、用途によって、 025 * 使い分けるようにします。つまり、他のどのような、Throwable が発生したとしても、一旦、 026 * try{} catch() {} で受けて、このクラスのサブクラスを、再度 throw させます。 027 * そして、必要であれば、try{} catch() {} を用いて捕まえて、それぞれの対応処理を行います。 028 * 029 * このクラスには、元々の発生したエクセプション( Throwable )を引数にとり、 030 * その printStackTrace()情報を、自分自身のトレース情報に含めます。 031 * また、引数にオブジェクトを渡すことができますので、object.toString() で、オブジェクトの 032 * 状態を表示できるようにしておけば、手軽にデバッグに使うことが可能になります。 033 * 034 * @og.group エラー処理 035 * @og.rev 5.6.7.1 (2013/08/09) エラーに、エンジンのバージョン等のシステム関係の情報を付与します。 036 * @og.rev 6.0.2.5 (2014/10/31) エラーに、エラー箇所の情報も与えます。 037 * @og.rev 6.4.2.0 (2016/01/29) 継承元を、RuntimeException ではなく、OgRuntimeException に変更。 038 * 039 * @version 4.0 040 * @author Kazuhiko Hasegawa 041 * @since JDK5.0, 042 */ 043public class HybsSystemException extends OgRuntimeException { 044 private static final long serialVersionUID = 642020160129L ; 045 046 // 6.4.2.0 (2016/01/29) 表示内容を変更します。 047 /** エラーメッセージに付与するシステム関係の情報 5.6.7.3 (2013/08/23) */ 048 private static final String ERR_INFO = 049 "SYSTEM_ID=[" 050 + HybsSystem.sys( "SYSTEM_ID" ) + "] : " 051 + HybsSystem.sys( "REAL_PATH" ); // C:/opengionV6/uap/webapps/gf/ 052 053 /** 054 * 詳細メッセージを指定しないで HybsSystemException を構築します。 055 * 056 * @og.rev 5.6.7.1 (2013/08/09) エラーに、エンジンのバージョン等の情報を付与します。 057 * @og.rev 6.4.2.0 (2016/01/29) 継承元が、OgRuntimeException なので、エンジンバージョンは、組み込まれます。 058 * 059 * @see org.opengion.fukurou.system.OgRuntimeException#OgRuntimeException() 060 */ 061 public HybsSystemException() { 062 super(); // 6.0.2.5 (2014/10/31) 063 064 addMessage( ERR_INFO ); // 6.4.2.0 (2016/01/29) 065 } 066 067 /** 068 * 指定された詳細メッセージを持つ HybsSystemException を構築します。 069 * 070 * @og.rev 5.6.7.1 (2013/08/09) エラーに、エンジンのバージョン等の情報を付与します。 071 * @og.rev 6.4.2.0 (2016/01/29) 継承元が、OgRuntimeException なので、エンジンバージョンは、組み込まれます。 072 * 073 * @param msg 詳細メッセージ 074 * @see org.opengion.fukurou.system.OgRuntimeException#OgRuntimeException(String) 075 */ 076 public HybsSystemException( final String msg ) { 077 super( msg ); 078 079 addMessage( ERR_INFO ); // 6.4.2.0 (2016/01/29) 080 } 081 082 /** 083 * 指定された詳細メッセージを持つ HybsSystemException を構築します。 084 * 085 * @og.rev 5.6.7.1 (2013/08/09) エラーに、エンジンのバージョン等の情報を付与します。 086 * @og.rev 6.4.2.0 (2016/01/29) 継承元が、OgRuntimeException なので、エンジンバージョンは、組み込まれます。 087 * 088 * @param th 例外Throwableオブジェクト 089 * @see org.opengion.fukurou.system.OgRuntimeException#OgRuntimeException(Throwable) 090 */ 091 public HybsSystemException( final Throwable th ) { 092 super( th ); 093 094 addMessage( ERR_INFO ); // 6.4.2.0 (2016/01/29) 095 } 096 097 /** 098 * 指定されたオブジェクトを受け取る HybsSystemException を構築します。 099 * 100 * @og.rev 3.5.5.4 (2004/04/15) 引数を、RuntimeException(String , Throwable )にあわせます。 101 * @og.rev 5.6.7.1 (2013/08/09) エラーに、エンジンのバージョン等の情報を付与します。 102 * 103 * @param msg 詳細メッセージ 104 * @param th 例外Throwableオブジェクト 105 * @see org.opengion.fukurou.system.OgRuntimeException#OgRuntimeException(String,Throwable) 106 */ 107 public HybsSystemException( final String msg,final Throwable th ) { 108 super( msg,th ); 109 110 addMessage( ERR_INFO ); // 6.4.2.0 (2016/01/29) 111 } 112}