001package jmri.jmrit.logixng.tools.debugger; 002 003import java.util.Arrays; 004import java.util.Set; 005 006import jmri.InstanceInitializer; 007import jmri.implementation.AbstractInstanceInitializer; 008 009import org.openide.util.lookup.ServiceProvider; 010 011/** 012 * Provide the usual default implementations for the 013 * {@link jmri.InstanceManager}. 014 * <P> 015 * Not all {@link jmri.InstanceManager} related classes are provided by this 016 * class. See the discussion in {@link jmri.InstanceManager} of initialization 017 * methods. 018 * <hr> 019 * This file is part of JMRI. 020 * <P> 021 * JMRI is free software; you can redistribute it and/or modify it under the 022 * terms of version 2 of the GNU General Public License as published by the Free 023 * Software Foundation. See the "COPYING" file for a copy of this license. 024 * <P> 025 * JMRI is distributed in the hope that it will be useful, but WITHOUT ANY 026 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 027 * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 028 * 029 * @author Bob Jacobsen Copyright (C) 2001, 2008, 2014 030 * @since 2.9.4 031 */ 032@ServiceProvider(service = InstanceInitializer.class) 033public class DebuggerInstanceInitializer extends AbstractInstanceInitializer { 034 035 @Override 036 public <T> Object getDefault(Class<T> type) { 037 038 // In order for getDefault() to be called for a particular manager, 039 // the manager also needs to be added to the method getInitalizes() 040 // below. 041 042 if (type == Debugger.class) { 043 return new Debugger(); 044 } 045 046 return super.getDefault(type); 047 } 048 049 @Override 050 public Set<Class<?>> getInitalizes() { 051 Set<Class<?>> set = super.getInitalizes(); 052 set.addAll(Arrays.asList( 053 Debugger.class 054 )); 055 return set; 056 } 057 058}