00001 /* 00002 * CAST - The CoSy Architecture Schema Toolkit 00003 * 00004 * Copyright (C) 2006-2007 Nick Hawes 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public License 00008 * as published by the Free Software Foundation; either version 2.1 of 00009 * the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, but 00012 * WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00019 * 02110-1301 USA 00020 * 00021 */ 00022 00026 package cast.core; 00027 00028 import java.util.Map; 00029 00030 import cast.cdl.SUBARCHIDKEY; 00031 import cast.core.logging.LogAdditions; 00032 00039 public abstract class SubarchitectureComponent extends CASTComponent { 00040 00041 // the id of the subarchitecture that contains this component 00042 private String m_subarchitectureID; 00043 00050 public SubarchitectureComponent() { 00051 m_subarchitectureID = null; 00052 } 00053 00062 @Override 00063 protected void configureInternal(Map<String, String> _config) { 00064 super.configureInternal(_config); 00065 00066 m_subarchitectureID = _config.get(SUBARCHIDKEY.value); 00067 00068 if (m_subarchitectureID == null) { 00069 println("Error, configure property not found: " 00070 + SUBARCHIDKEY.value); 00071 } 00072 00073 } 00074 00078 public final String getSubarchitectureID() { 00079 return m_subarchitectureID; 00080 } 00081 00088 @Override 00089 public String getLoggerName() { 00090 return getSubarchitectureID() + "." + getComponentID(); 00091 } 00092 00093 @Override 00094 public LogAdditions getLogAdditions() { 00095 return new LogAdditions(getComponentID(), getSubarchitectureID(), 00096 getStartColourEscape()); 00097 } 00098 00099 }
1.5.8