public class IoElement extends RecordingStrategiesElement implements Poolable<IoElement>
| Modifier and Type | Field and Description |
|---|---|
private int |
bytes
Stores the bytes.
|
private java.lang.String |
caller
Stores the caller.
|
static ObjectPool<IoElement> |
POOL
Defines an object pool for this class.
|
private java.lang.String |
recId
Stores the recId.
|
private long |
threadId
Stores the identification of the calling thread.
|
private StreamType |
type
Stores the type.
|
private boolean |
write
Write (true) or read (false).
|
| Constructor and Description |
|---|
IoElement()
Creates a new empty instance.
|
IoElement(java.lang.String recId,
java.lang.String caller,
long threadId,
int bytes,
StreamType type,
boolean write)
Creates a new instance with the given parameters.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
If a pool is used this method is for releasing the element from the pool.
|
IoElement |
create()
Creates a further instance of this instances (intended as factory method
to be executed on a prototypical instance).
|
int |
getBytes()
Getter for the bytes.
|
java.lang.String |
getCaller()
Getter for the caller.
|
int |
getIdentification()
Returns the unambiguous identification of the element.
|
java.lang.String |
getRecId()
Getter for the recId.
|
long |
getThreadId()
Getter for the tread id.
|
StreamType |
getType()
Getter for the type.
|
boolean |
isWrite()
Getter for write.
|
void |
process(RecorderStrategy strategy)
Hands the information of the element to the
RecorderStrategy. |
void |
read(java.io.DataInputStream in)
Reads this instance from the given input stream.
|
void |
release()
Release this element from the pool if this instance is
Poolable. |
void |
send(java.io.DataOutputStream out)
Writes this instance to the given output stream.
|
void |
setBytes(int bytes)
Setter for the bytes.
|
void |
setCaller(java.lang.String caller)
Setter for the caller.
|
void |
setRecId(java.lang.String recId)
Setter for the recId.
|
void |
setThreadId(long threadId)
Setter for the thread id.
|
void |
setType(StreamType type)
Setter for the type.
|
void |
setWrite(boolean write)
Setter for write or read access.
|
public static final ObjectPool<IoElement> POOL
private java.lang.String recId
private int bytes
private StreamType type
private long threadId
private java.lang.String caller
private boolean write
IoElement()
public IoElement(java.lang.String recId,
java.lang.String caller,
long threadId,
int bytes,
StreamType type,
boolean write)
recId - the recIdcaller - optional class name of the calling classthreadId - the identification of the calling threadbytes - the bytestype - the typewrite - whether it is a write or read accesspublic java.lang.String getRecId()
public void setRecId(java.lang.String recId)
recId - the recId to setpublic int getBytes()
public void setBytes(int bytes)
bytes - the bytes to setpublic StreamType getType()
public void setType(StreamType type)
type - the type to setpublic void send(java.io.DataOutputStream out)
throws java.io.IOException
send in class RecordingStrategiesElementout - the output streamjava.io.IOException - in case of any I/O error or problempublic void read(java.io.DataInputStream in)
throws java.io.IOException
read in class RecordingStrategiesElementin - the input streamjava.io.IOException - in case of any I/O error or problempublic int getIdentification()
getIdentification in class RecordingStrategiesElementpublic void process(RecorderStrategy strategy)
RecorderStrategy.process in class RecordingStrategiesElementstrategy - the RecorderStrategypublic void clear()
clear in interface Poolable<IoElement>clear in class RecordingStrategiesElementpublic void release()
Poolable.release in class RecordingStrategiesElementpublic IoElement create()
Poolablepublic void setThreadId(long threadId)
threadId - the id to be setpublic void setCaller(java.lang.String caller)
caller - the caller to be setpublic void setWrite(boolean write)
write - true if write access else falsepublic long getThreadId()
public java.lang.String getCaller()
public boolean isWrite()