TPTP 4.5.0 Platform Project
Internal API Specification

org.eclipse.hyades.trace.ui.internal.piclient
Class XMLTraceDataProcessor

java.lang.Object
  extended by org.eclipse.hyades.loaders.util.XMLLoader
      extended by org.eclipse.hyades.loaders.util.BinaryLoader
          extended by org.eclipse.hyades.trace.ui.internal.piclient.XMLTraceDataProcessor
All Implemented Interfaces:
org.eclipse.hyades.execution.core.IDataProcessor, DataProcessor, DataServerListener, ExtendedDataServerListener, org.eclipse.hyades.loaders.util.IXMLLoader, IExtendedLoader
Direct Known Subclasses:
StatGeneratorDataProcessor

public class XMLTraceDataProcessor
extends org.eclipse.hyades.loaders.util.BinaryLoader
implements ExtendedDataServerListener


Field Summary
protected static int BUFFER_SIZE
           
protected  java.lang.String END_TAG
           
protected  java.lang.String END_TAG_REPLACE
           
protected  java.lang.String END_TRACE
           
protected  java.io.OutputStream fileWriter
           
protected  boolean firstEvent
           
protected static char[] ID1_IN
           
protected static char[] ID1_OUT
           
protected static char[] ID2_IN
           
protected static char[] ID2_OUT
           
protected static java.lang.String INCOMMING_DATA
           
protected static java.lang.String NEW_LINE
           
protected  boolean newFile
           
protected  long prevTotalBytesRead
           
protected  java.lang.String profileFileName
           
protected  boolean specialProcessing
           
protected  java.lang.String START_TAG
           
protected  java.lang.String START_TRACE
           
protected  long startTime
           
protected  int tempRemaining
           
protected  long totalBytesRead
           
protected  boolean validTag
           
protected  java.lang.String XML_VERSION
           
protected  java.lang.String XML_VERSION_TAG
           
 
Fields inherited from class org.eclipse.hyades.loaders.util.XMLLoader
context, currentAttributeName, currentElementName, currentLoader, debug, defaultLoader, depth, error, file, fragmentsCount, LE_IN, LE_OUT, loaders, p, rootElement, sb, scanner, startDocument
 
Constructor Summary
XMLTraceDataProcessor(org.eclipse.hyades.models.hierarchy.TRCAgent agent)
           
XMLTraceDataProcessor(org.eclipse.hyades.models.hierarchy.TRCAgentProxy agentProxy)
          XMLDataProcessor constructor comment.
XMLTraceDataProcessor(org.eclipse.hyades.models.hierarchy.TRCMonitor monitor)
          XMLDataProcessor constructor comment.
 
Method Summary
 boolean checkAndRemoveEndTag(java.lang.String filename)
          Check the non-zip format profiling file for an trace end tag and remove it if there exist one.
 void cleanUp()
           
protected  boolean copyFile(java.io.File f, java.io.File newFileName)
           
protected  void copyZip(java.util.zip.ZipInputStream zipInputStream, java.util.zip.ZipOutputStream zipOutputStream)
           
 void createWriter()
           
 void dataServerExited()
           
 void dispose()
           
 void endTrace(java.io.OutputStream randomFile)
           
protected  org.eclipse.hyades.models.hierarchy.TRCAgentProxy getAgentProxy()
           
protected  java.lang.String getDumpFileName()
           
 java.lang.String getProfileFileName()
          Returns the profileFileName.
protected  java.lang.String getTimeStamp()
           
 java.io.OutputStream getWriter()
          Returns the fw.
protected  void handleOutOfMemoryError()
           
 void incommingData(byte[] data, int length, java.net.InetAddress peer)
           
 void incommingData(byte[] buffer, int offset, int length, java.net.InetAddress peer)
          Insert the method's description here.
 void incommingData(char[] data, int length, java.net.InetAddress peer)
           
 void incommingData(char[] buffer, int offset, int length, java.net.InetAddress peer)
          Insert the method's description here.
 void incommingStream(java.io.InputStream inputStream, java.net.InetAddress peer)
           
 void invalidDataType(byte[] data, int length, java.net.InetAddress peer)
           
 void invalidDataType(byte[] data, int offset, int length, java.net.InetAddress peer)
          Insert the method's description here.
 boolean isNewProfileFile()
           
protected  boolean isValidTag(byte[] buf, int offset, int length)
           
 void loadEvent(byte[] buffer, int offset, int length, boolean loadToModel)
           
 void loadEvent(byte[] buffer, int offset, int length, boolean loadToModel, boolean toProfileFile)
           
protected  void loadEventHook(byte[] buffer, int length)
           
protected  void loadEventHook(byte[] buffer, int offset, int length)
           
 void loadEvents(java.io.InputStream inputStream, int offset, int length)
           
protected  java.io.OutputStream makeWriter()
           
protected  void notifyListener(Agent a, org.eclipse.hyades.models.hierarchy.TRCAgentProxy agent)
           
protected  boolean renameFile(java.io.File f, java.io.File newFileName)
           
 void setProfileFileName(java.lang.String profileFileName)
          Sets the profileFileName.
 void setWriter(java.io.OutputStream fw)
          Sets the fw.
protected  boolean startsWith(byte[] container, int offset, int length, byte[] bytes)
           
 void startTrace(java.io.OutputStream randomFile)
           
protected  void stopAgent()
           
 void waitingForData()
          Insert the method's description here.
protected  void writeByte(byte[] data, int offset, int length)
           
 void writeHeader(java.io.Writer randomFile)
           
 void writeXMLVersion(java.io.OutputStream randomFile)
           
 
Methods inherited from class org.eclipse.hyades.loaders.util.BinaryLoader
isLoadXml, loadEvents, setLoadXml
 
Methods inherited from class org.eclipse.hyades.loaders.util.XMLLoader
addToResource, attributeName, attributeName, attributeValueCharacters, attributeValueCharacters, characters, checkForStopProcessing, createOutputFile, endDocument, endElement, endElement, error, error, getContext, getLoader, getName, getProcessedFragments, isIgnoredElement, loadEvent, loadEvent, loadEvent, loadEvent, log, log, makeParser, makeScanner, printLoadInfo, processGlobalForwardReferences, restartParser, setCollectionMode, setLoadToModel, startDocument, startElement, startElement, toString, writeToBinaryOutputFile, writeToTextOutputFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

newFile

protected boolean newFile

NEW_LINE

protected static final java.lang.String NEW_LINE
See Also:
Constant Field Values

BUFFER_SIZE

protected static final int BUFFER_SIZE
See Also:
Constant Field Values

firstEvent

protected boolean firstEvent

fileWriter

protected java.io.OutputStream fileWriter

profileFileName

protected java.lang.String profileFileName

START_TAG

protected final java.lang.String START_TAG
See Also:
Constant Field Values

END_TAG

protected final java.lang.String END_TAG
See Also:
Constant Field Values

XML_VERSION_TAG

protected final java.lang.String XML_VERSION_TAG
See Also:
Constant Field Values

END_TAG_REPLACE

protected final java.lang.String END_TAG_REPLACE
See Also:
Constant Field Values

START_TRACE

protected final java.lang.String START_TRACE
See Also:
Constant Field Values

END_TRACE

protected final java.lang.String END_TRACE
See Also:
Constant Field Values

XML_VERSION

protected final java.lang.String XML_VERSION
See Also:
Constant Field Values

ID1_IN

protected static final char[] ID1_IN

ID1_OUT

protected static final char[] ID1_OUT

ID2_IN

protected static final char[] ID2_IN

ID2_OUT

protected static final char[] ID2_OUT

INCOMMING_DATA

protected static final java.lang.String INCOMMING_DATA
See Also:
Constant Field Values

specialProcessing

protected boolean specialProcessing

totalBytesRead

protected long totalBytesRead

prevTotalBytesRead

protected long prevTotalBytesRead

startTime

protected long startTime

validTag

protected boolean validTag

tempRemaining

protected int tempRemaining
Constructor Detail

XMLTraceDataProcessor

public XMLTraceDataProcessor(org.eclipse.hyades.models.hierarchy.TRCAgent agent)

XMLTraceDataProcessor

public XMLTraceDataProcessor(org.eclipse.hyades.models.hierarchy.TRCAgentProxy agentProxy)
XMLDataProcessor constructor comment.


XMLTraceDataProcessor

public XMLTraceDataProcessor(org.eclipse.hyades.models.hierarchy.TRCMonitor monitor)
XMLDataProcessor constructor comment.

Method Detail

setWriter

public void setWriter(java.io.OutputStream fw)
Sets the fw.

Parameters:
fw - The fw to set

getWriter

public java.io.OutputStream getWriter()
Returns the fw.

Returns:
Writer

setProfileFileName

public void setProfileFileName(java.lang.String profileFileName)
Sets the profileFileName.

Parameters:
profileFileName - The profileFileName to set

getProfileFileName

public java.lang.String getProfileFileName()
Returns the profileFileName.

Returns:
String

createWriter

public void createWriter()

getDumpFileName

protected java.lang.String getDumpFileName()

makeWriter

protected java.io.OutputStream makeWriter()
                                   throws java.io.IOException
Throws:
java.io.IOException

renameFile

protected boolean renameFile(java.io.File f,
                             java.io.File newFileName)

copyFile

protected boolean copyFile(java.io.File f,
                           java.io.File newFileName)
Parameters:
f -
newFileName -

copyZip

protected void copyZip(java.util.zip.ZipInputStream zipInputStream,
                       java.util.zip.ZipOutputStream zipOutputStream)
                throws java.io.IOException
Parameters:
zipInputStream -
zipStream -
Throws:
java.io.IOException

getTimeStamp

protected java.lang.String getTimeStamp()
Returns:

dataServerExited

public void dataServerExited()
Specified by:
dataServerExited in interface DataServerListener

dispose

public void dispose()

endTrace

public void endTrace(java.io.OutputStream randomFile)

isValidTag

protected boolean isValidTag(byte[] buf,
                             int offset,
                             int length)

startsWith

protected boolean startsWith(byte[] container,
                             int offset,
                             int length,
                             byte[] bytes)
Parameters:
container -
bytes -
Returns:

loadEventHook

protected void loadEventHook(byte[] buffer,
                             int offset,
                             int length)

loadEventHook

protected void loadEventHook(byte[] buffer,
                             int length)

incommingData

public void incommingData(byte[] buffer,
                          int offset,
                          int length,
                          java.net.InetAddress peer)
Insert the method's description here. Creation date: (3/1/01 12:06:07 PM)

Specified by:
incommingData in interface ExtendedDataServerListener
Parameters:
buffer - byte[]
length - int
peer - java.net.InetAddress

incommingData

public void incommingData(char[] buffer,
                          int offset,
                          int length,
                          java.net.InetAddress peer)
Insert the method's description here. Creation date: (3/1/01 12:06:07 PM)

Specified by:
incommingData in interface ExtendedDataServerListener
Parameters:
buffer - char[]
length - int
peer - java.net.InetAddress

invalidDataType

public void invalidDataType(byte[] data,
                            int offset,
                            int length,
                            java.net.InetAddress peer)
Insert the method's description here. Creation date: (3/1/01 12:06:07 PM)

Specified by:
invalidDataType in interface ExtendedDataServerListener
Parameters:
data - byte[]
length - int
peer - java.net.InetAddress

waitingForData

public void waitingForData()
Insert the method's description here. Creation date: (3/1/01 12:06:07 PM)

Specified by:
waitingForData in interface org.eclipse.hyades.execution.core.IDataProcessor

startTrace

public void startTrace(java.io.OutputStream randomFile)

writeHeader

public void writeHeader(java.io.Writer randomFile)

writeXMLVersion

public void writeXMLVersion(java.io.OutputStream randomFile)

getAgentProxy

protected org.eclipse.hyades.models.hierarchy.TRCAgentProxy getAgentProxy()

handleOutOfMemoryError

protected void handleOutOfMemoryError()

notifyListener

protected void notifyListener(Agent a,
                              org.eclipse.hyades.models.hierarchy.TRCAgentProxy agent)

stopAgent

protected void stopAgent()

writeByte

protected void writeByte(byte[] data,
                         int offset,
                         int length)

isNewProfileFile

public boolean isNewProfileFile()
Returns:

checkAndRemoveEndTag

public boolean checkAndRemoveEndTag(java.lang.String filename)
Check the non-zip format profiling file for an trace end tag and remove it if there exist one.

Parameters:
filename - file to be checked
Returns:
true if end tag exists and removed, false if nothing change.

incommingData

public void incommingData(byte[] data,
                          int length,
                          java.net.InetAddress peer)
Specified by:
incommingData in interface org.eclipse.hyades.execution.core.IDataProcessor

incommingData

public void incommingData(char[] data,
                          int length,
                          java.net.InetAddress peer)
Specified by:
incommingData in interface org.eclipse.hyades.execution.core.IDataProcessor

invalidDataType

public void invalidDataType(byte[] data,
                            int length,
                            java.net.InetAddress peer)
Specified by:
invalidDataType in interface org.eclipse.hyades.execution.core.IDataProcessor

incommingStream

public void incommingStream(java.io.InputStream inputStream,
                            java.net.InetAddress peer)
Specified by:
incommingStream in interface ExtendedDataServerListener

loadEvents

public void loadEvents(java.io.InputStream inputStream,
                       int offset,
                       int length)
                throws InvalidEventException
Throws:
InvalidEventException

cleanUp

public void cleanUp()
Specified by:
cleanUp in interface org.eclipse.hyades.loaders.util.IXMLLoader
Overrides:
cleanUp in class org.eclipse.hyades.loaders.util.XMLLoader

loadEvent

public void loadEvent(byte[] buffer,
                      int offset,
                      int length,
                      boolean loadToModel,
                      boolean toProfileFile)
               throws org.eclipse.hyades.loaders.util.InvalidXMLException
Overrides:
loadEvent in class org.eclipse.hyades.loaders.util.XMLLoader
Throws:
org.eclipse.hyades.loaders.util.InvalidXMLException

loadEvent

public void loadEvent(byte[] buffer,
                      int offset,
                      int length,
                      boolean loadToModel)
               throws org.eclipse.hyades.loaders.util.InvalidXMLException
Overrides:
loadEvent in class org.eclipse.hyades.loaders.util.BinaryLoader
Throws:
org.eclipse.hyades.loaders.util.InvalidXMLException

TPTP 4.5.0 Platform Project
Internal API Specification