com.maxifier.mxcache.InstanceProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mxcache-runtime Show documentation
Show all versions of mxcache-runtime Show documentation
Constains all classes necessary for launching a MxCache-instrumentated application
/*
* Copyright (c) 2008-2014 Maxifier Ltd. All Rights Reserved.
*/
package com.maxifier.mxcache;
import javax.annotation.Nonnull;
/**
* MxCache uses InstanceProvider in obtain following objects:
*
* - hashing strategies;
* - {@link com.maxifier.mxcache.provider.CachingStrategy};
* - {@link com.maxifier.mxcache.proxy.ProxyFactory};
* - {@link com.maxifier.mxcache.transform.TransformGenerator};
* - any other strategy-specific cases.
*
*
* @author Alexander Kochurov ([email protected])
*/
public interface InstanceProvider {
/**
*
* @param cls class
* @param type
* @return instance of class; may return different instances every call.
* @throws NoSuchInstanceException if there were problems accessing instance (e.g. class has no corresponding
* constructor).
*/
@Nonnull
T forClass(@Nonnull Class cls);
}