2362N/A * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * Collection of utility methods to facilitate implementing getInstance() 0N/A * @author Andreas Sterbenz 0N/A * Static inner class representing a newly created instance. 0N/A // public final fields, access directly without accessors 0N/A // Return Provider and implementation as an array as used in the 0N/A // old Security.getImpl() methods. 0N/A * Return a List of all the available Services that implement 0N/A * (type, algorithm). Note that the list is initialized lazily 0N/A * and Provider loading and lookup is only trigered when 0N/A * This method exists for compatibility with JCE only. It will be removed 0N/A * once JCE has been changed to use the replacement method. 0N/A * @deprecated use getServices(List<ServiceId>) instead 0N/A * Return a List of all the available Services that implement any of 0N/A * the specified algorithms. See getServices(String, String) for detals. 0N/A * For all the getInstance() methods below: 0N/A * @param type the type of engine (e.g. MessageDigest) 0N/A * @param clazz the Spi class that the implementation must subclass 0N/A * (e.g. MessageDigestSpi.class) or null if no superclass check 0N/A * @param algorithm the name of the algorithm (or alias), e.g. MD5 0N/A * @param provider the provider (String or Provider object) 0N/A * @param param the parameter to pass to the Spi constructor 0N/A * There are overloaded methods for all the permutations. 0N/A // in the almost all cases, the first service will work 0N/A // avoid taking long path if so 0N/A // if we cannot get the service from the prefered provider, 0N/A // fail over to the next 0N/A // do not retry initial failed service 0N/A * The two getInstance() methods below take a service. They are 0N/A * intended for classes that cannot use the standard methods, e.g. 0N/A * because they implement delayed provider selection like the 0N/A * Check is subClass is a subclass of superClass. If not, 0N/A * throw a NoSuchAlgorithmException.