Examples of SafeObjectInputStream


Examples of org.apache.axis2.context.externalize.SafeObjectInputStream

     * @param in The stream to read the object contents from
     * @throws IOException
     * @throws ClassNotFoundException
     */
    public void readExternal(ObjectInput inObject) throws IOException, ClassNotFoundException {
        SafeObjectInputStream in = SafeObjectInputStream.install(inObject);
        // set the flag to indicate that the message context is being
        // reconstituted and will need to have certain object references
        // to be reconciled with the current engine setup
        needsToBeReconciled = true;

        // trace point
        log.trace(myClassName + ":readExternal():  BEGIN  bytes available in stream [" +
                in.available() + "]  ");

        //---------------------------------------------------------
        // object level identifiers
        //---------------------------------------------------------

        // serialization version ID
        long suid = in.readLong();

        // revision ID
        int revID = in.readInt();

        // make sure the object data is in a version we can handle
        if (suid != serialVersionUID) {
            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_SUID);
        }

        // make sure the object data is in a revision level we can handle
        if (revID != REVISION_2) {
            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_REVID);
        }

        //---------------------------------------------------------
        // various simple fields
        //---------------------------------------------------------

        long time = in.readLong();
        setLastTouchedTime(time);

        isComplete = in.readBoolean();
        key = (String) in.readObject();
        logCorrelationIDString = (String) in.readObject();
      
        // trace point
        if (log.isTraceEnabled()) {
            log.trace(myClassName + ":readExternal():  reading input stream for [" +
                      getLogCorrelationIDString() + "]  ");
        }

        //---------------------------------------------------------
        // properties
        //---------------------------------------------------------
        in.readUTF(); // read marker
        properties = in.readMap(new HashMapUpdateLockable());

        //---------------------------------------------------------
        // axis operation meta data
        //---------------------------------------------------------

        // axisOperation is not usable until the meta data has been reconciled
        axisOperation = null;
        in.readUTF(); // read marker
        metaAxisOperation = (MetaDataEntry) in.readObject();

        //---------------------------------------------------------
        // axis service meta data
        //---------------------------------------------------------
        // axisService is not usable until the meta data has been reconciled
        in.readUTF(); // read marker
        metaAxisService = (MetaDataEntry) in.readObject();

        //---------------------------------------------------------
        // parent
        //---------------------------------------------------------
        // ServiceContext is not usable until it has been activated
        in.readUTF(); // read marker
        metaParent = (ServiceContext) in.readObject();

        //---------------------------------------------------------
        // HashMap messageContexts table
        //---------------------------------------------------------

        // set to empty until this can be activiated
        messageContexts = new HashMap();
        in.readUTF(); // read marker
        workingSet = in.readHashMap();
        in.readUTF(); // read marker
        metaMessageContextMap = in.readHashMap();
       
        //---------------------------------------------------------
        // done
        //---------------------------------------------------------
    }
View Full Code Here

Examples of org.apache.axis2.context.externalize.SafeObjectInputStream

     * @param in The stream to read the object contents from
     * @throws IOException
     * @throws ClassNotFoundException
     */
    public void readExternal(ObjectInput inObject) throws IOException, ClassNotFoundException {
        SafeObjectInputStream in = SafeObjectInputStream.install(inObject);
        // set the flag to indicate that the message context is being
        // reconstituted and will need to have certain object references
        // to be reconciled with the current engine setup
        needsToBeReconciled = true;

        // trace point
        log.trace(myClassName + ":readExternal():  BEGIN  bytes available in stream [" +
                in.available() + "]  ");

        //---------------------------------------------------------
        // object level identifiers
        //---------------------------------------------------------

        // serialization version ID
        long suid = in.readLong();

        // revision ID
        int revID = in.readInt();

        // make sure the object data is in a version we can handle
        if (suid != serialVersionUID) {
            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_SUID);
        }

        // make sure the object data is in a revision level we can handle
        if (revID != REVISION_2) {
            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_REVID);
        }

        //---------------------------------------------------------
        // various simple fields
        //---------------------------------------------------------

        long time = in.readLong();
        setLastTouchedTime(time);

        isComplete = in.readBoolean();
        key = (String) in.readObject();
        logCorrelationIDString = (String) in.readObject();
      
        // trace point
        if (log.isTraceEnabled()) {
            log.trace(myClassName + ":readExternal():  reading input stream for [" +
                      getLogCorrelationIDString() + "]  ");
        }

        //---------------------------------------------------------
        // properties
        //---------------------------------------------------------
        in.readUTF(); // read marker
        properties = in.readMap(new HashMap());

        //---------------------------------------------------------
        // axis operation meta data
        //---------------------------------------------------------

        // axisOperation is not usable until the meta data has been reconciled
        axisOperation = null;
        in.readUTF(); // read marker
        metaAxisOperation = (MetaDataEntry) in.readObject();

        //---------------------------------------------------------
        // axis service meta data
        //---------------------------------------------------------
        // axisService is not usable until the meta data has been reconciled
        in.readUTF(); // read marker
        metaAxisService = (MetaDataEntry) in.readObject();

        //---------------------------------------------------------
        // parent
        //---------------------------------------------------------
        // ServiceContext is not usable until it has been activated
        in.readUTF(); // read marker
        metaParent = (ServiceContext) in.readObject();

        //---------------------------------------------------------
        // HashMap messageContexts table
        //---------------------------------------------------------

        // set to empty until this can be activiated
        messageContexts = new HashMap();
        in.readUTF(); // read marker
        workingSet = in.readHashMap();
        in.readUTF(); // read marker
        metaMessageContextMap = in.readHashMap();
       
        //---------------------------------------------------------
        // done
        //---------------------------------------------------------
    }
View Full Code Here

Examples of org.apache.axis2.context.externalize.SafeObjectInputStream

     * @param in The stream to read the object contents from
     * @throws IOException
     * @throws ClassNotFoundException
     */
    public void readExternal(ObjectInput inObject) throws IOException, ClassNotFoundException {
        SafeObjectInputStream in = SafeObjectInputStream.install(inObject);
        // serialization version ID
        long suid = in.readLong();

        // revision ID
        int revID = in.readInt();

        // make sure the object data is in a version we can handle
        if (suid != serialVersionUID) {
            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_SUID);
        }

        // make sure the object data is in a revision level we can handle
        if (revID != REVISION_2) {
            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_REVID);
        }

        //---------------------------------------------------------
        // various strings
        //---------------------------------------------------------

        // String relationshipType
        relationshipType = (String)in.readObject();

        // String value
        value = (String) in.readObject();

        //---------------------------------------------------------
        // collections and lists
        //---------------------------------------------------------

        // ArrayList extensibilityAttributes
        extensibilityAttributes = in.readArrayList();
    }
View Full Code Here

Examples of org.apache.axis2.context.externalize.SafeObjectInputStream

    /**
     * Read the EPR to the specified InputStream.
     */
    public void readExternal(java.io.ObjectInput inObject)
            throws IOException, ClassNotFoundException {
        SafeObjectInputStream in = SafeObjectInputStream.install(inObject);
       
        // revision ID
        int revID = in.readInt();
       
        // make sure the object data is in a revision level we can handle
        if (revID != REVISION_2) {
            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_REVID);
        }
       
        // String object id
        logCorrelationIDString = (String) in.readObject();

        // Read xml content
        in.readUTF(); // read marker
        int numBytes = in.readInt();

        byte[] serBytes = new byte[numBytes];

        // read the data from the input stream

        int bytesRead = 0;
        int numberOfBytesLastRead;

        while (bytesRead < numBytes) {
            numberOfBytesLastRead = in.read(serBytes, bytesRead, numBytes - bytesRead);

            if (numberOfBytesLastRead == -1) {
                // TODO: What should we do if the reconstitution fails?
                // For now, log the event and throw an exception
                if (log.isDebugEnabled()) {
                    log.debug("readObject(): EPR logCorrelationID ["+logCorrelationIDString+"] "   
                            + " ***WARNING*** unexpected end to data:    data read from input stream ["
                            + bytesRead + "]    expected data size [" + numBytes + "]");
                }

                IOException ioe = new IOException("Unable to deserialize the EndpointReference with logCorrelationID ["
                                                  +logCorrelationIDString+"]"
                                                  +"  Cause: Unexpected end to data from input stream");

                throw ioe;
            }

            bytesRead += numberOfBytesLastRead;
        }


        if (bytesRead == 0) {
            IOException ioe = new IOException("Unable to deserialize the EndpointReference with logCorrelationID ["
                                              +logCorrelationIDString+"]"
                                              +"  Cause: No data from input stream");

            throw ioe;
        }
        in.readUTF(); // read marker

        ByteArrayInputStream bais = new ByteArrayInputStream(serBytes);

        if (log.isDebugEnabled()) {
            String content = new String(serBytes);
View Full Code Here

Examples of org.apache.axis2.context.externalize.SafeObjectInputStream

        FileInputStream inStream = new FileInputStream(theFile);

        // attach a stream capable of reading objects from the
        // stream connected to the file
        ObjectInputStream inObjStream = new ObjectInputStream(inStream);
                                SafeObjectInputStream in =
                                    SafeObjectInputStream.install(inObjStream);

        // try to restore the options
                log.debug("ObjectSaveTest:testObjectSerializable(): restoring .....");
        restored = false;
                                MetaDataEntry restored_obj = (MetaDataEntry) in.readObject();
        inObjStream.close();
        inStream.close();

        restored = true;
                log.debug(
View Full Code Here

Examples of org.apache.axis2.context.externalize.SafeObjectInputStream

        FileInputStream inStream = new FileInputStream(theFile);

        // attach a stream capable of reading objects from the
        // stream connected to the file
        ObjectInputStream inObjStream = new ObjectInputStream(inStream);
                                SafeObjectInputStream in =
                                    SafeObjectInputStream.install(inObjStream);

        // try to restore the options
                log.debug("ObjectSaveTest:testObjectSerializable(): restoring .....");
        restored = false;
                                Object restored_obj = in.readObject();
        inObjStream.close();
        inStream.close();

        restored = true;
                log.debug(
View Full Code Here

Examples of org.apache.axis2.context.externalize.SafeObjectInputStream

        FileInputStream inStream = new FileInputStream(theFile);

        // attach a stream capable of reading objects from the
        // stream connected to the file
        ObjectInputStream inObjStream = new ObjectInputStream(inStream);
                                SafeObjectInputStream in =
                                    SafeObjectInputStream.install(inObjStream);

        // try to restore the options
                log.debug("ObjectSaveTest:testArrayList(): restoring .....");
        restored = false;
                                restored_obj = in.readArrayList();
        inObjStream.close();
        inStream.close();

        restored = true;
                log.debug("ObjectSaveTest:testArrayList(): ....restored operation completed.....");
View Full Code Here

Examples of org.apache.axis2.context.externalize.SafeObjectInputStream

        FileInputStream inStream = new FileInputStream(theFile);

        // attach a stream capable of reading objects from the
        // stream connected to the file
        ObjectInputStream inObjStream = new ObjectInputStream(inStream);
                                SafeObjectInputStream in =
                                    SafeObjectInputStream.install(inObjStream);

        // try to restore the options
                log.debug("ObjectSaveTest:testHashMap(): restoring .....");
        restored = false;
                                restored_obj = in.readHashMap();
        inObjStream.close();
        inStream.close();

        restored = true;
                log.debug("ObjectSaveTest:testHashMap(): ....restored operation completed.....");
View Full Code Here

Examples of org.apache.axis2.context.externalize.SafeObjectInputStream

        FileInputStream inStream = new FileInputStream(theFile);

        // attach a stream capable of reading objects from the
        // stream connected to the file
        ObjectInputStream inObjStream = new ObjectInputStream(inStream);
                                SafeObjectInputStream in =
                                    SafeObjectInputStream.install(inObjStream);

        // try to restore the options
                log.debug("ObjectSaveTest:testLinkedList(): restoring .....");
        restored = false;
                                restored_obj = in.readLinkedList();
        inObjStream.close();
        inStream.close();

        restored = true;
                log.debug("ObjectSaveTest:testLinkedList(): ....restored operation completed.....");
View Full Code Here

Examples of org.apache.axis2.context.externalize.SafeObjectInputStream

     * @param in The stream to read the object contents from
     * @throws IOException
     * @throws ClassNotFoundException
     */
    public void readExternal(ObjectInput inObject) throws IOException, ClassNotFoundException {
        SafeObjectInputStream in = SafeObjectInputStream.install(inObject);
        // trace point
        if (log.isTraceEnabled()) {
            log.trace(myClassName + ":readExternal():  BEGIN  bytes available in stream [" +
                    in.available() + "]  ");
        }

        // serialization version ID
        long suid = in.readLong();

        // revision ID
        int revID = in.readInt();

        // make sure the object data is in a version we can handle
        if (suid != serialVersionUID) {
            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_SUID);
        }

        // make sure the object data is in a revision level we can handle
        if (revID != REVISION_2) {
            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_REVID);
        }

        //---------------------------------------------------------
        // various simple fields
        //---------------------------------------------------------
        long time = in.readLong();
        setLastTouchedTime(time);

        sessionContextTimeoutInterval = in.readLong();
        cookieID = (String) in.readObject();

        //---------------------------------------------------------
        // properties
        //---------------------------------------------------------
        properties = in.readMap(new HashMap());

        //---------------------------------------------------------
        // "nested"
        //---------------------------------------------------------

        // parent
        parent = (AbstractContext) in.readObject();

        //---------------------------------------------------------
        // done
        //---------------------------------------------------------

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.