001    package com.hammurapi.util;
002    
003    /**
004     * Classes which have multiple dynamic facets (adapters) shall implement this interface.
005     * This interface similar to Context.lookup() service loading.
006     * @author Pavel Vlasov
007     *
008     */
009    public interface Adaptable {
010            
011            /**
012             * Retrieves adapter of given type from adaptable.
013             * @param <T> Adapter type.
014             * @param type Adapter type.
015             * @param context Adapter context.
016             * @return Adapter or null if adapter type is not supported.
017             */
018            <T> T getAdapter(Class<T> type, Context context);
019    }