com.jrockit.memleak.mlp
Class AbstractMemLeak.DelayedTruncatable<T>

java.lang.Object
  extended by com.jrockit.memleak.mlp.AbstractMemLeak.DelayedTruncatable<T>
Type Parameters:
T -
All Implemented Interfaces:
IResult<T[]>, ITruncatable<T>
Direct Known Subclasses:
MemLeakR26.LargestArrayR26, MemLeakR28.GetInstanceRelationshipsR28, MemLeakR28.LargestArrayR28
Enclosing class:
AbstractMemLeak

protected abstract class AbstractMemLeak.DelayedTruncatable<T>
extends java.lang.Object
implements ITruncatable<T>

Author:
mpersson

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.jrockit.memleak.ITruncatable
ITruncatable.Reason
 
Field Summary
protected  com.jrockit.memleak.mlp.ServerRequest req
           
 
Constructor Summary
AbstractMemLeak.DelayedTruncatable(RequestType reqType)
           
 
Method Summary
 T[] get()
          The actual result array, possibly truncated.
 long getChangeTime()
          Get the time stamp of when this result last changed state.
protected  T[] getEmptyResult()
           
 java.lang.Exception getException()
          If an exception was thrown, returns that Exception.
 ITruncatable.Reason getTruncationReason()
          If the result was truncated, returns a ITruncatable.Reason for the truncation.
 boolean isDone()
          Returns true if this task completed.
 boolean isDone(java.lang.Object notificationToken)
          Checks if the result is available.
 boolean isTruncated()
           
protected abstract  T[] parseResponse(java.io.DataInputStream dis)
           
 AbstractMemLeak.DelayedTruncatable<T> send()
           
 ITruncatable<T> sendIfSupported()
          If this request is unsupported, returns a ITruncatable result with an empty array and a reason of "UNSUPPORTED".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

req

protected final com.jrockit.memleak.mlp.ServerRequest req
Constructor Detail

AbstractMemLeak.DelayedTruncatable

public AbstractMemLeak.DelayedTruncatable(RequestType reqType)
Parameters:
reqType -
Method Detail

getChangeTime

public long getChangeTime()
Description copied from interface: IResult
Get the time stamp of when this result last changed state. In other words: If IResult.isDone() is false, returns the time when the request was sent. If IResult.isDone() is true, returns the time when the response was received.

Specified by:
getChangeTime in interface IResult<T[]>
Returns:
a time stamp (in milliseconds since 1970-01-01)

send

public AbstractMemLeak.DelayedTruncatable<T> send()
Returns:
DelayedTruncatable<T>

sendIfSupported

public ITruncatable<T> sendIfSupported()
If this request is unsupported, returns a ITruncatable result with an empty array and a reason of "UNSUPPORTED". Otherwise returns as send().

Returns:
ITruncatable<T>
See Also:
send()

getEmptyResult

protected T[] getEmptyResult()
Returns:
the empty result array

isDone

public boolean isDone()
Description copied from interface: IResult
Returns true if this task completed. Completion may be due to normal termination, an exception, or cancellation -- in all of these cases, this method will return true.

Specified by:
isDone in interface IResult<T[]>
Returns:
true if this task completed.

isDone

public boolean isDone(java.lang.Object notificationToken)
Description copied from interface: IResult
Checks if the result is available. If so, simply returns true. Otherwise, notificationToken is added to the token set that will be given to notification listeners once the result is available. And false is returned.

Specified by:
isDone in interface IResult<T[]>
Returns:
true if this task completed.

get

public T[] get()
Description copied from interface: ITruncatable
The actual result array, possibly truncated. This method will never return null.

Specified by:
get in interface IResult<T[]>
Specified by:
get in interface ITruncatable<T>
Returns:
an array, possibly empty.

parseResponse

protected abstract T[] parseResponse(java.io.DataInputStream dis)
                              throws java.io.IOException,
                                     GarbageCollectedException,
                                     SpiException
Parameters:
dis -
Returns:
T
Throws:
java.io.IOException
GarbageCollectedException
SpiException

isTruncated

public boolean isTruncated()
Specified by:
isTruncated in interface ITruncatable<T>
Returns:
true iff this array was truncated

getTruncationReason

public ITruncatable.Reason getTruncationReason()
Description copied from interface: ITruncatable
If the result was truncated, returns a ITruncatable.Reason for the truncation. Otherwise, null is returned. Note that if ITruncatable.getException() returns non-null, this method will also return non-null, most probably ITruncatable.Reason.EXCEPTION.

Specified by:
getTruncationReason in interface ITruncatable<T>
Returns:
the reason for truncation, or null if the result wasn't truncated.

getException

public java.lang.Exception getException()
Description copied from interface: ITruncatable
If an exception was thrown, returns that Exception. Otherwise, null is returned.

Specified by:
getException in interface ITruncatable<T>
Returns:
the thrown exception, if any, null otherwise.


Copyright © 1999, 2011, Oracle and/or its affiliates. All rights reserved.