KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > indexing > ObjectStoreException


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.internal.indexing;
12
13 import org.eclipse.core.internal.resources.CompatibilityMessages;
14
15 public class ObjectStoreException extends StoreException {
16
17     public final static int GenericFailure = 0;
18     public final static int InternalFailure = 1;
19     public final static int StoreCreateFailure = 10;
20     public final static int StoreConversionFailure = 11;
21     public final static int StoreOpenFailure = 12;
22     public final static int StoreCloseFailure = 13;
23     public final static int PageReadFailure = 20;
24     public final static int PageWriteFailure = 21;
25     public final static int PageVacancyFailure = 22;
26     public final static int ObjectTypeFailure = 23;
27     public final static int ObjectSizeFailure = 24;
28     public final static int ObjectExistenceFailure = 25;
29     public final static int ObjectHeaderFailure = 26;
30     public final static int ObjectInsertFailure = 27;
31     public final static int ObjectRemoveFailure = 28;
32     public final static int ObjectUpdateFailure = 29;
33     public final static int ObjectIsLocked = 30;
34     public final static int MetadataRequestFailure = 40;
35
36     public final static String JavaDoc[] message = new String JavaDoc[50];
37
38     /**
39      * All serializable objects should have a stable serialVersionUID
40      */

41     private static final long serialVersionUID = 1L;
42
43     static {
44         initializeMessages();
45     }
46
47     public int id = 0; // exception id
48

49     public ObjectStoreException(int id) {
50         this(id, null);
51     }
52
53     public ObjectStoreException(int id, Throwable JavaDoc exception) {
54         super(message[id], exception);
55         this.id = id;
56     }
57
58     /**
59      * Initializes the messages at class load time.
60      */

61     private static void initializeMessages() {
62         message[GenericFailure] = CompatibilityMessages.objectStore_genericFailure;
63         message[InternalFailure] = CompatibilityMessages.objectStore_internalFailure;
64         message[StoreCreateFailure] = CompatibilityMessages.objectStore_storeCreateFailure;
65         message[StoreConversionFailure] = CompatibilityMessages.objectStore_storeConversionFailure;
66         message[StoreOpenFailure] = CompatibilityMessages.objectStore_storeOpenFailure;
67         message[StoreCloseFailure] = CompatibilityMessages.objectStore_storeCloseFailure;
68         message[PageReadFailure] = CompatibilityMessages.objectStore_pageReadFailure;
69         message[PageWriteFailure] = CompatibilityMessages.objectStore_pageWriteFailure;
70         message[PageVacancyFailure] = CompatibilityMessages.objectStore_pageVacancyFailure;
71         message[ObjectTypeFailure] = CompatibilityMessages.objectStore_objectTypeFailure;
72         message[ObjectSizeFailure] = CompatibilityMessages.objectStore_objectSizeFailure;
73         message[ObjectExistenceFailure] = CompatibilityMessages.objectStore_objectExistenceFailure;
74         message[ObjectHeaderFailure] = CompatibilityMessages.objectStore_objectHeaderFailure;
75         message[ObjectInsertFailure] = CompatibilityMessages.objectStore_objectInsertFailure;
76         message[ObjectRemoveFailure] = CompatibilityMessages.objectStore_objectRemoveFailure;
77         message[ObjectUpdateFailure] = CompatibilityMessages.objectStore_objectUpdateFailure;
78         message[ObjectIsLocked] = CompatibilityMessages.objectStore_objectIsLocked;
79         message[MetadataRequestFailure] = CompatibilityMessages.objectStore_metadataRequestFailure;
80     }
81
82 }
83
Popular Tags