java.io.NotActiveException Java Examples

The following examples show how to use java.io.NotActiveException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: IIOPOutputStream.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Override the actions of the final method "defaultWriteObject()"
 * in ObjectOutputStream.
 * @since     JDK1.1.6
 */
public final void defaultWriteObjectDelegate()
/* 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(),
                              fields);
        }
    } catch(IOException ioe) {
        bridge.throwException(ioe);
    }
}
 
Example #2
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: InputStreamHook.java    License: Apache License 2.0 6 votes vote down vote up
public ObjectInputStream.GetField readFields()
    throws IOException, ClassNotFoundException, NotActiveException {

    HashMap fieldValueMap = new HashMap();

    // We were treating readFields same as defaultReadObject. It is
    // incorrect if the state is readOptionalData. If this line
    // is uncommented, it will throw a stream corrupted exception.
    // _REVISIT_: The ideal fix would be to add a new state. In
    // writeObject user may do one of the following
    // 1. Call defaultWriteObject()
    // 2. Put out optional fields
    // 3. Call writeFields
    // We have the state defined for (1) and (2) but not for (3), so
    // we should ideally introduce a new state for 3 and have the
    // beginDefaultReadObject do nothing.
    //readObjectState.beginDefaultReadObject(this);

    readFields(fieldValueMap);

    readObjectState.endDefaultReadObject(this);

    return new HookGetFields(fieldValueMap);
}
 
Example #3
Source Project: TencentKona-8   Author: Tencent   File: IIOPOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Override the actions of the final method "defaultWriteObject()"
 * in ObjectOutputStream.
 * @since     JDK1.1.6
 */
public final void defaultWriteObjectDelegate()
/* 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(),
                              fields);
        }
    } catch(IOException ioe) {
        bridge.throwException(ioe);
    }
}
 
Example #4
Source Project: TencentKona-8   Author: Tencent   File: InputStreamHook.java    License: GNU General Public License v2.0 6 votes vote down vote up
public ObjectInputStream.GetField readFields()
    throws IOException, ClassNotFoundException, NotActiveException {

    HashMap fieldValueMap = new HashMap();

    // We were treating readFields same as defaultReadObject. It is
    // incorrect if the state is readOptionalData. If this line
    // is uncommented, it will throw a stream corrupted exception.
    // _REVISIT_: The ideal fix would be to add a new state. In
    // writeObject user may do one of the following
    // 1. Call defaultWriteObject()
    // 2. Put out optional fields
    // 3. Call writeFields
    // We have the state defined for (1) and (2) but not for (3), so
    // we should ideally introduce a new state for 3 and have the
    // beginDefaultReadObject do nothing.
    //readObjectState.beginDefaultReadObject(this);

    readFields(fieldValueMap);

    readObjectState.endDefaultReadObject(this);

    return new HookGetFields(fieldValueMap);
}
 
Example #5
Source Project: jdk8u60   Author: chenghanpeng   File: IIOPOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Override the actions of the final method "defaultWriteObject()"
 * in ObjectOutputStream.
 * @since     JDK1.1.6
 */
public final void defaultWriteObjectDelegate()
/* 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(),
                              fields);
        }
    } catch(IOException ioe) {
        bridge.throwException(ioe);
    }
}
 
Example #6
Source Project: jdk8u60   Author: chenghanpeng   File: InputStreamHook.java    License: GNU General Public License v2.0 6 votes vote down vote up
public ObjectInputStream.GetField readFields()
    throws IOException, ClassNotFoundException, NotActiveException {

    HashMap fieldValueMap = new HashMap();

    // We were treating readFields same as defaultReadObject. It is
    // incorrect if the state is readOptionalData. If this line
    // is uncommented, it will throw a stream corrupted exception.
    // _REVISIT_: The ideal fix would be to add a new state. In
    // writeObject user may do one of the following
    // 1. Call defaultWriteObject()
    // 2. Put out optional fields
    // 3. Call writeFields
    // We have the state defined for (1) and (2) but not for (3), so
    // we should ideally introduce a new state for 3 and have the
    // beginDefaultReadObject do nothing.
    //readObjectState.beginDefaultReadObject(this);

    readFields(fieldValueMap);

    readObjectState.endDefaultReadObject(this);

    return new HookGetFields(fieldValueMap);
}
 
Example #7
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: IIOPOutputStream.java    License: MIT License 6 votes vote down vote up
/**
 * Override the actions of the final method "defaultWriteObject()"
 * in ObjectOutputStream.
 * @since     JDK1.1.6
 */
public final void defaultWriteObjectDelegate()
/* 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(),
                              fields);
        }
    } catch(IOException ioe) {
        bridge.throwException(ioe);
    }
}
 
Example #8
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: InputStreamHook.java    License: MIT License 6 votes vote down vote up
public ObjectInputStream.GetField readFields()
    throws IOException, ClassNotFoundException, NotActiveException {

    HashMap fieldValueMap = new HashMap();

    // We were treating readFields same as defaultReadObject. It is
    // incorrect if the state is readOptionalData. If this line
    // is uncommented, it will throw a stream corrupted exception.
    // _REVISIT_: The ideal fix would be to add a new state. In
    // writeObject user may do one of the following
    // 1. Call defaultWriteObject()
    // 2. Put out optional fields
    // 3. Call writeFields
    // We have the state defined for (1) and (2) but not for (3), so
    // we should ideally introduce a new state for 3 and have the
    // beginDefaultReadObject do nothing.
    //readObjectState.beginDefaultReadObject(this);

    readFields(fieldValueMap);

    readObjectState.endDefaultReadObject(this);

    return new HookGetFields(fieldValueMap);
}
 
Example #9
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: IIOPOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Override the actions of the final method "defaultWriteObject()"
 * in ObjectOutputStream.
 * @since     JDK1.1.6
 */
public final void defaultWriteObjectDelegate()
/* 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(),
                              fields);
        }
    } catch(IOException ioe) {
        bridge.throwException(ioe);
    }
}
 
Example #10
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: InputStreamHook.java    License: GNU General Public License v2.0 6 votes vote down vote up
public ObjectInputStream.GetField readFields()
    throws IOException, ClassNotFoundException, NotActiveException {

    HashMap fieldValueMap = new HashMap();

    // We were treating readFields same as defaultReadObject. It is
    // incorrect if the state is readOptionalData. If this line
    // is uncommented, it will throw a stream corrupted exception.
    // _REVISIT_: The ideal fix would be to add a new state. In
    // writeObject user may do one of the following
    // 1. Call defaultWriteObject()
    // 2. Put out optional fields
    // 3. Call writeFields
    // We have the state defined for (1) and (2) but not for (3), so
    // we should ideally introduce a new state for 3 and have the
    // beginDefaultReadObject do nothing.
    //readObjectState.beginDefaultReadObject(this);

    readFields(fieldValueMap);

    readObjectState.endDefaultReadObject(this);

    return new HookGetFields(fieldValueMap);
}
 
Example #11
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: IIOPOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Override the actions of the final method "defaultWriteObject()"
 * in ObjectOutputStream.
 * @since     JDK1.1.6
 */
public final void defaultWriteObjectDelegate()
/* 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(),
                              fields);
        }
    } catch(IOException ioe) {
        bridge.throwException(ioe);
    }
}
 
Example #12
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: InputStreamHook.java    License: GNU General Public License v2.0 6 votes vote down vote up
public ObjectInputStream.GetField readFields()
    throws IOException, ClassNotFoundException, NotActiveException {

    HashMap fieldValueMap = new HashMap();

    // We were treating readFields same as defaultReadObject. It is
    // incorrect if the state is readOptionalData. If this line
    // is uncommented, it will throw a stream corrupted exception.
    // _REVISIT_: The ideal fix would be to add a new state. In
    // writeObject user may do one of the following
    // 1. Call defaultWriteObject()
    // 2. Put out optional fields
    // 3. Call writeFields
    // We have the state defined for (1) and (2) but not for (3), so
    // we should ideally introduce a new state for 3 and have the
    // beginDefaultReadObject do nothing.
    //readObjectState.beginDefaultReadObject(this);

    readFields(fieldValueMap);

    readObjectState.endDefaultReadObject(this);

    return new HookGetFields(fieldValueMap);
}
 
Example #13
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: IIOPOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Override the actions of the final method "defaultWriteObject()"
 * in ObjectOutputStream.
 * @since     JDK1.1.6
 */
public final void defaultWriteObjectDelegate()
/* 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(),
                              fields);
        }
    } catch(IOException ioe) {
        bridge.throwException(ioe);
    }
}
 
Example #14
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: InputStreamHook.java    License: GNU General Public License v2.0 6 votes vote down vote up
public ObjectInputStream.GetField readFields()
    throws IOException, ClassNotFoundException, NotActiveException {

    HashMap fieldValueMap = new HashMap();

    // We were treating readFields same as defaultReadObject. It is
    // incorrect if the state is readOptionalData. If this line
    // is uncommented, it will throw a stream corrupted exception.
    // _REVISIT_: The ideal fix would be to add a new state. In
    // writeObject user may do one of the following
    // 1. Call defaultWriteObject()
    // 2. Put out optional fields
    // 3. Call writeFields
    // We have the state defined for (1) and (2) but not for (3), so
    // we should ideally introduce a new state for 3 and have the
    // beginDefaultReadObject do nothing.
    //readObjectState.beginDefaultReadObject(this);

    readFields(fieldValueMap);

    readObjectState.endDefaultReadObject(this);

    return new HookGetFields(fieldValueMap);
}
 
Example #15
Source Project: hottub   Author: dsrg-uoft   File: IIOPOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Override the actions of the final method "defaultWriteObject()"
 * in ObjectOutputStream.
 * @since     JDK1.1.6
 */
public final void defaultWriteObjectDelegate()
/* 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(),
                              fields);
        }
    } catch(IOException ioe) {
        bridge.throwException(ioe);
    }
}
 
Example #16
Source Project: hottub   Author: dsrg-uoft   File: InputStreamHook.java    License: GNU General Public License v2.0 6 votes vote down vote up
public ObjectInputStream.GetField readFields()
    throws IOException, ClassNotFoundException, NotActiveException {

    HashMap fieldValueMap = new HashMap();

    // We were treating readFields same as defaultReadObject. It is
    // incorrect if the state is readOptionalData. If this line
    // is uncommented, it will throw a stream corrupted exception.
    // _REVISIT_: The ideal fix would be to add a new state. In
    // writeObject user may do one of the following
    // 1. Call defaultWriteObject()
    // 2. Put out optional fields
    // 3. Call writeFields
    // We have the state defined for (1) and (2) but not for (3), so
    // we should ideally introduce a new state for 3 and have the
    // beginDefaultReadObject do nothing.
    //readObjectState.beginDefaultReadObject(this);

    readFields(fieldValueMap);

    readObjectState.endDefaultReadObject(this);

    return new HookGetFields(fieldValueMap);
}
 
Example #17
Source Project: openjdk-8-source   Author: keerath   File: IIOPOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Override the actions of the final method "defaultWriteObject()"
 * in ObjectOutputStream.
 * @since     JDK1.1.6
 */
public final void defaultWriteObjectDelegate()
/* 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(),
                              fields);
        }
    } catch(IOException ioe) {
        bridge.throwException(ioe);
    }
}
 
Example #18
Source Project: openjdk-8-source   Author: keerath   File: InputStreamHook.java    License: GNU General Public License v2.0 6 votes vote down vote up
public ObjectInputStream.GetField readFields()
    throws IOException, ClassNotFoundException, NotActiveException {

    HashMap fieldValueMap = new HashMap();

    // We were treating readFields same as defaultReadObject. It is
    // incorrect if the state is readOptionalData. If this line
    // is uncommented, it will throw a stream corrupted exception.
    // _REVISIT_: The ideal fix would be to add a new state. In
    // writeObject user may do one of the following
    // 1. Call defaultWriteObject()
    // 2. Put out optional fields
    // 3. Call writeFields
    // We have the state defined for (1) and (2) but not for (3), so
    // we should ideally introduce a new state for 3 and have the
    // beginDefaultReadObject do nothing.
    //readObjectState.beginDefaultReadObject(this);

    readFields(fieldValueMap);

    readObjectState.endDefaultReadObject(this);

    return new HookGetFields(fieldValueMap);
}
 
Example #19
Source Project: openjdk-8   Author: bpupadhyaya   File: IIOPOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Override the actions of the final method "defaultWriteObject()"
 * in ObjectOutputStream.
 * @since     JDK1.1.6
 */
public final void defaultWriteObjectDelegate()
/* 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(),
                              fields);
        }
    } catch(IOException ioe) {
        bridge.throwException(ioe);
    }
}
 
Example #20
Source Project: openjdk-8   Author: bpupadhyaya   File: InputStreamHook.java    License: GNU General Public License v2.0 6 votes vote down vote up
public ObjectInputStream.GetField readFields()
    throws IOException, ClassNotFoundException, NotActiveException {

    HashMap fieldValueMap = new HashMap();

    // We were treating readFields same as defaultReadObject. It is
    // incorrect if the state is readOptionalData. If this line
    // is uncommented, it will throw a stream corrupted exception.
    // _REVISIT_: The ideal fix would be to add a new state. In
    // writeObject user may do one of the following
    // 1. Call defaultWriteObject()
    // 2. Put out optional fields
    // 3. Call writeFields
    // We have the state defined for (1) and (2) but not for (3), so
    // we should ideally introduce a new state for 3 and have the
    // beginDefaultReadObject do nothing.
    //readObjectState.beginDefaultReadObject(this);

    readFields(fieldValueMap);

    readObjectState.endDefaultReadObject(this);

    return new HookGetFields(fieldValueMap);
}
 
Example #21
Source Project: red5-websocket   Author: Red5   File: SecureWebSocketConfiguration.java    License: Apache License 2.0 6 votes vote down vote up
public SslFilter getSslFilter() throws Exception {
    if (keystoreFile == null || truststoreFile == null) {
        throw new NotActiveException("Keystore or truststore are null");
    }
    SSLContext context = getSslContext();
    if (context == null) {
        throw new NotActiveException("SSLContext is null");
    }
    // create the ssl filter using server mode
    SslFilter sslFilter = new SslFilter(context);
    if (cipherSuites != null) {
        sslFilter.setEnabledCipherSuites(cipherSuites);
    }
    if (protocols != null) {
        if (log.isDebugEnabled()) {
            log.debug("Using these protocols: {}", Arrays.toString(protocols));
        }
        sslFilter.setEnabledProtocols(protocols);
    }
    return sslFilter;
}
 
Example #22
Source Project: j2objc   Author: google   File: OldObjectOutputStreamTest.java    License: Apache License 2.0 6 votes vote down vote up
public void test_putFields() throws Exception {
    /*
     * "SerializableTestHelper" is an object created for these tests with
     * two fields (Strings) and simple implementations of readObject and
     * writeObject which simply read and write the first field but not the
     * second one.
     */
    SerializableTestHelper sth;

    try {
        oos.putFields();
        fail("Test 1: NotActiveException expected.");
    } catch (NotActiveException e) {
        // Expected.
    }

    oos.writeObject(new SerializableTestHelper("Gabba", "Jabba"));
    oos.flush();
    ois = new ObjectInputStream(new ByteArrayInputStream(bao.toByteArray()));
    sth = (SerializableTestHelper) (ois.readObject());
    assertEquals("Test 2: readFields or writeFields failed; first field not set.",
            "Gabba", sth.getText1());
    assertNull("Test 3: readFields or writeFields failed; second field should not have been set.",
            sth.getText2());
}
 
Example #23
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: OutputStreamHook.java    License: Apache License 2.0 5 votes vote down vote up
public void writeFields()
    throws IOException {

    writeObjectState.defaultWriteObject(this);
    if (putFields != null) {
        putFields.write(this);
    } else {
        throw new NotActiveException("no current PutField object");
    }
}
 
Example #24
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: InputStreamHook.java    License: Apache License 2.0 5 votes vote down vote up
public void defaultReadObject()
    throws IOException, ClassNotFoundException, NotActiveException
{
    readObjectState.beginDefaultReadObject(this);

    defaultReadObjectDelegate();

    readObjectState.endDefaultReadObject(this);
}
 
Example #25
Source Project: TencentKona-8   Author: Tencent   File: OutputStreamHook.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void writeFields()
    throws IOException {

    writeObjectState.defaultWriteObject(this);
    if (putFields != null) {
        putFields.write(this);
    } else {
        throw new NotActiveException("no current PutField object");
    }
}
 
Example #26
Source Project: TencentKona-8   Author: Tencent   File: InputStreamHook.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void defaultReadObject()
    throws IOException, ClassNotFoundException, NotActiveException
{
    readObjectState.beginDefaultReadObject(this);

    defaultReadObjectDelegate();

    readObjectState.endDefaultReadObject(this);
}
 
Example #27
Source Project: jdk8u60   Author: chenghanpeng   File: OutputStreamHook.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void writeFields()
    throws IOException {

    writeObjectState.defaultWriteObject(this);
    if (putFields != null) {
        putFields.write(this);
    } else {
        throw new NotActiveException("no current PutField object");
    }
}
 
Example #28
Source Project: jdk8u60   Author: chenghanpeng   File: InputStreamHook.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void defaultReadObject()
    throws IOException, ClassNotFoundException, NotActiveException
{
    readObjectState.beginDefaultReadObject(this);

    defaultReadObjectDelegate();

    readObjectState.endDefaultReadObject(this);
}
 
Example #29
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: OutputStreamHook.java    License: MIT License 5 votes vote down vote up
public void writeFields()
    throws IOException {

    writeObjectState.defaultWriteObject(this);
    if (putFields != null) {
        putFields.write(this);
    } else {
        throw new NotActiveException("no current PutField object");
    }
}
 
Example #30
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: InputStreamHook.java    License: MIT License 5 votes vote down vote up
public void defaultReadObject()
    throws IOException, ClassNotFoundException, NotActiveException
{
    readObjectState.beginDefaultReadObject(this);

    defaultReadObjectDelegate();

    readObjectState.endDefaultReadObject(this);
}