001    package com.hammurapi.config.runtime;
002    
003    import org.eclipse.emf.ecore.EObject;
004    
005    import com.hammurapi.util.Context;
006    
007    /**
008     * Configuration context for model elements.
009     * @author Pavel Vlasov
010     */
011    public interface ConfigurationContext<D extends EObject> extends Context, DestroyableSink {
012            
013            
014            /**
015             * @return ECore definition of given element.
016             */
017            D getDefinition();
018            
019            /**
020             * @return Object's parents.
021             */
022            Object[] getPath();
023            
024            /**
025             * Finds object's parent of given type.
026             * @param <T>
027             * @param type
028             * @return Parent of given type or null.
029             */
030            <T> T findParent(Class<T> type);
031                    
032            /**
033             * @return Classloader for the component to load additional classes and resources.
034             */
035            ClassLoader getClassLoader();
036            
037            /**
038             * @return Factory config for configuring sub-components.
039             */
040            FactoryConfig getFactoryConfig();
041            
042    }