org.apache.maven.mercury.event
Class AbstractMercuryEvent

java.lang.Object
  extended by org.apache.maven.mercury.event.AbstractMercuryEvent
All Implemented Interfaces:
MercuryEvent
Direct Known Subclasses:
GenericEvent

public abstract class AbstractMercuryEvent
extends java.lang.Object
implements MercuryEvent

Version:
$Id: AbstractMercuryEvent.java 720564 2008-11-25 18:58:02Z ogusakov $
Author:
Oleg Gusakov

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.maven.mercury.event.MercuryEvent
MercuryEvent.EventMask
 
Constructor Summary
AbstractMercuryEvent()
           
AbstractMercuryEvent(EventTypeEnum type, java.lang.String name)
           
AbstractMercuryEvent(EventTypeEnum type, java.lang.String name, java.lang.String info)
           
 
Method Summary
 long getDuration()
          duration of this event in millis
 java.lang.String getInfo()
          information for this event.
 java.lang.String getName()
          event name inside type
 java.util.Map<java.lang.String,java.lang.Object> getPayload()
          event's payload
 java.lang.Object getPayload(java.lang.String name)
          get one of payload values
 java.lang.String getResult()
          result field
 long getStart()
          get the event start time as UTC timestapm
 java.lang.String getTag()
          aggregation tag of this event.
 EventTypeEnum getType()
          event type
 boolean hasResult()
           
 void setInfo(java.lang.String info)
           
 void setPayload(java.util.Map<java.lang.String,java.lang.Object> payload)
          set the whole payload
 void setPayload(java.lang.String name, java.lang.Object value)
          set the whole payload
 void setResult(java.lang.String result)
           
 void setTag(java.lang.String tag)
           
 void start()
          start the event
 void stop()
          stop the event and calculate the duration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMercuryEvent

public AbstractMercuryEvent()

AbstractMercuryEvent

public AbstractMercuryEvent(EventTypeEnum type,
                            java.lang.String name)

AbstractMercuryEvent

public AbstractMercuryEvent(EventTypeEnum type,
                            java.lang.String name,
                            java.lang.String info)
Method Detail

getDuration

public long getDuration()
Description copied from interface: MercuryEvent
duration of this event in millis

Specified by:
getDuration in interface MercuryEvent
Returns:
duration of this event

getPayload

public java.util.Map<java.lang.String,java.lang.Object> getPayload()
Description copied from interface: MercuryEvent
event's payload

Specified by:
getPayload in interface MercuryEvent
Returns:
results, associated with this event

getStart

public long getStart()
Description copied from interface: MercuryEvent
get the event start time as UTC timestapm

Specified by:
getStart in interface MercuryEvent
Returns:
start time as UTC timestamp

getType

public EventTypeEnum getType()
Description copied from interface: MercuryEvent
event type

Specified by:
getType in interface MercuryEvent
Returns:

getName

public java.lang.String getName()
Description copied from interface: MercuryEvent
event name inside type

Specified by:
getName in interface MercuryEvent
Returns:

getInfo

public java.lang.String getInfo()
Description copied from interface: MercuryEvent
information for this event. Used to trace event propagation in the system

Specified by:
getInfo in interface MercuryEvent
Returns:

getTag

public java.lang.String getTag()
Description copied from interface: MercuryEvent
aggregation tag of this event. Used to trace event propagation in the system

Specified by:
getTag in interface MercuryEvent
Returns:

getResult

public java.lang.String getResult()
Description copied from interface: MercuryEvent
result field

Specified by:
getResult in interface MercuryEvent
Returns:

setResult

public void setResult(java.lang.String result)
Specified by:
setResult in interface MercuryEvent

setTag

public void setTag(java.lang.String tag)
Specified by:
setTag in interface MercuryEvent

setInfo

public void setInfo(java.lang.String info)
Specified by:
setInfo in interface MercuryEvent

hasResult

public boolean hasResult()
Specified by:
hasResult in interface MercuryEvent

getPayload

public java.lang.Object getPayload(java.lang.String name)
Description copied from interface: MercuryEvent
get one of payload values

Specified by:
getPayload in interface MercuryEvent
Parameters:
name - element name
Returns:
results, associated with this event

setPayload

public void setPayload(java.util.Map<java.lang.String,java.lang.Object> payload)
Description copied from interface: MercuryEvent
set the whole payload

Specified by:
setPayload in interface MercuryEvent

setPayload

public void setPayload(java.lang.String name,
                       java.lang.Object value)
Description copied from interface: MercuryEvent
set the whole payload

Specified by:
setPayload in interface MercuryEvent

start

public void start()
Description copied from interface: MercuryEvent
start the event

Specified by:
start in interface MercuryEvent

stop

public void stop()
Description copied from interface: MercuryEvent
stop the event and calculate the duration

Specified by:
stop in interface MercuryEvent


Copyright © 2002-2010 Apache Software Foundation. All Rights Reserved.