@Override
  public void writeExternal(ObjectOutput output) throws IOException {
    String data;
    Date date;
    List<Cookie> cookie_list = getCookies();
    output.writeInt(cookie_list.size());
    for (Cookie cookie : cookie_list) {
      output.writeUTF(cookie.getName());
      output.writeUTF(cookie.getValue());

      data = cookie.getComment();
      output.writeBoolean(data != null);
      if (data != null) output.writeUTF(data);

      date = cookie.getExpiryDate();
      output.writeBoolean(date != null);
      if (date != null) output.writeLong(date.getTime());

      data = cookie.getDomain();
      output.writeBoolean(data != null);
      if (data != null) output.writeUTF(data);

      data = cookie.getPath();
      output.writeBoolean(data != null);
      if (data != null) output.writeUTF(data);

      output.writeBoolean(cookie.isSecure());
      output.writeInt(cookie.getVersion());
    }
  }
Esempio n. 2
0
  /**
   * Handles the write 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. The generated bytecode must be restored before any
   * Rules.
   *
   * @param stream out the stream to write the object to; should be an instance of
   *     DroolsObjectOutputStream or OutputStream
   */
  public void writeExternal(ObjectOutput stream) throws IOException {
    boolean isDroolsStream = stream instanceof DroolsObjectOutputStream;
    ByteArrayOutputStream bytes = null;
    ObjectOutput out;

    if (isDroolsStream) {
      out = stream;
    } else {
      bytes = new ByteArrayOutputStream();
      out = new DroolsObjectOutputStream(bytes);
    }
    out.writeObject(this.dialectRuntimeRegistry);
    out.writeObject(this.typeDeclarations);
    out.writeObject(this.name);
    out.writeObject(this.imports);
    out.writeObject(this.staticImports);
    out.writeObject(this.functions);
    out.writeObject(this.accumulateFunctions);
    out.writeObject(this.factTemplates);
    out.writeObject(this.ruleFlows);
    out.writeObject(this.globals);
    out.writeBoolean(this.valid);
    out.writeBoolean(this.needStreamMode);
    out.writeObject(this.rules);
    out.writeObject(this.classFieldAccessorStore);
    out.writeObject(this.entryPointsIds);
    out.writeObject(this.windowDeclarations);
    out.writeObject(this.traitRegistry);
    // writing the whole stream as a byte array
    if (!isDroolsStream) {
      bytes.flush();
      bytes.close();
      stream.writeObject(bytes.toByteArray());
    }
  }
 /**
  * Write this object to a stream of stored objects.
  *
  * @param out write bytes here.
  * @exception IOException thrown on error
  */
 public void writeExternal(ObjectOutput out) throws IOException {
   if (SanityManager.DEBUG) {
     SanityManager.ASSERT(triggerSchemaId != null, "triggerSchemaId expected to be non-null");
     SanityManager.ASSERT(triggerTableId != null, "triggerTableId expected to be non-null");
   }
   out.writeObject(id);
   out.writeObject(name);
   out.writeObject(triggerSchemaId);
   out.writeObject(triggerTableId);
   out.writeInt(eventMask);
   out.writeBoolean(isBefore);
   out.writeBoolean(isRow);
   out.writeBoolean(isEnabled);
   out.writeObject(whenSPSId);
   out.writeObject(actionSPSId);
   if (referencedCols == null) {
     out.writeInt(0);
   } else {
     out.writeInt(referencedCols.length);
     for (int i = 0; i < referencedCols.length; i++) {
       out.writeInt(referencedCols[i]);
     }
   }
   out.writeObject(triggerDefinition);
   out.writeBoolean(referencingOld);
   out.writeBoolean(referencingNew);
   out.writeObject(oldReferencingName);
   out.writeObject(newReferencingName);
 }
Esempio n. 4
0
  /** {@inheritDoc} */
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    boolean done;
    boolean cancelled;
    Object res;
    Throwable err;
    boolean syncNotify;
    boolean concurNotify;

    synchronized (mux) {
      done = this.done;
      cancelled = this.cancelled;
      res = this.res;
      err = this.err;
      syncNotify = this.syncNotify;
      concurNotify = this.concurNotify;
    }

    out.writeBoolean(done);
    out.writeBoolean(syncNotify);
    out.writeBoolean(concurNotify);

    // Don't write any further if not done, as deserialized future
    // will be invalid anyways.
    if (done) {
      out.writeBoolean(cancelled);
      out.writeObject(res);
      out.writeObject(err);
    }
  }
Esempio n. 5
0
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeObject(factHandle);
   out.writeBoolean(removeLogical);
   out.writeBoolean(updateEqualsMap);
   out.writeObject(ruleOrigin);
   out.writeObject(leftTuple);
 }
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeObject(this.propertyName);
   out.writeObject(this.persistList);
   out.writeBoolean(this.clear);
   out.writeBoolean(this.exclusive);
 }
Esempio n. 7
0
 public void writeExternal(ObjectOutput out) throws IOException {
   super.writeExternal(out);
   out.writeObject(queryElement);
   out.writeObject(tupleSource);
   out.writeBoolean(tupleMemoryEnabled);
   out.writeBoolean(openQuery);
 }
 public void writeExternal(ObjectOutput out) throws IOException {
   super.writeExternal(out);
   out.writeLong(initRange);
   out.writeLong(finalRange);
   out.writeObject(paramText);
   out.writeBoolean(unwrapLeft);
   out.writeBoolean(unwrapRight);
 }
Esempio n. 9
0
 public void writeExternal(ObjectOutput out) throws IOException {
   super.writeExternal(out);
   out.writeObject(objectType);
   out.writeBoolean(skipOnModify);
   out.writeBoolean(objectMemoryEnabled);
   out.writeLong(expirationOffset);
   out.writeBoolean(lrUnlinkingEnabled);
   out.writeBoolean(queryNode);
 }
Esempio n. 10
0
 /*
  * Used with serialization. Not to be called manually.
  *
  * @param out ObjectOutput
  *
  * @throws IOException
  */
 @Override
 public void writeExternal(final ObjectOutput out) throws IOException {
   out.writeObject(_myMatrix);
   out.writeObject(_myScale);
   out.writeObject(_myTranslation);
   out.writeBoolean(_myIsIdentity);
   out.writeBoolean(_myIsRotationMatrix);
   out.writeBoolean(_myIsUniformScale);
 }
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeInt(index);
   out.writeByte(type);
   out.writeObject(ovalue);
   out.writeLong(lvalue);
   out.writeBoolean(bvalue);
   out.writeDouble(dvalue);
   out.writeBoolean(isNull);
   out.writeInt(hashCode);
 }
Esempio n. 12
0
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    out.writeInt(VERSION);

    out.writeUTF(player);

    out.writeBoolean(votingScreenEnabled);
    out.writeBoolean(zombieTexturesEnabled);
    out.writeBoolean(waveCounterEnabled);
  }
Esempio n. 13
0
 /** {@inheritDoc} */
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   super.writeExternal(out);
   out.writeObject(myUnitID);
   if (myProposal == null) {
     out.writeBoolean(false);
   } else {
     out.writeBoolean(true);
     out.writeObject(myProposal);
   }
 }
  public void writeExternal(final ObjectOutput out) throws IOException {
    nullMask |= (getName() == null) ? NAME : 0;
    nullMask |= (getValue() == null) ? VALUE : 0;
    nullMask |= (getComment() == null) ? COMMENT : 0;
    nullMask |= (getCommentURL() == null) ? COMMENT_URL : 0;
    nullMask |= (getExpiryDate() == null) ? EXPIRY_DATE : 0;
    nullMask |= (getDomain() == null) ? DOMAIN : 0;
    nullMask |= (getPath() == null) ? PATH : 0;
    nullMask |= (getPorts() == null) ? PORTS : 0;

    out.writeInt(nullMask);

    if ((nullMask & NAME) == 0) {
      out.writeUTF(getName());
    }

    if ((nullMask & VALUE) == 0) {
      out.writeUTF(getValue());
    }

    if ((nullMask & COMMENT) == 0) {
      out.writeUTF(getComment());
    }

    if ((nullMask & COMMENT_URL) == 0) {
      out.writeUTF(getCommentURL());
    }

    if ((nullMask & EXPIRY_DATE) == 0) {
      out.writeLong(getExpiryDate().getTime());
    }

    out.writeBoolean(isPersistent());

    if ((nullMask & DOMAIN) == 0) {
      out.writeUTF(getDomain());
    }

    if ((nullMask & PATH) == 0) {
      out.writeUTF(getPath());
    }

    if ((nullMask & PORTS) == 0) {
      out.writeInt(getPorts().length);

      for (int p : getPorts()) {
        out.writeInt(p);
      }
    }

    out.writeBoolean(isSecure());
    out.writeInt(getVersion());
  }
Esempio n. 15
0
 public void writeExternal(ObjectOutput stream) throws IOException {
   stream.writeObject(kBase);
   stream.writeObject(cls);
   stream.writeObject(objectTypeNodes);
   stream.writeObject(concreteObjectTypeNode);
   stream.writeObject(entryPoint);
   stream.writeBoolean(tmsEnabled);
   stream.writeBoolean(traitTmsEnabled);
   stream.writeBoolean(supportsPropertyListeners);
   stream.writeBoolean(isEvent);
   stream.writeBoolean(isTrait);
 }
Esempio n. 16
0
  /** {@inheritDoc} */
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    out.writeByte(type.ordinal());
    out.writeObject(jobId);
    out.writeInt(taskNum);
    out.writeInt(attempt);
    out.writeObject(inputSplit);

    if (mapperIdxSet) {
      out.writeBoolean(true);
      out.writeInt(mapperIdx);
    } else out.writeBoolean(false);
  }
 @Override
 public void writeExternal(ObjectOutput objectOutput) throws IOException {
   objectOutput.writeLong(itemPriceId);
   objectOutput.writeLong(itemId);
   objectOutput.writeInt(minQuantity);
   objectOutput.writeInt(maxQuantity);
   objectOutput.writeDouble(price);
   objectOutput.writeDouble(discount);
   objectOutput.writeBoolean(taxable);
   objectOutput.writeDouble(shipping);
   objectOutput.writeBoolean(useShippingFormula);
   objectOutput.writeInt(status);
 }
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    out.writeBoolean(descColumns != null);
    if (descColumns != null) {
      out.writeInt(descColumns.length);
      for (int i = 0; i < descColumns.length; i++) out.writeBoolean(descColumns[i]);
    }

    out.writeBoolean(nullsOrderedLow != null);
    if (nullsOrderedLow != null) {
      out.writeInt(nullsOrderedLow.length);
      for (int i = 0; i < nullsOrderedLow.length; i++) out.writeBoolean(nullsOrderedLow[i]);
    }
  }
Esempio n. 19
0
 public void writeExternal(ObjectOutput out) throws IOException {
   BucketEntry cur = this;
   while (true) {
     out.writeInt(cur.key);
     out.writeLong(cur.value);
     if (cur.next != null) { // hasNext
       out.writeBoolean(true);
       cur = cur.next;
     } else {
       out.writeBoolean(false);
       break;
     }
   }
 }
Esempio n. 20
0
  private void writeTo(ObjectOutput o) throws IOException {
    o.writeInt(x);
    o.writeInt(y);
    o.writeInt(width);
    o.writeInt(height);
    o.writeInt(measuredWidth);
    o.writeInt(measuredHeight);
    o.writeInt(scrollX);
    o.writeInt(scrollY);
    o.writeInt(absoluteX);
    o.writeInt(absoluteY);
    o.writeFloat(cameraDistance);
    o.writeBoolean(visible);
    o.writeLong(drawingTime);
    o.writeBoolean(isShown);
    o.writeBoolean(hasFocus);
    o.writeBoolean(focusable);
    o.writeBoolean(hasOnClickListener);
    o.writeObject(viewType);
    o.writeObject(textContent);
    o.writeBoolean(isEditText);
    o.writeBoolean(isInputMethodTarget);
    o.writeBoolean(isContainer);
    o.writeInt(inputMethod);
    o.writeInt(id);

    if (children != null) {
      o.writeInt(children.size());
      for (ViewComponentInfo child : children) {
        child.writeTo(o);
      }
    } else {
      o.writeInt(0);
    }
  }
  /** {@inheritDoc} */
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    super.writeExternal(out);

    out.writeLong(threadId);
    out.writeBoolean(commit);
    out.writeBoolean(invalidate);
    out.writeBoolean(reply);

    U.writeGridUuid(out, futId);
    CU.writeVersion(out, commitVer);
    CU.writeVersion(out, baseVer);

    U.writeCollection(out, writeEntries);
  }
  @Override
  public void writeExternal(ObjectOutput objectOutput) throws IOException {
    objectOutput.writeLong(mvccVersion);
    objectOutput.writeLong(layoutBranchId);
    objectOutput.writeLong(groupId);
    objectOutput.writeLong(companyId);
    objectOutput.writeLong(userId);

    if (userName == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(userName);
    }

    objectOutput.writeLong(layoutSetBranchId);
    objectOutput.writeLong(plid);

    if (name == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(name);
    }

    if (description == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(description);
    }

    objectOutput.writeBoolean(master);
  }
 public void writeExternal(ObjectOutput out) throws IOException {
   super.writeExternal(out);
   out.writeObject(tupleSource);
   out.writeBoolean(tupleMemoryEnabled);
   out.writeObject(previousTupleSinkNode);
   out.writeObject(nextTupleSinkNode);
 }
Esempio n. 24
0
  @Override
  public void writeExternal(ObjectOutput objectOutput) throws IOException {
    objectOutput.writeLong(interviewId);

    if (name == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(name);
    }

    objectOutput.writeLong(titlesId);
    objectOutput.writeBoolean(deleted);
    objectOutput.writeLong(groupId);
    objectOutput.writeLong(companyId);
    objectOutput.writeLong(userId);

    if (userName == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(userName);
    }

    objectOutput.writeLong(createDate);
    objectOutput.writeLong(modifiedDate);
  }
Esempio n. 25
0
    public void writeExternal(ObjectOutput objectOutput) throws IOException {
      objectOutput.writeBoolean(hasNationalNumberPattern);
      if (hasNationalNumberPattern) {
        objectOutput.writeUTF(nationalNumberPattern_);
      }

      objectOutput.writeBoolean(hasPossibleNumberPattern);
      if (hasPossibleNumberPattern) {
        objectOutput.writeUTF(possibleNumberPattern_);
      }

      objectOutput.writeBoolean(hasExampleNumber);
      if (hasExampleNumber) {
        objectOutput.writeUTF(exampleNumber_);
      }
    }
  @Override
  public void writeExternal(ObjectOutput objectOutput) throws IOException {
    objectOutput.writeLong(articleImageId);
    objectOutput.writeLong(groupId);

    if (articleId == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(articleId);
    }

    objectOutput.writeDouble(version);

    if (elInstanceId == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(elInstanceId);
    }

    if (elName == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(elName);
    }

    if (languageId == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(languageId);
    }

    objectOutput.writeBoolean(tempImage);
  }
  /**
   * Save the base state of the instance. This method performs step finalization if it has not been
   * done before.
   *
   * @param out stream where to save the state
   * @exception IOException in case of write error
   */
  protected void writeBaseExternal(final ObjectOutput out) throws IOException {

    if (currentState == null) {
      out.writeInt(-1);
    } else {
      out.writeInt(currentState.length);
    }
    out.writeDouble(globalPreviousTime);
    out.writeDouble(globalCurrentTime);
    out.writeDouble(softPreviousTime);
    out.writeDouble(softCurrentTime);
    out.writeDouble(h);
    out.writeBoolean(forward);

    if (currentState != null) {
      for (int i = 0; i < currentState.length; ++i) {
        out.writeDouble(currentState[i]);
      }
    }

    out.writeDouble(interpolatedTime);

    // we do not store the interpolated state,
    // it will be recomputed as needed after reading

    // finalize the step (and don't bother saving the now true flag)
    try {
      finalizeStep();
    } catch (DerivativeException e) {
      IOException ioe = new IOException(e.getLocalizedMessage());
      ioe.initCause(e);
      throw ioe;
    }
  }
Esempio n. 28
0
 public void writeExternal(ObjectOutput out) throws IOException {
   super.writeExternal(out);
   out.writeBoolean(unwrapRightObject);
   out.writeObject(accumulate);
   out.writeObject(resultConstraints);
   out.writeObject(resultBinder);
 }
  @Override
  public void writeExternal(ObjectOutput objectOutput) throws IOException {
    objectOutput.writeLong(mvccVersion);

    objectOutput.writeLong(releaseId);
    objectOutput.writeLong(createDate);
    objectOutput.writeLong(modifiedDate);

    if (servletContextName == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(servletContextName);
    }

    if (schemaVersion == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(schemaVersion);
    }

    objectOutput.writeInt(buildNumber);
    objectOutput.writeLong(buildDate);

    objectOutput.writeBoolean(verified);

    objectOutput.writeInt(state);

    if (testString == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(testString);
    }
  }
Esempio n. 30
0
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeObject(renderResult);
   out.writeObject(headers);
   out.writeBoolean(eager);
   out.writeUTF(resultContent);
 }