NotActiveException.java revision adc854b798c1cfe3bfd4c27d68d5cee38ca617da
1/* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18package java.io; 19 20/** 21 * Signals that a serialization-related method has been invoked in the wrong 22 * place. Some methods in {@code ObjectInputStream} and {@code 23 * ObjectOutputStream} can only be called from a nested call to readObject() or 24 * writeObject(). Any attempt to call them from another context will cause a 25 * {@code NotActiveException} to be thrown. The list of methods that are 26 * protected this way is: 27 * <ul> 28 * <li>{@link ObjectInputStream#defaultReadObject()}</li> 29 * <li>{@link ObjectInputStream#registerValidation(ObjectInputValidation, int)}</li> 30 * <li>{@link ObjectOutputStream#defaultWriteObject()}</li> 31 * </ul> 32 * 33 * @since Android 1.0 34 */ 35public class NotActiveException extends ObjectStreamException { 36 37 private static final long serialVersionUID = -3893467273049808895L; 38 39 /** 40 * Constructs a new {@code NotActiveException} with its stack trace filled 41 * in. 42 * 43 * @since Android 1.0 44 */ 45 public NotActiveException() { 46 super(); 47 } 48 49 /** 50 * Constructs a new {@code NotActiveException} with its stack trace and 51 * detail message filled in. 52 * 53 * @param detailMessage 54 * the detail message for this exception. 55 * @since Android 1.0 56 */ 57 public NotActiveException(String detailMessage) { 58 super(detailMessage); 59 } 60} 61