Top Fields Constructors Methods
net.sf.ehcache.pool

public final Class SizeOfEngineLoader

extends Object
implements SizeOfEngineFactory
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.pool.SizeOfEngineFactory
Imports
net.sf.ehcache.pool.impl.DefaultSizeOfEngine, java.util.ServiceLoader

Author
Alex Snaps

Field Summary

Modifier and TypeField and Description
private volatile SizeOfEngineFactory
public static final SizeOfEngineLoader
INSTANCE

The one and single instance of this class

private final ServiceLoader<SizeOfEngineFactory>

Constructor Summary

AccessConstructor and Description
pack-priv
SizeOfEngineLoader(ClassLoader
the classLoader the ServiceLoader will use to resolve net.sf.ehcache.pool.SizeOfEngineFactory services Should probably always be SizeOfEngineLoader.class.getClassLoader()
classLoader
)

Only there for testing purposes

private

Method Summary

Modifier and TypeMethod and Description
public SizeOfEngine
createSizeOfEngine(final int
the max object graph that will be traversed.
maxObjectCount
,
final boolean
true if the object traversal should be aborted when the max depth is exceeded
abort
,
final boolean
true if no info log explaining which agent was chosen should be printed
silent
)

Implements net.sf.ehcache.pool.SizeOfEngineFactory.createSizeOfEngine.

Creates a new instance of a SizeOfEngine
public synchronized boolean

Returns:

true if succeeded otherwise, false
load
(Class<? extends SizeOfEngineFactory>
the class
clazz
,
boolean
whether to force a reload of the ServiceLoader
reload
)

Tries to find a SizeOfEngineFactory instance that is assignable from clazz

public static SizeOfEngine

Returns:

the new instance
newSizeOfEngine
(final int
the max object graph that will be traversed.
maxObjectCount
,
final boolean
true if the object traversal should be aborted when the max depth is exceeded
abort
,
final boolean
true if no info log explaining which agent was chosen should be printed
silent
)

Creates a new instance of a SizeOfEngine

public void
reload()

Reloads the factory using the ServiceLoader

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

factoryback to summary
private volatile SizeOfEngineFactory factory
INSTANCEback to summary
public static final SizeOfEngineLoader INSTANCE

The one and single instance of this class

loaderback to summary
private final ServiceLoader<SizeOfEngineFactory> loader

Constructor Detail

SizeOfEngineLoaderback to summary
pack-priv SizeOfEngineLoader(ClassLoader classLoader)

Only there for testing purposes

Parameters
classLoader:ClassLoader

the classLoader the ServiceLoader will use to resolve net.sf.ehcache.pool.SizeOfEngineFactory services Should probably always be SizeOfEngineLoader.class.getClassLoader()

SizeOfEngineLoaderback to summary
private SizeOfEngineLoader()

Method Detail

createSizeOfEngineback to summary
public SizeOfEngine createSizeOfEngine(final int maxObjectCount, final boolean abort, final boolean silent)

Implements net.sf.ehcache.pool.SizeOfEngineFactory.createSizeOfEngine.

Doc from net.sf.ehcache.pool.SizeOfEngineFactory.createSizeOfEngine.

Creates a new instance of a SizeOfEngine

Parameters
maxObjectCount:int

the max object graph that will be traversed.

abort:boolean

true if the object traversal should be aborted when the max depth is exceeded

silent:boolean

true if no info log explaining which agent was chosen should be printed

Returns:SizeOfEngine

the new instance

Annotations
@Override
loadback to summary
public synchronized boolean load(Class<? extends SizeOfEngineFactory> clazz, boolean reload)

Tries to find a SizeOfEngineFactory instance that is assignable from clazz

Parameters
clazz:Class<? extends SizeOfEngineFactory>

the class

reload:boolean

whether to force a reload of the ServiceLoader

Returns:boolean

true if succeeded otherwise, false

newSizeOfEngineback to summary
public static SizeOfEngine newSizeOfEngine(final int maxObjectCount, final boolean abort, final boolean silent)

Creates a new instance of a SizeOfEngine

Parameters
maxObjectCount:int

the max object graph that will be traversed.

abort:boolean

true if the object traversal should be aborted when the max depth is exceeded

silent:boolean

true if no info log explaining which agent was chosen should be printed

Returns:SizeOfEngine

the new instance

reloadback to summary
public void reload()

Reloads the factory using the ServiceLoader