public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   this.element1 = (T) in.readObject();
   this.element2 = (T) in.readObject();
   this.element3 = (T) in.readObject();
   this.element4 = (T) in.readObject();
   this.element5 = (T) in.readObject();
 }
Ejemplo n.º 2
0
  /** Restores this <code>DataFlavor</code> from a Serialized state. */
  public synchronized void readExternal(ObjectInput is) throws IOException, ClassNotFoundException {
    String rcn = null;
    mimeType = (MimeType) is.readObject();

    if (mimeType != null) {
      humanPresentableName = mimeType.getParameter("humanPresentableName");
      mimeType.removeParameter("humanPresentableName");
      rcn = mimeType.getParameter("class");
      if (rcn == null) {
        throw new IOException("no class parameter specified in: " + mimeType);
      }
    }

    try {
      representationClass = (Class) is.readObject();
    } catch (OptionalDataException ode) {
      if (!ode.eof || ode.length != 0) {
        throw ode;
      }
      // Ensure backward compatibility.
      // Old versions didn't write the representation class to the stream.
      if (rcn != null) {
        representationClass = DataFlavor.tryToLoadClass(rcn, getClass().getClassLoader());
      }
    }
  }
Ejemplo n.º 3
0
  /** Create the serversocket and use its stream to receive serialized objects */
  public static void main(String args[]) {

    ServerSocket ser = null;
    Socket soc = null;
    String str = null;
    Date d = null;

    try {
      ser = new ServerSocket(8020);
      /*
       * This will wait for a connection to be made to this socket.
       */
      soc = ser.accept();
      InputStream o = soc.getInputStream();
      ObjectInput s = new ObjectInputStream(o);
      str = (String) s.readObject();
      d = (Date) s.readObject();
      s.close();

      // print out what we just received
      System.out.println(str);
      System.out.println(d);
    } catch (Exception e) {
      System.out.println(e.getMessage());
      System.out.println("Error during serialization");
      System.exit(1);
    }
  }
 /*     */ public CompiledEstimator(ObjectInput in)
     /*     */ throws ClassNotFoundException, IOException
       /*     */ {
   /* 144 */ this.mTokenCategorizer = ((TokenCategorizer) in.readObject());
   /*     */
   /* 146 */ this.mTagSymbolTable = ((SymbolTable) in.readObject());
   /* 147 */ this.mTokenSymbolTable = ((SymbolTable) in.readObject());
   /*     */
   /* 150 */ this.mTagTrie = new EstimatorTrie(in);
   /* 151 */ this.mTokenTrie = new EstimatorTrie(in);
   /* 152 */ this.mLogUniformVocabEstimate = in.readDouble();
   /*     */
   /* 154 */ int numSymbols = this.mTagSymbolTable.numSymbols();
   /* 155 */ this.mConvertToInterior = new int[numSymbols];
   /* 156 */ this.mCannotFollow = new boolean[numSymbols][numSymbols];
   /* 157 */ int numTags = this.mTagSymbolTable.numSymbols();
   /* 158 */ List starts = new ArrayList();
   /* 159 */ List interiors = new ArrayList();
   /* 160 */ for (int tagID = 0; tagID < numTags; tagID++) {
     /* 161 */ String tag = idToTag(tagID);
     /* 162 */ this.mConvertToInterior[tagID] = tagToInteriorID(tag);
     /* 163 */ if (tagID != this.mConvertToInterior[tagID]) {
       /* 164 */ interiors.add(Integer.valueOf(this.mConvertToInterior[tagID]));
       /* 165 */ starts.add(Integer.valueOf(tagID));
       /*     */ }
     /* 167 */ for (int tagMinus1ID = 0; tagMinus1ID < numTags; tagMinus1ID++) {
       /* 168 */ this.mCannotFollow[tagID][tagMinus1ID] =
           Tags.illegalSequence(idToTag(tagMinus1ID), tag);
       /*     */ }
     /*     */ }
   /* 171 */ this.mStart = convertToIntArray(starts);
   /* 172 */ this.mInterior = convertToIntArray(interiors);
   /*     */ }
Ejemplo n.º 5
0
 @Override
 public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
   super.readExternal(in);
   this.key = (Key) in.readObject();
   this.text = (TextKey) in.readObject();
   this.nextEvent = (Event<?>) in.readObject();
 }
Ejemplo n.º 6
0
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    storeId = (String) in.readObject();
    store = (TripleStore) in.readObject();
    tripleFactory = (TripleFactory) in.readObject();

    setObject(in.readObject());
  }
Ejemplo n.º 7
0
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   factHandle = (InternalFactHandle) in.readObject();
   removeLogical = in.readBoolean();
   updateEqualsMap = in.readBoolean();
   ruleOrigin = (Rule) in.readObject();
   leftTuple = (LeftTuple) in.readObject();
 }
Ejemplo n.º 8
0
 @SuppressWarnings("unchecked")
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   super.readExternal(in);
   entryPoint = (EntryPoint) in.readObject();
   objectTypeNodes = (Map<ObjectType, ObjectTypeNode>) in.readObject();
   unlinkingEnabled = in.readBoolean();
 }
Ejemplo n.º 9
0
  @Override
  public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
    final byte version = in.readByte(); // future use

    final ClientMetaData client = new ClientMetaData();
    final EJBMetaDataImpl ejb = new EJBMetaDataImpl();
    final ServerMetaData server = new ServerMetaData();

    client.setMetaData(metaData);
    client.readExternal(in);

    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    if (classLoader == null) {
      classLoader = this.getClass().getClassLoader();
    }

    ejb.homeClass = loadClass(classLoader, (String) in.readObject());
    ejb.remoteClass = loadClass(classLoader, (String) in.readObject());
    ejb.keyClass = loadClass(classLoader, (String) in.readObject());
    ejb.type = in.readByte();
    ejb.deploymentID = in.readUTF();
    ejb.deploymentCode = in.readShort();

    server.setMetaData(metaData);
    server.readExternal(in);

    handler = EJBHomeHandler.createEJBHomeHandler(ejb, server, client, null);
    ejbHomeProxy = handler.createEJBHomeProxy();
  }
Ejemplo n.º 10
0
  /** Reads this object from the specified stream */
  public void readExternal(java.io.ObjectInput oi)
      throws java.io.IOException, ClassNotFoundException {
    org.netbeans.modules.form.FormUtils.DEBUG(">> FormManager: readExternal: START"); // NOI18N
    org.netbeans.modules.form.FormUtils.DEBUG(
        "?? FormManager: readExternal: expecting NbVersion"); // NOI18N
    // check the version
    NbVersion classVersion = (NbVersion) oi.readObject();
    if (!nbClassVersion.isCompatible(classVersion))
      throw new NbVersionNotCompatibleException(classVersion, nbClassVersion);
    org.netbeans.modules.form.FormUtils.DEBUG(
        "** FormManager: readExternal: loaded: " + classVersion); // NOI18N

    org.netbeans.modules.form.FormUtils.DEBUG(
        "?? FormManager: readExternal: expecting RADFormNode"); // NOI18N
    Object o = oi.readObject();
    org.netbeans.modules.form.FormUtils.DEBUG(
        "** FormManager: readExternal: loaded: " + o); // NOI18N
    rootNode = (RADFormNode) o;
    org.netbeans.modules.form.FormUtils.DEBUG(
        "?? FormManager: readExternal: expecting DesignForm"); // NOI18N
    Object o2 = oi.readObject();
    org.netbeans.modules.form.FormUtils.DEBUG(
        "** FormManager: readExternal: loaded: " + o2); // NOI18N
    designForm = (DesignForm) o2;
    org.netbeans.modules.form.FormUtils.DEBUG("<< FormManager: readExternal: END"); // NOI18N
  }
Ejemplo n.º 11
0
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   super.readExternal(in);
   unwrapRightObject = in.readBoolean();
   accumulate = (Accumulate) in.readObject();
   resultConstraints = (AlphaNodeFieldConstraint[]) in.readObject();
   resultBinder = (BetaConstraints) in.readObject();
 }
Ejemplo n.º 12
0
 @Override
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   renderResult = (RenderResult) in.readObject();
   headers = (Map<String, String>) in.readObject();
   eager = in.readBoolean();
   resultContent = in.readUTF();
 }
Ejemplo n.º 13
0
  /** @see BTmsg#readExternal(java.io.ObjectInput) */
  @SuppressWarnings("unchecked")
  @Override
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    super.readExternal(in);

    // Read the number of assignments and the assignment to the first variable
    // so that we can instantiate the array of assignments
    this.offset = in.readShort();
    this.nbrAssignments = in.readShort();
    V val = (V) in.readObject();
    this.assignments =
        (V[][]) Array.newInstance(Array.newInstance(val.getClass(), 0).getClass(), nbrAssignments);
    final boolean externalize = val.externalize();

    // Read the assignments one by one
    for (int i = this.offset; i < this.nbrAssignments; i++) {
      short nbrVars = in.readShort();
      V[] assignment = (V[]) Array.newInstance(val.getClass(), nbrVars);
      this.assignments[i] = assignment;
      for (int j = nbrVars - 1; j >= 0; j--) {
        if (externalize) {
          val = val.getZero();
          val.readExternal(in);
          assignment[j] = (V) val.readResolve();
        } else assignment[j] = (V) in.readObject();
      }
    }

    this.cost = (U) in.readObject();
  }
Ejemplo n.º 14
0
  /**
   * Handles the read serialization of the Package. Patterns in Rules may reference generated data
   * which cannot be serialized by default methods. The Package uses PackageCompilationData to hold
   * a reference to the generated bytecode; which must be restored before any Rules. A custom
   * ObjectInputStream, able to resolve classes against the bytecode in the PackageCompilationData,
   * is used to restore the Rules.
   */
  public void doReadExternal(final ObjectInput stream, final Object[] objects)
      throws IOException, ClassNotFoundException {
    // PackageCompilationData must be restored before Rules as it has the ClassLoader needed to
    // resolve the generated code references in Rules
    this.pkgs = (Map) stream.readObject();

    this.packageClassLoader =
        new CompositePackageClassLoader(Thread.currentThread().getContextClassLoader());
    for (final Iterator it = this.pkgs.values().iterator(); it.hasNext(); ) {
      this.packageClassLoader.addClassLoader(
          ((Package) it.next()).getPackageCompilationData().getClassLoader());
    }

    // Return the rules stored as a byte[]
    final byte[] bytes = (byte[]) stream.readObject();

    //  Use a custom ObjectInputStream that can resolve against a given classLoader
    final ObjectInputStreamWithLoader streamWithLoader =
        new ObjectInputStreamWithLoader(new ByteArrayInputStream(bytes), this.packageClassLoader);

    this.factHandleFactory = (FactHandleFactory) streamWithLoader.readObject();
    this.globals = (Map) streamWithLoader.readObject();

    this.config = (RuleBaseConfiguration) streamWithLoader.readObject();

    this.workingMemories = new WeakHashMap();

    for (int i = 0, length = objects.length; i < length; i++) {
      objects[i] = streamWithLoader.readObject();
    }
  }
Ejemplo n.º 15
0
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   super.readExternal(in);
   tupleSource = (LeftTupleSource) in.readObject();
   tupleMemoryEnabled = in.readBoolean();
   previousTupleSinkNode = (LeftTupleSinkNode) in.readObject();
   nextTupleSinkNode = (LeftTupleSinkNode) in.readObject();
 }
Ejemplo n.º 16
0
  @Override
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    iUniqueId = in.readLong();
    iInstructionalType = (String) in.readObject();
    iName = (String) in.readObject();

    int nrSections = in.readInt();
    iSections.clear();
    for (int i = 0; i < nrSections; i++) iSections.add(new XSection(in));

    iConfigId = in.readLong();
    iParentId = in.readLong();
    if (iParentId < 0) iParentId = null;

    iCreditAbbv = (String) in.readObject();
    iCreditText = (String) in.readObject();

    iAllowOverlap = in.readBoolean();

    int nrCredits = in.readInt();
    iCreditByCourse.clear();
    for (int i = 0; i < nrCredits; i++)
      iCreditByCourse.put(
          in.readLong(), new String[] {(String) in.readObject(), (String) in.readObject()});
  }
Ejemplo n.º 17
0
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   accumulator = (Accumulator) in.readObject();
   source = (RuleConditionElement) in.readObject();
   requiredDeclarations = (Declaration[]) in.readObject();
   innerDeclarations = (Declaration[]) in.readObject();
   this.cloned = (List<Accumulate>) in.readObject();
 }
Ejemplo n.º 18
0
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   super.readExternal(in);
   rmAddress = (InetAddress) in.readObject();
   filter = (LogFilter) in.readObject();
   port = in.readInt();
   usedAcc = (boolean[]) in.readObject();
 }
Ejemplo n.º 19
0
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   otherSinks = (ObjectSinkNodeList) in.readObject();
   hashableSinks = (ObjectSinkNodeList) in.readObject();
   hashedFieldIndexes = (LinkedList) in.readObject();
   hashedSinkMap = (ObjectHashMap) in.readObject();
   alphaNodeHashingThreshold = in.readInt();
 }
Ejemplo n.º 20
0
 // ------------------------------------------------------------
 // Instance methods
 // ------------------------------------------------------------
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   super.readExternal(in);
   query = (QueryImpl) in.readObject();
   subrule = (GroupElement) in.readObject();
   subruleIndex = in.readInt();
   initDeclarations();
 }
Ejemplo n.º 21
0
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   super.readExternal(in);
   queryElement = (QueryElement) in.readObject();
   tupleSource = (LeftTupleSource) in.readObject();
   tupleMemoryEnabled = in.readBoolean();
   openQuery = in.readBoolean();
 }
Ejemplo n.º 22
0
  /**
   * Implements Externalizable interface to read serialized form
   *
   * @param s Input stream to serialize from
   */
  public void readExternal(java.io.ObjectInput s) throws ClassNotFoundException, IOException {
    int numFields = s.readInt();
    if (numFields > 0) {
      fields = new ArrayList(numFields);
      columnInfos = new HashMap();
      for (int i = 0; i < numFields; i++) {
        String fieldName = s.readUTF();
        fields.add(fieldName);

        Object colInfo = s.readObject();
        columnInfos.put(fieldName, colInfo);
      }
    }

    int numRows = s.readInt();
    if (numRows > 0) {
      records = new ArrayList(numRows);
      for (int row = 0; row < numRows; row++) {
        List record = new ArrayList(numFields);
        for (int col = 0; col < numFields; col++) {
          record.add(s.readObject());
        }
        records.add(record);
      }
    }
  }
  @Override
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    VersionChecker.readAndCheckVersion(in, VERSION, PerTableSerializableIdSourceKey.class);

    columnNames = (String[]) in.readObject();
    columnValues = (Object[]) in.readObject();
  }
Ejemplo n.º 24
0
 @SuppressWarnings({"rawtypes", "unchecked"})
 public void readExternal(final ObjectInput s) throws IOException, ClassNotFoundException {
   hashCode = s.readInt();
   key = (KEY) s.readObject();
   value = (VALUE) s.readObject();
   next = (Entry<KEY, VALUE>) s.readObject();
 }
Ejemplo n.º 25
0
  /** @exclude */
  public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException {
    super.readExternal(input);

    short[] flagsArray = readFlags(input);
    for (int i = 0; i < flagsArray.length; i++) {
      short flags = flagsArray[i];
      short reservedPosition = 0;

      if (i == 0) {
        if ((flags & OPERATION_FLAG) != 0) operation = ((Number) input.readObject()).intValue();

        reservedPosition = 1;
      }

      // For forwards compatibility, read in any other flagged objects
      // to preserve the integrity of the input stream...
      if ((flags >> reservedPosition) != 0) {
        for (short j = reservedPosition; j < 6; j++) {
          if (((flags >> j) & 1) != 0) {
            input.readObject();
          }
        }
      }
    }
  }
Ejemplo n.º 26
0
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   chainedProperties = (ChainedProperties) in.readObject();
   immutable = in.readBoolean();
   sequential = in.readBoolean();
   sequentialAgenda = (SequentialAgenda) in.readObject();
   maintainTms = in.readBoolean();
   removeIdentities = in.readBoolean();
   shareAlphaNodes = in.readBoolean();
   shareBetaNodes = in.readBoolean();
   permGenThreshold = in.readInt();
   alphaNodeHashingThreshold = in.readInt();
   compositeKeyDepth = in.readInt();
   indexLeftBetaMemory = in.readBoolean();
   indexRightBetaMemory = in.readBoolean();
   indexPrecedenceOption = (IndexPrecedenceOption) in.readObject();
   assertBehaviour = (AssertBehaviour) in.readObject();
   executorService = (String) in.readObject();
   consequenceExceptionHandler = (String) in.readObject();
   ruleBaseUpdateHandler = (String) in.readObject();
   conflictResolver = (ConflictResolver) in.readObject();
   advancedProcessRuleIntegration = in.readBoolean();
   multithread = in.readBoolean();
   maxThreads = in.readInt();
   eventProcessingMode = (EventProcessingOption) in.readObject();
   classLoaderCacheEnabled = in.readBoolean();
   phreakEnabled = in.readBoolean();
   declarativeAgenda = in.readBoolean();
   componentFactory = (ReteooComponentFactory) in.readObject();
 }
 @Override
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   this.propertyName = (String) in.readObject();
   this.persistList = (List<Type>) in.readObject();
   this.clear = in.readBoolean();
   this.exclusive = in.readBoolean();
 }
Ejemplo n.º 28
0
  public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException {
    super.readExternal(input);

    short[] flagsArray = readFlags(input);
    for (int i = 0; i < flagsArray.length; i++) {
      short flags = flagsArray[i];
      short reservedPosition = 0;

      if (i == 0) {
        if ((flags & 0x1) != 0) {
          this.identity = ((Map) input.readObject());
        }
        if ((flags & 0x2) != 0) this.operation = ((Number) input.readObject()).intValue();
        else {
          this.operation = 0;
        }
        reservedPosition = 2;
      }

      if (flags >> reservedPosition != 0) {
        for (short j = reservedPosition; j < 6; j = (short) (j + 1)) {
          if ((flags >> j & 0x1) != 0) {
            input.readObject();
          }
        }
      }
    }
  }
Ejemplo n.º 29
0
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   tree = (RBTree<Comparable<Comparable>, RightTupleList>) in.readObject();
   ascendingIndex = (FieldIndex) in.readObject();
   ascendingConstraintType = (ConstraintType) in.readObject();
   descendingIndex = (FieldIndex) in.readObject();
   descendingConstraintType = (ConstraintType) in.readObject();
   size = in.readInt();
 }
Ejemplo n.º 30
0
 @Override
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   super.readExternal(in);
   index = in.readInt();
   fieldName = (String) in.readObject();
   initExpr = (String) in.readObject();
   pattern = (PatternDescr) in.readObject();
 }