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