appl.parallel.event
Class TransferEvent

java.lang.Object
  extended by appl.parallel.event.RemoteEvent
      extended by appl.parallel.event.CommEvent
          extended by appl.parallel.event.TransferEvent
All Implemented Interfaces:
Serializable

public class TransferEvent
extends CommEvent

A TransferEvent is event which is associated with the size of a data transfer in bytes. It is measured by serializing the data into byte stream. This is very slow! So use this events carefully. You should check if monitoring for this event type is enabled, before generating it! See CommEventSink for details.

Author:
Dominik Appl
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class appl.parallel.event.CommEvent
CommEvent.CommType
 
Field Summary
 
Fields inherited from class appl.parallel.event.CommEvent
src, target, type
 
Constructor Summary
TransferEvent(String src, String target, CommEvent.CommType type, Object... toTransferObjects)
           
 
Method Summary
protected  int getObjectSize(Object object)
          Determines the object size in a very primitive way (serializing to a byte array and returning the byteSize) I do not have to mention here explicitly that this is slow, do I?
 int getSize()
           
 String toString()
           
 
Methods inherited from class appl.parallel.event.CommEvent
getSrc, getTarget, getType, typeName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransferEvent

public TransferEvent(String src,
                     String target,
                     CommEvent.CommType type,
                     Object... toTransferObjects)
Parameters:
src - the source of the event
target - the target of the event
type - the type of the event
toTransferObjects - the objects transfered (Warning: the size will be measured by serializing the object. This is slow!)
See Also:
getObjectSize(Object)
Method Detail

getObjectSize

protected int getObjectSize(Object object)
Determines the object size in a very primitive way (serializing to a byte array and returning the byteSize) I do not have to mention here explicitly that this is slow, do I? There is no real alternative, because in java exists. no function like sizeOf in C++

Parameters:
object - a Serializable object
Returns:
the size in bytes

getSize

public int getSize()

toString

public String toString()
Overrides:
toString in class Object