package com.hammurapi.common;


/**
 * Classes which have multiple dynamic facets (adapters) shall implement this interface.
 * This interface similar to Context.lookup() service loading.
 * @author Pavel Vlasov
 *
 */
public interface Adaptable {
	
	/**
	 * Retrieves adapter of given type from adaptable.
	 * @param <T> Adapter type.
	 * @param type Adapter type.
	 * @param context Adapter context.
	 * @return Adapter or null if adapter type is not supported.
	 */
	<T> T getAdapter(Class<T> type, Context context);
}
