com.jrockit.memleak.util
Class DelegatingValueFactory

java.lang.Object
  extended by com.jrockit.memleak.util.DelegatingValueFactory
All Implemented Interfaces:
IMemleakValueFactory
Direct Known Subclasses:
InfoCachingFactory

public class DelegatingValueFactory
extends java.lang.Object
implements IMemleakValueFactory

A value factory merely delegating to another implementation of IMemleakValueFactory. Intended to be sub classed, like an adapter. There is little point in using it directly. (It isn't abstract, to make sure it implements all methods.)

Author:
mpersson

Field Summary
protected  IMemleakValueFactory delegate
          Value factory to delegate to.
 
Constructor Summary
DelegatingValueFactory(IMemleakValueFactory delegate)
          Create a factory delegating everything to delegate.
 
Method Summary
 IArrayInfo createArrayInfo(int objectID, IClassInfo classInfo, int length)
          Create an IArrayInfo value object.
 IArraySizeInfo createArraySizeInfo(IArrayInfo arrayInfo, long size)
          Create IArraySizeInfo value object.
 IClassInfo createClassInfo(int classID, java.lang.String name, int modifiers, int numDeclaredStaticFields, int numInstanceFields, java.lang.String srcFileName, IObjectSpecifier classLoaderSpec)
          Create IClassInfo value object.
 IFieldInfo createFieldInfo(IClassInfo declaringClassInfo, java.lang.String name, int modifiers)
          Create IFieldInfo value object.
 IHeapHistogram createHeapHistogram(int numInstances, long size, float growthRate, long creationMillis, java.util.List<ITypeHeapInfo<IClassInfo>> heapInfos, java.util.Collection<ITypeHeapInfo<? extends INamedType>> groupedHeapInfos)
          Create IHeapHistogram value object.
 IInstanceReferrers createInstanceReferrers(IObjectInfo targetInfo, IObjectInfo[] ois, IStaticField[] staticFields, IThreadRoot[] threadRoots, int globalHandles)
          Create IInstanceReferrers value object.
 ILocation createLocation(IMethodInfo methodInfo, int line)
          Create a ILocation value object.
 IMethodInfo createMethodInfo(IClassInfo declaringClassInfo, java.lang.String name, java.lang.String descriptor, int modifiers)
          Create a IMethodInfo value object.
 IObjectInfo createObjectInfo(int objectID, IClassInfo classInfo)
          Create a IObjectInfo value object.
 IPointToTypeInfo createPointToTypeInfo(IClassInfo referredType, int refInstances, int[] instances, IClassInfo[] referrers, int totalRef)
          Create IPointToTypeInfo value object.
 IFieldValue createPrimitiveFieldValue(IFieldInfo info, java.lang.Object valueWrapper)
          Create IFieldValue primitive value object.
 IValue createPrimitiveValue(java.lang.Object valueWrapper)
          Create IValue primitive value object.
 IFieldValue createReferenceFieldValue(IFieldInfo info, IObjectInfo value)
          Create IFieldValue reference value object.
 IValue createReferenceValue(IObjectInfo value)
          Create IValue reference value object.
 IRelationshipInfo createRelationshipInfo(IObjectInfo fromInfo, long keepalive_size)
          Create IRelationshipInfo value object.
 IStaticField createStaticField(IClassInfo declaringClassInfo, java.lang.String fieldName, int modifiers)
          Create IStaticField value object.
 IThreadRoot createThreadRoot(java.lang.String name, IMethodInfo methodInfo)
          Create IThreadRoot value object.
 ITrace createTrace(int count, ILocation[] stack)
          Create ITrace value object.
 ITypeHeapInfo<IClassInfo> createTypeHeapInfo(IClassInfo classInfo, int numInstances, long size, float growthRate, long creationMillis)
          Create ITypeHeapInfo value object.
 boolean markDiscarded(IObjectInfo objectInfo)
          Mark the given objectInfo as discarded, if possible and if (it is likely that) the objectInfo was created by this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

protected IMemleakValueFactory delegate
Value factory to delegate to.

Constructor Detail

DelegatingValueFactory

public DelegatingValueFactory(IMemleakValueFactory delegate)
Create a factory delegating everything to delegate.

Parameters:
delegate -
Method Detail

createArrayInfo

public IArrayInfo createArrayInfo(int objectID,
                                  IClassInfo classInfo,
                                  int length)
Description copied from interface: IMemleakValueFactory
Create an IArrayInfo value object.

IClassInfo.isArrayClass() for classInfo must be true, or IllegalArgumentException will be thrown.

Note that if length is unknown (-1), IMemleakValueFactory.createObjectInfo(int, IClassInfo) may be called instead.

Specified by:
createArrayInfo in interface IMemleakValueFactory
Returns:
IArrayInfo
See Also:
IMemleakValueFactory.createObjectInfo(int, IClassInfo)

createArraySizeInfo

public IArraySizeInfo createArraySizeInfo(IArrayInfo arrayInfo,
                                          long size)
Description copied from interface: IMemleakValueFactory
Create IArraySizeInfo value object.

Specified by:
createArraySizeInfo in interface IMemleakValueFactory
Returns:
IArraySizeInfo

createClassInfo

public IClassInfo createClassInfo(int classID,
                                  java.lang.String name,
                                  int modifiers,
                                  int numDeclaredStaticFields,
                                  int numInstanceFields,
                                  java.lang.String srcFileName,
                                  IObjectSpecifier classLoaderSpec)
Description copied from interface: IMemleakValueFactory
Create IClassInfo value object.

Specified by:
createClassInfo in interface IMemleakValueFactory
classLoaderSpec - or null if unknown
Returns:
IClassInfo

createFieldInfo

public IFieldInfo createFieldInfo(IClassInfo declaringClassInfo,
                                  java.lang.String name,
                                  int modifiers)
Description copied from interface: IMemleakValueFactory
Create IFieldInfo value object.

Specified by:
createFieldInfo in interface IMemleakValueFactory
Parameters:
declaringClassInfo - the class which defines this field
modifiers - access modifiers, per Modifier
Returns:
IFieldInfo

createHeapHistogram

public IHeapHistogram createHeapHistogram(int numInstances,
                                          long size,
                                          float growthRate,
                                          long creationMillis,
                                          java.util.List<ITypeHeapInfo<IClassInfo>> heapInfos,
                                          java.util.Collection<ITypeHeapInfo<? extends INamedType>> groupedHeapInfos)
Description copied from interface: IMemleakValueFactory
Create IHeapHistogram value object.

Specified by:
createHeapHistogram in interface IMemleakValueFactory
Returns:
IHeapHistogram

createInstanceReferrers

public IInstanceReferrers createInstanceReferrers(IObjectInfo targetInfo,
                                                  IObjectInfo[] ois,
                                                  IStaticField[] staticFields,
                                                  IThreadRoot[] threadRoots,
                                                  int globalHandles)
Description copied from interface: IMemleakValueFactory
Create IInstanceReferrers value object.

Specified by:
createInstanceReferrers in interface IMemleakValueFactory
Returns:
IInstanceReferrers

createLocation

public ILocation createLocation(IMethodInfo methodInfo,
                                int line)
Description copied from interface: IMemleakValueFactory
Create a ILocation value object.

Specified by:
createLocation in interface IMemleakValueFactory
Returns:
ILocation

createMethodInfo

public IMethodInfo createMethodInfo(IClassInfo declaringClassInfo,
                                    java.lang.String name,
                                    java.lang.String descriptor,
                                    int modifiers)
Description copied from interface: IMemleakValueFactory
Create a IMethodInfo value object.

Specified by:
createMethodInfo in interface IMemleakValueFactory
Returns:
IMethodInfo

createObjectInfo

public IObjectInfo createObjectInfo(int objectID,
                                    IClassInfo classInfo)
Description copied from interface: IMemleakValueFactory
Create a IObjectInfo value object.

If IClassInfo.isArrayClass() for classInfo is true, an IArrayInfo must be returned, with the length set to the uninitialized value -1. The instance should preferably also implement IModifyOnce.

Specified by:
createObjectInfo in interface IMemleakValueFactory
Returns:
IObjectInfo

createPointToTypeInfo

public IPointToTypeInfo createPointToTypeInfo(IClassInfo referredType,
                                              int refInstances,
                                              int[] instances,
                                              IClassInfo[] referrers,
                                              int totalRef)
Description copied from interface: IMemleakValueFactory
Create IPointToTypeInfo value object.

Specified by:
createPointToTypeInfo in interface IMemleakValueFactory
Returns:
IPointToTypeInfo

createPrimitiveFieldValue

public IFieldValue createPrimitiveFieldValue(IFieldInfo info,
                                             java.lang.Object valueWrapper)
Description copied from interface: IMemleakValueFactory
Create IFieldValue primitive value object.

Specified by:
createPrimitiveFieldValue in interface IMemleakValueFactory
Returns:
IFieldValue

createPrimitiveValue

public IValue createPrimitiveValue(java.lang.Object valueWrapper)
Description copied from interface: IMemleakValueFactory
Create IValue primitive value object.

Specified by:
createPrimitiveValue in interface IMemleakValueFactory
Returns:
IValue

createReferenceFieldValue

public IFieldValue createReferenceFieldValue(IFieldInfo info,
                                             IObjectInfo value)
Description copied from interface: IMemleakValueFactory
Create IFieldValue reference value object.

Specified by:
createReferenceFieldValue in interface IMemleakValueFactory
Returns:
IFieldValue

createReferenceValue

public IValue createReferenceValue(IObjectInfo value)
Description copied from interface: IMemleakValueFactory
Create IValue reference value object.

Specified by:
createReferenceValue in interface IMemleakValueFactory
Returns:
IValue

createRelationshipInfo

public IRelationshipInfo createRelationshipInfo(IObjectInfo fromInfo,
                                                long keepalive_size)
Description copied from interface: IMemleakValueFactory
Create IRelationshipInfo value object.

Specified by:
createRelationshipInfo in interface IMemleakValueFactory
Returns:
IRelationshipInfo

createStaticField

public IStaticField createStaticField(IClassInfo declaringClassInfo,
                                      java.lang.String fieldName,
                                      int modifiers)
Description copied from interface: IMemleakValueFactory
Create IStaticField value object.

Specified by:
createStaticField in interface IMemleakValueFactory
Returns:
IStaticField

createThreadRoot

public IThreadRoot createThreadRoot(java.lang.String name,
                                    IMethodInfo methodInfo)
Description copied from interface: IMemleakValueFactory
Create IThreadRoot value object.

Specified by:
createThreadRoot in interface IMemleakValueFactory
Returns:
IThreadRoot

createTrace

public ITrace createTrace(int count,
                          ILocation[] stack)
Description copied from interface: IMemleakValueFactory
Create ITrace value object.

Specified by:
createTrace in interface IMemleakValueFactory
Returns:
ITrace

createTypeHeapInfo

public ITypeHeapInfo<IClassInfo> createTypeHeapInfo(IClassInfo classInfo,
                                                    int numInstances,
                                                    long size,
                                                    float growthRate,
                                                    long creationMillis)
Description copied from interface: IMemleakValueFactory
Create ITypeHeapInfo value object.

Specified by:
createTypeHeapInfo in interface IMemleakValueFactory
Returns:
ITypeHeapInfo

markDiscarded

public boolean markDiscarded(IObjectInfo objectInfo)
Description copied from interface: IMemleakValueFactory
Mark the given objectInfo as discarded, if possible and if (it is likely that) the objectInfo was created by this factory. This method is here and not in IObjectInfo in order to require access to the factory.

Specified by:
markDiscarded in interface IMemleakValueFactory
Returns:
true if the state changed


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