Package org.eclipse.mat.snapshot
Class SnapshotFactory
- java.lang.Object
-
- org.eclipse.mat.snapshot.SnapshotFactory
-
public final class SnapshotFactory extends java.lang.Object
ISnapshot
factory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SnapshotFactory.Implementation
Describes the snapshot factory implementation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IOQLQuery
createQuery(java.lang.String queryString)
Factory to create an OQL Query.static void
dispose(ISnapshot snapshot)
Dispose the whole snapshot.static java.util.List<SnapshotFormat>
getSupportedFormats()
Get the types of the parsers.static ISnapshot
openSnapshot(java.io.File file, java.util.Map<java.lang.String,java.lang.String> arguments, IProgressListener listener)
Create a snapshot Object from a file representation of a snapshot.static ISnapshot
openSnapshot(java.io.File file, IProgressListener listener)
Create a snapshot Object from a file representation of a snapshot.
-
-
-
Method Detail
-
openSnapshot
public static ISnapshot openSnapshot(java.io.File file, IProgressListener listener) throws SnapshotException
Create a snapshot Object from a file representation of a snapshot.- Parameters:
file
- file from which the snapshot will be constructed (type will be derived from the file name extension)listener
- progress listener informing about the current state of execution- Returns:
- snapshot
- Throws:
SnapshotException
-
openSnapshot
public static ISnapshot openSnapshot(java.io.File file, java.util.Map<java.lang.String,java.lang.String> arguments, IProgressListener listener) throws SnapshotException
Create a snapshot Object from a file representation of a snapshot.- Parameters:
file
- file from which the snapshot will be constructed (type will be derived from the file name extension)arguments
- parsing argumentslistener
- progress listener informing about the current state of execution- Returns:
- snapshot
- Throws:
SnapshotException
-
dispose
public static void dispose(ISnapshot snapshot)
Dispose the whole snapshot.Please call this method prior to dropping the last reference to the snapshot as this method ensures the proper return of all resources (e.g. main memory, file and socket handles...) when the last user has disposed it through the snapshot factory. After calling this method the snapshot can't be used anymore. Use instead of
ISnapshot.dispose()
if the snapshot is obtained fromopenSnapshot(File, Map, IProgressListener)
as openSnapshot() may obtain a copy from a cache.- Parameters:
snapshot
- snapshot which should be disposed
-
createQuery
public static IOQLQuery createQuery(java.lang.String queryString) throws OQLParseException, SnapshotException
Factory to create an OQL Query.- Throws:
OQLParseException
- if the OQL contains parsing errorsSnapshotException
-
getSupportedFormats
public static java.util.List<SnapshotFormat> getSupportedFormats()
Get the types of the parsers.- Returns:
- list of formats that the parsers can understand
-
-