Package java.io

Examples of java.io.NotActiveException


    }
  }

  public synchronized void commit(boolean release) throws IOException {
    if (phase != RUN)
      throw new NotActiveException("Can not commit inexistent transaction.");

    // Save the log to disk
    logFile.seek(4L);
    for (Enumeration e = log.elements(); e.hasMoreElements(); ) {
      Operation op = (Operation) e.nextElement();     
View Full Code Here


    }

    public synchronized void registerValidation(ObjectInputValidation obj,
            int prio) throws NotActiveException, InvalidObjectException {
        if (recursionDepth == 0) {
            throw new NotActiveException("readObject not Active");
        }

        if (obj == null) {
            throw new InvalidObjectException(
                    "Null is not a valid callback object");
View Full Code Here

    /* throws IOException */
    {
        try {
      if (currentObject == null || currentClassDesc == null)
    // XXX I18N, Logging needed.
    throw new NotActiveException("defaultWriteObjectDelegate");

      ObjectStreamField[] fields =
    currentClassDesc.getFieldsNoCopy();
      if (fields.length > 0) {
    outputClassFields(currentObject, currentClassDesc.forClass(),
View Full Code Here

        int old = getAndSet(ON);
        switch (old) {
            case UNREAD_FIELDS:
            case UNREAD_FIELDS_EOB: break;
            default:
                throw new NotActiveException("readFields() may only be called when the fields have not yet been read");
        }
        try {
            unmarshaller.readFields(current, serializableClassDescriptor);
            if (old == UNREAD_FIELDS_EOB) {
                restoreIdx = blockUnmarshaller.tempEndOfStream();
View Full Code Here

        int old = getAndSet(ON);
        switch (old) {
            case UNREAD_FIELDS:
            case UNREAD_FIELDS_EOB: break;
            default:
                throw new NotActiveException("readFields() may only be called when the fields have not yet been read");
        }
        try {
            unmarshaller.discardFields(serializableClassDescriptor);
            if (old == UNREAD_FIELDS_EOB) {
                restoreIdx = blockUnmarshaller.tempEndOfStream();
View Full Code Here

        int old = getAndSet(ON);
        switch (old) {
            case UNREAD_FIELDS:
            case UNREAD_FIELDS_EOB: break;
            default:
                throw new NotActiveException("readFields() may only be called when the fields have not yet been read");
        }
        final SerializableField[] streamFields = serializableClassDescriptor.getFields();
        final int cnt = streamFields.length;
        final ReadField[] readFields = new ReadField[cnt];
        // todo - find defaulted fields
View Full Code Here

            case ON:
                // todo if blockmode, flush...
                break;
            case UNREAD_FIELDS:
                if(serializableClassDescriptor.getFields().length > 0) {
                    throw new NotActiveException("Fields were never read");
                }
        }
    }
View Full Code Here

    }

    private void checkState() throws IOException {
        switch (state) {
            case OFF:
                throw new NotActiveException("Object stream not active");
            case ON:
                return;
            case UNREAD_FIELDS:
            case UNREAD_FIELDS_EOB:
                discardReadObject();
View Full Code Here

    }

    public void writeFields() throws IOException {
        final RiverPutField putField = this.putField;
        if (putField == null) {
            throw new NotActiveException("no current PutField object");
        }
        if (! compareAndSetState(UNWRITTEN_FIELDS, ON)) {
            throw new NotActiveException("writeFields() may only be called when the fields have not yet been written");
        }
        this.putField = null;
        putField.write(marshaller);
    }
View Full Code Here

        putField.write(marshaller);
    }

    public PutField putFields() throws IOException {
        if (state == OFF) {
            throw new NotActiveException("No object is currently being serialized");
        }
        if (putField == null) {
            final SerializableField[] serializableFields = serializableClass.getFields();
            final FieldPutter[] fields;
            final String[] names;
View Full Code Here

TOP

Related Classes of java.io.NotActiveException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.