001package org.andromda.core.common; 002 003import java.util.Collection; 004import java.util.List; 005import org.andromda.core.namespace.NamespaceComponent; 006import org.andromda.core.templateengine.TemplateEngine; 007 008/** 009 * Interface between an AndroMDA code generator plugin and the core. All plug-ins (such as cartridges and 010 * translation-libraries) that can be discovered and used by the framework must implement this interface. 011 * 012 * @author <a href="http://www.mbohlen.de">Matthias Bohlen </a> 013 * @author Chad Brandon 014 * @author Bob Fields 015 */ 016public interface Plugin 017 extends NamespaceComponent 018{ 019 /** 020 * Initializes the plugin. 021 * @throws Exception 022 */ 023 public void initialize() 024 throws Exception; 025 026 /** 027 * Shuts down the plugin. The meaning of this is defined by the plugin itself. At least, it should close any 028 * logfiles. 029 */ 030 public void shutdown(); 031 032 /** 033 * Returns all the TemplateObject objects that are available to this Plugin. 034 * 035 * @return a collection of TemplateObjects. 036 */ 037 public Collection<TemplateObject> getTemplateObjects(); 038 039 /** 040 * Gets the TemplateEngine which implements the template processing. 041 * 042 * @return TemplateEngine 043 * @see org.andromda.core.templateengine.TemplateEngine 044 */ 045 public TemplateEngine getTemplateEngine(); 046 047 /** 048 * Gets all property references available for this cartridge. This is 049 * an array of names corresponding to property references. 050 * 051 * @return the Map of property references. 052 */ 053 public String[] getPropertyReferences(); 054 055 /** 056 * Returns a list containing the name of each resource contained within the plugin. 057 * @return contents 058 */ 059 public List getContents(); 060}