home *** CD-ROM | disk | FTP | other *** search
- package java.io;
-
- import java.util.concurrent.atomic.AtomicBoolean;
-
- class ObjectInputStream$CallbackContext {
- private final Object obj;
- private final ObjectStreamClass desc;
- private final AtomicBoolean used = new AtomicBoolean();
-
- public ObjectInputStream$CallbackContext(Object var1, ObjectStreamClass var2) {
- this.obj = var1;
- this.desc = var2;
- }
-
- public Object getObj() throws NotActiveException {
- this.checkAndSetUsed();
- return this.obj;
- }
-
- public ObjectStreamClass getDesc() {
- return this.desc;
- }
-
- private void checkAndSetUsed() throws NotActiveException {
- if (!this.used.compareAndSet(false, true)) {
- throw new NotActiveException("not in readObject invocation or fields already read");
- }
- }
-
- public void setUsed() {
- this.used.set(true);
- }
- }
-