KickJava   Java API By Example, From Geeks To Geeks.

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


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
16 public class PageStoreException extends StoreException {
17     public final static int GenericFailure = 0;
18     public final static int CreateFailure = 1;
19     public final static int OpenFailure = 2;
20     public final static int LengthFailure = 3;
21     public final static int WriteFailure = 4;
22     public final static int ReadFailure = 5;
23     public final static int CommitFailure = 6;
24     public final static int IntegrityFailure = 7;
25     public final static int MetadataRequestFailure = 8;
26     public final static int ConversionFailure = 9;
27
28     public final static int LogCreateFailure = 20;
29     public final static int LogOpenFailure = 21;
30     public final static int LogReadFailure = 23;
31     public final static int LogWriteFailure = 24;
32
33     public final static String JavaDoc[] message = new String JavaDoc[30];
34
35     /**
36      * All serializable objects should have a stable serialVersionUID
37      */

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

46     public PageStoreException(int id) {
47         this(id, null);
48     }
49
50     public PageStoreException(int id, Throwable JavaDoc exception) {
51         super(message[id], exception);
52         this.id = id;
53     }
54
55     /**
56      * Initialize the messages at class load time.
57      */

58     private static void initializeMessages() {
59         message[GenericFailure] = CompatibilityMessages.pageStore_genericFailure;
60         message[CreateFailure] = CompatibilityMessages.pageStore_createFailure;
61         message[OpenFailure] = CompatibilityMessages.pageStore_openFailure;
62         message[LengthFailure] = CompatibilityMessages.pageStore_lengthFailure;
63         message[WriteFailure] = CompatibilityMessages.pageStore_writeFailure;
64         message[ReadFailure] = CompatibilityMessages.pageStore_readFailure;
65         message[CommitFailure] = CompatibilityMessages.pageStore_commitFailure;
66         message[IntegrityFailure] = CompatibilityMessages.pageStore_integrityFailure;
67         message[MetadataRequestFailure] = CompatibilityMessages.pageStore_metadataRequestFailure;
68         message[ConversionFailure] = CompatibilityMessages.pageStore_conversionFailure;
69         message[LogCreateFailure] = CompatibilityMessages.pageStore_logCreateFailure;
70         message[LogOpenFailure] = CompatibilityMessages.pageStore_logOpenFailure;
71         message[LogReadFailure] = CompatibilityMessages.pageStore_logReadFailure;
72         message[LogWriteFailure] = CompatibilityMessages.pageStore_logWriteFailure;
73     }
74 }
75
Popular Tags