ecologylab.services.logging
Class LogRequestMessage
java.lang.Object
ecologylab.generic.Debug
ecologylab.xml.ElementState
ecologylab.services.messages.ServiceMessage
ecologylab.services.messages.RequestMessage
ecologylab.services.logging.LogRequestMessage
- All Implemented Interfaces:
- OptimizationTypes, XMLTranslationExceptionTypes, java.lang.Comparable<ServiceMessage>
- Direct Known Subclasses:
- LogOps, LogueMessage
public abstract class LogRequestMessage
- extends RequestMessage
Transport for getting log data to the server, without need for any additional translation.
Pre-translated XML fragments are loaded into the internal buffer, and then serialized to a server with this class.
To facilitate logging, this object writes its contents to a Writer (generally a file) during its performService
method. The Writer must be configured prior to invoking this method by calling the setWriter method. This sequence is
automatically handled by a Logging server in its LoggingContextManager.
- Author:
- eunyee, andruid, Zachary O. Toups (toupsz@cs.tamu.edu)
|
Field Summary |
protected java.lang.StringBuilder |
bufferToLog
|
| Fields inherited from interface ecologylab.xml.OptimizationTypes |
BAD_FIELD, COLLECTION_ELEMENT, COLLECTION_SCALAR, IGNORED_ATTRIBUTE, IGNORED_ELEMENT, LEAF_NODE_VALUE, MAP_ELEMENT, MAP_SCALAR, NAME_SPACE_ATTRIBUTE, NAME_SPACE_LEAF_NODE, NAME_SPACE_MASK, NAME_SPACE_NESTED_ELEMENT, NAMESPACE_IGNORED_ELEMENT, NAMESPACE_TRIAL_ELEMENT, OTHER_NESTED_ELEMENT, REGULAR_ATTRIBUTE, REGULAR_NESTED_ELEMENT, ROOT, UNSET_TYPE, XMLNS_ATTRIBUTE, XMLNS_IGNORED |
|
Constructor Summary |
LogRequestMessage()
No argument constructor for serialization. |
LogRequestMessage(int bufferSize)
Construct a new LogRequestMessage with a specific buffer size, to prevent unnecessary allocation later. |
|
Method Summary |
void |
appendToBuffer(java.lang.StringBuilder opsBuffer)
Loads pre-translated XML fragments into this object's buffer for later sending over the network. |
protected java.lang.StringBuilder |
bufferToLog()
Stuff to write to the log file based on the contents of this message. |
void |
clear()
Clear the buffer for re-use, presumably after sending it. |
ResponseMessage |
performService(Scope objectRegistry,
java.lang.String sessionId)
Save the logging messages to the pre-set writer. |
void |
setBuffer(java.lang.StringBuilder bufferToLog)
|
void |
setWriter(java.io.OutputStreamWriter outputStreamWriter)
Sets the writer that will be used to record this object's buffer's contents during the performService method. |
| Methods inherited from class ecologylab.xml.ElementState |
addNestedElement, addNestedElement, appendTextNodeString, buildDOM, buildDOM, buildDOM, buildDOM, buildDOM, buildDOMFromXMLCharSequence, buildDOMFromXMLString, checkAnnotation, convertNameStyles, createChildHook, fieldToXMLOptimizations, floatingPrecision, getCollection, getElementStateById, getMap, getNestedNameSpace, getTextNodeString, leafElementFieldNames, lookupNestedNameSpace, optimizations, parent, postTranslationProcessingHook, preTranslationProcessingHook, recycle, setDeclarationStyle, setFieldUsingTypeRegistry, setFloatingPrecision, setParent, setUseDOMForTranslateTo, translateFromXML, translateFromXML, translateFromXML, translateFromXML, translateFromXML, translateFromXMLCharSequence, translateFromXMLDOM, translateFromXMLDOM, translateFromXMLDOM, translateFromXMLDOM, translateFromXMLDOM, translateFromXMLDOM, translateFromXMLDOMCharSequence, translateFromXMLDOMCharSequence, translateFromXMLRootNode, translateFromXMLSAX, translateFromXMLSAX, translateFromXMLSAX, translateFromXMLSAX, translateFromXMLSAX, translateToDOM, translateToXML, translateToXML, translateToXML, translateToXML, writePrettyXML, writePrettyXML, writePrettyXML |
| Methods inherited from class ecologylab.generic.Debug |
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, toString, warning, warning, weird, weird |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
bufferToLog
protected java.lang.StringBuilder bufferToLog
LogRequestMessage
public LogRequestMessage()
- No argument constructor for serialization.
LogRequestMessage
public LogRequestMessage(int bufferSize)
- Construct a new LogRequestMessage with a specific buffer size, to prevent unnecessary allocation later.
performService
public ResponseMessage performService(Scope objectRegistry,
java.lang.String sessionId)
- Save the logging messages to the pre-set writer.
- Specified by:
performService in class RequestMessage
- Parameters:
objectRegistry - Context to perform it in/with.sessionId - TODO
- Returns:
- Response to pass back to the (remote) caller.
setWriter
public void setWriter(java.io.OutputStreamWriter outputStreamWriter)
- Sets the writer that will be used to record this object's buffer's contents during the performService method.
- Parameters:
outputStreamWriter -
appendToBuffer
public void appendToBuffer(java.lang.StringBuilder opsBuffer)
- Loads pre-translated XML fragments into this object's buffer for later sending over the network.
- Parameters:
opsBuffer -
setBuffer
public void setBuffer(java.lang.StringBuilder bufferToLog)
bufferToLog
protected java.lang.StringBuilder bufferToLog()
- Stuff to write to the log file based on the contents of this message.
- Returns:
- ops, the buffer in which MixedInitiativeOps have been passed here.
clear
public void clear()
- Clear the buffer for re-use, presumably after sending it.