Example usage for java.io ObjectInputStream defaultReadObject

List of usage examples for java.io ObjectInputStream defaultReadObject

Introduction

In this page you can find the example usage for java.io ObjectInputStream defaultReadObject.

Prototype

public void defaultReadObject() throws IOException, ClassNotFoundException 

Source Link

Document

Read the non-static and non-transient fields of the current class from this stream.

Usage

From source file:org.apache.flink.streaming.connectors.kafka.api.persistent.PersistentKafkaSource.java

private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    Properties props = (Properties) in.readObject();
    consumerConfig = new ConsumerConfig(props);
}

From source file:org.betaconceptframework.astroboa.model.impl.ComplexCmsRootPropertyImpl.java

private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {

    //Deserialize bean normally
    ois.defaultReadObject();

    //Inject lazyLoader
    LazyLoader lazyLoader = getLazyLoader();

    if (lazyLoader != null) {

        lazyLoader.activateClientContextForAuthenticationToken(authenticationToken);

        //In this case fullPropertyDefinitionPath is the name of content type
        ContentObjectTypeDefinition contentTypeDefinition = (ContentObjectTypeDefinition) lazyLoader
                .getDefinitionService().getCmsDefinition(fullPropertyDefinitionPath,
                        ResourceRepresentationType.DEFINITION_INSTANCE, false);

        if (contentTypeDefinition != null) {
            setPropertyDefinition(new ComplexCmsPropertyDefinitionImpl(contentTypeDefinition.getQualifiedName(),
                    ((LocalizableCmsDefinitionImpl) contentTypeDefinition).cloneDescription(),
                    ((LocalizableCmsDefinitionImpl) contentTypeDefinition).cloneDisplayName(), false, false,
                    true, null, null, null, null,
                    ((ContentObjectTypeDefinitionImpl) contentTypeDefinition)
                            .getComplexPropertyDefinitionHelper(),
                    ((ContentObjectTypeDefinitionImpl) contentTypeDefinition).getDefinitionFileURI(),
                    contentTypeDefinition.getPropertyPathsWhoseValuesCanBeUsedAsALabel(), true, null,
                    contentTypeDefinition.getName(), true));
        }//w  w w .j a v  a  2 s  . com

        //Load all aspects
        aspectDefinitions = new HashMap<String, ComplexCmsPropertyDefinition>();

        if (aspects != null) {

            for (String aspect : aspects) {
                try {
                    loadAspectDefinition(aspect);
                } catch (Exception e) {
                    throw new IOException(e);
                }
            }
        }
    }
}

From source file:org.nuxeo.ecm.core.api.security.impl.ACPImpl.java

private void readObject(ObjectInputStream in) throws ClassNotFoundException, IOException {
    // always perform the default de-serialization first
    in.defaultReadObject();
    // initialize cache to avoid NPE
    cache = new HashMap<String, Access>();
}

From source file:net.sf.jasperreports.engine.base.JRBaseChartPlot.java

@SuppressWarnings("deprecation")
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_3) {
        backgroundAlphaFloat = backgroundAlpha;
        foregroundAlphaFloat = foregroundAlpha;
        labelRotationDouble = labelRotation;
    }/*from  w  w w.j a v a2  s.c o m*/
    if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_4_1_3) {
        orientationValue = PlotOrientationEnum.getByValue(orientation);

        orientation = null;
    }
}

From source file:org.apache.velocity.runtime.parser.node.SimpleNode.java

private void readObject(java.io.ObjectInputStream ois) throws IOException, ClassNotFoundException {
    ois.defaultReadObject();
}

From source file:com.phoenixst.plexus.examples.CompleteTree.java

private void readObject(ObjectInputStream in) throws ClassNotFoundException, IOException {
    in.defaultReadObject();
    if (height < 0) {
        throw new InvalidObjectException("A CompleteTree must have height at least 0: " + height);
    }/*w  w  w . j ava  2  s  . c o  m*/
    if (numChildren < 1) {
        throw new InvalidObjectException(
                "A CompleteTree must have at least 1 child per internal node: " + numChildren);
    }

    int numNodes = 1;
    if (numChildren == 1) {
        numInternalNodes = height;
        numNodes = height + 1;
    } else {
        numNodes = 1;
        for (int i = 0; i < height; i++) {
            numNodes *= numChildren;
        }
        numInternalNodes = (numNodes - 1) / (numChildren - 1);
        numNodes = (numNodes * numChildren - 1) / (numChildren - 1);
    }

    if (numNodes != getNodeSize()) {
        throw new InvalidObjectException("Calculated number of nodes does not match.");
    }
}

From source file:org.pentaho.plugin.jfreereport.reportcharts.backport.XYDotRenderer.java

/**
 * Provides serialization support./*  ww w .j  a  va 2  s. c  o  m*/
 *
 * @param stream the input stream.
 * @throws IOException            if there is an I/O error.
 * @throws ClassNotFoundException if there is a classpath problem.
 */
private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException {
    stream.defaultReadObject();
    this.legendShape = SerialUtilities.readShape(stream);
}

From source file:net.sf.jasperreports.engine.JRPropertiesMap.java

private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();

    if (propertiesList == null && propertiesMap != null)// an instance from an old version has been deserialized
    {//from   w w w  .  j  a  v a2s .c o  m
        //recreate the properties list and map
        propertiesList = new ArrayList<String>(propertiesMap.keySet());
        propertiesMap = new HashMap<String, String>(propertiesMap);
    }
}

From source file:blue.mixer.Channel.java

private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
    stream.defaultReadObject();

    levelParameter.addParameterListener(this);
}

From source file:org.seasar.mayaa.impl.engine.processor.TemplateProcessorSupport.java

private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    String originalNodeID = in.readUTF();
    String processorUniqueID = in.readUTF();
    QName qName = QNameImpl.getInstance(URIImpl.getInstance(in.readUTF()), in.readUTF());
    LibraryManager libraryManager = ProviderUtil.getLibraryManager();
    setProcessorDefinition(libraryManager.getProcessorDefinition(qName));

    String injectedNodeID = in.readUTF();
    NodeResolveListener listener = new TemplateProcessorSupportOriginalNodeListener(this);
    findNodeResolver().registResolveNodeListener(originalNodeID, listener);

    if (UNIQUENESS_MARK.equals(injectedNodeID)) {
        _injectedNode = (SpecificationNode) in.readObject();
    } else {/*from   w  w  w. jav  a2s.co m*/
        listener = new TemplateProcessorSupportInjectedNodeListener(this);
        findNodeResolver().registResolveNodeListener(injectedNodeID, listener);
    }

    ProcessorReferenceResolver resolver = findProcessorResolver();
    resolver.processorLoaded(processorUniqueID, this);

    // readResolve?extends??????????????
    if (_children != null) {
        for (int i = _children.size() - 1; i >= 0; i--) {
            ProcessorTreeWalker child = (ProcessorTreeWalker) _children.get(i);
            child.setParentProcessor(this);
        }
    }
    LOG.debug("templateProcessorSupport loaded");
}