Package org.apache.derby.iapi.services.stream

Examples of org.apache.derby.iapi.services.stream.HeaderPrintWriter


   */
  private HeaderPrintWriter makeStream() {

    // get the header
    PrintWriterGetHeader header = makeHeader();
    HeaderPrintWriter hpw = makeHPW(header);

    // If hpw == null then no properties were specified for the stream
    // so use/create the default stream.
    if (hpw == null)
      hpw = createDefaultStream(header);
View Full Code Here


      try {
        Method theMethod = theClass.getMethod(methodName,  new Class[0]);

        if (!Modifier.isStatic(theMethod.getModifiers())) {
          HeaderPrintWriter hpw = useDefaultStream(header);
          hpw.printlnWithHeader(theMethod.toString() + " is not static");
          return hpw;
        }

        try {
          return makeValueHPW(theMethod, theMethod.invoke((Object) null,
View Full Code Here

      try {
        Field theField = theClass.getField(fieldName);
   
        if (!Modifier.isStatic(theField.getModifiers())) {
          HeaderPrintWriter hpw = useDefaultStream(header);
          hpw.printlnWithHeader(theField.toString() + " is not static");
          return hpw;
        }

        try {
          return makeValueHPW(theField, theField.get((Object) null),
View Full Code Here

    if (value instanceof OutputStream)
       return new BasicHeaderPrintWriter((OutputStream) value, header, false, name);
    else if (value instanceof Writer)
       return new BasicHeaderPrintWriter((Writer) value, header, false, name);
   
    HeaderPrintWriter hpw = useDefaultStream(header);

    if (value == null)
      hpw.printlnWithHeader(whereFrom.toString() + "=null");
    else
      hpw.printlnWithHeader(whereFrom.toString() + " instanceof " + value.getClass().getName());

    return hpw;
  }
View Full Code Here

    return new BasicHeaderPrintWriter(System.err, header, false, "System.err");
  }

  private HeaderPrintWriter useDefaultStream(PrintWriterGetHeader header, Throwable t) {

    HeaderPrintWriter hpw = useDefaultStream(header);

        while (t != null) {
            Throwable causedBy = t.getCause();
            String causedByStr =
                MessageService.getTextMessage(MessageId.CAUSED_BY);
            hpw.printlnWithHeader(
                t.toString() + (causedBy != null ? " " + causedByStr : ""));
            t = causedBy;
        }

    return hpw;
View Full Code Here

      fos.write(bytecode.getArray(),
        bytecode.getOffset(), bytecode.getLength());
      fos.flush();
      if (logMessage) {
            // find the error stream
            HeaderPrintWriter errorStream = Monitor.getStream();
        errorStream.printlnWithHeader("Wrote class "+getFullName()+" to file "+classFile.toString()+". Please provide support with the file and the following exception message: "+t);
      }
      fos.close();
    } catch (IOException e) {
      if (SanityManager.DEBUG)
        SanityManager.THROWASSERT("Unable to write .class file", e);
View Full Code Here

    File dir = env instanceof File ? (File) env : null;

    final File classFile = FileUtil.newFile(dir,filename);

    // find the error stream
    HeaderPrintWriter errorStream = Monitor.getStream();

    try {
            FileOutputStream fis;
            try {
                fis = (FileOutputStream) AccessController.doPrivileged(
                        new PrivilegedExceptionAction() {
                            public Object run() throws IOException {
                                return new FileOutputStream(classFile);
                            }
                        });
            } catch (PrivilegedActionException pae) {
                throw (IOException) pae.getCause();
            }
      fis.write(bytecode.getArray(),
        bytecode.getOffset(), bytecode.getLength());
      fis.flush();
      if (t!=null) {       
        errorStream.printlnWithHeader(MessageService.getTextMessage(MessageId.CM_WROTE_CLASS_FILE, fullyQualifiedName, classFile, t));
      }
      fis.close();
    } catch (IOException e) {
      if (SanityManager.DEBUG)
        SanityManager.THROWASSERT("Unable to write .class file", e);
View Full Code Here

      LanguageConnectionContext lccToUse = activation.getLanguageConnectionContext();

       if (lccToUse.getLogStatementText())
      {
        HeaderPrintWriter istream = Monitor.getStream();
        String xactId = lccToUse.getTransactionExecute().getActiveStateTxIdString();
        String pvsString = "";
        ParameterValueSet pvs = activation.getParameterValueSet();
        if (pvs != null && pvs.getParameterCount() > 0)
        {
          pvsString = " with " + pvs.getParameterCount() +
              " parameters " + pvs.toString();
        }
        istream.printlnWithHeader(LanguageConnectionContext.xidStr +
                      xactId +
                      "), " +
                      LanguageConnectionContext.lccStr +
                      lccToUse.getInstanceNumber() +
                      "), " +
View Full Code Here

                // (ScanManager) cast is occasionally causing a
                // java.lang.ClassCastException.

                if (!(o instanceof ScanManager))
                {
                    HeaderPrintWriter istream = Monitor.getStream();
                   
                    if (o == null)
                        istream.println("next element was null\n");
                    else
                        istream.println("non ScanManager on list: " + o);

                    istream.println(
                        "Current list of open scans: " +  debugOpened());
                }
            }
      ScanManager sm = (ScanManager) o;
            sm.savePosition(conglom, page);
View Full Code Here

        endExecutionTime = getCurrentTimeMillis();
               
        lcc.setRunTimeStatisticsObject(
          lcc.getLanguageConnectionFactory().getExecutionFactory().getResultSetStatisticsFactory().getRunTimeStatistics(activation, this, subqueryTrackingArray));

        HeaderPrintWriter istream = lcc.getLogQueryPlan() ? Monitor.getStream() : null;
        if (istream != null)
        {
          istream.printlnWithHeader(LanguageConnectionContext.xidStr +
                        lcc.getTransactionExecute().getTransactionIdString() +
                        "), " +
                        LanguageConnectionContext.lccStr +
                        lcc.getInstanceNumber() +
                        "), " +
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.services.stream.HeaderPrintWriter

Copyright © 2018 www.massapicom. 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.