⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configuration.java

📁 JAVA 所有包
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
     * @param type the specified Configuration type.  See Appendix A in the     *    <a href="../../../../../technotes/guides/security/crypto/CryptoSpec.html#AppA">     *    Java Cryptography Architecture API Specification &amp; Reference </a>     *    for a list of standard Configuration types.     *     * @param params parameters for the Configuration, which may be null.     *     * @return the new Configuration object.     *     * @exception SecurityException if the caller does not have permission     *		to get a Configuration instance for the specified type.     *     * @exception NullPointerException if the specified type is null.     *     * @exception IllegalArgumentException if the specified parameters     *		are not understood by the ConfigurationSpi implementation     *		from the selected Provider.     *     * @exception NoSuchAlgorithmException if no Provider supports a     *		ConfigurationSpi implementation for the specified type.     *     * @see Provider     * @since 1.6     */    public static Configuration getInstance(String type,				Configuration.Parameters params)                throws NoSuchAlgorithmException {        checkPermission(type);	try {            GetInstance.Instance instance = GetInstance.getInstance							("Configuration",							ConfigurationSpi.class,							type,							params);            return new ConfigDelegate((ConfigurationSpi)instance.impl,							instance.provider,							type,							params);	} catch (NoSuchAlgorithmException nsae) {	    return handleException (nsae);	}    }    /**     * Returns a Configuration object of the specified type.     *     * <p> A new Configuration object encapsulating the     * ConfigurationSpi implementation from the specified provider     * is returned.   The specified provider must be registered     * in the provider list.     *     * <p> Note that the list of registered providers may be retrieved via     * the {@link Security#getProviders() Security.getProviders()} method.     *     * @param type the specified Configuration type.  See Appendix A in the     *    <a href="../../../../../technotes/guides/security/crypto/CryptoSpec.html#AppA">     *    Java Cryptography Architecture API Specification &amp; Reference </a>     *    for a list of standard Configuration types.     *     * @param params parameters for the Configuration, which may be null.     *     * @param provider the provider.     *     * @return the new Configuration object.     *     * @exception SecurityException if the caller does not have permission     *		to get a Configuration instance for the specified type.     *     * @exception NullPointerException if the specified type is null.     *     * @exception IllegalArgumentException if the specified provider     *		is null or empty,     *		or if the specified parameters are not understood by     *		the ConfigurationSpi implementation from the specified provider.     *     * @exception NoSuchProviderException if the specified provider is not     *		registered in the security provider list.     *     * @exception NoSuchAlgorithmException if the specified provider does not     *		support a ConfigurationSpi implementation for the specified     *		type.     *     * @see Provider     * @since 1.6     */    public static Configuration getInstance(String type,				Configuration.Parameters params,				String provider)		throws NoSuchProviderException, NoSuchAlgorithmException {	if (provider == null || provider.length() == 0) {	    throw new IllegalArgumentException("missing provider");	}	checkPermission(type);	try {	    GetInstance.Instance instance = GetInstance.getInstance							("Configuration",							ConfigurationSpi.class,							type,							params,							provider);	    return new ConfigDelegate((ConfigurationSpi)instance.impl,							instance.provider,							type,							params);	} catch (NoSuchAlgorithmException nsae) {	    return handleException (nsae);	}    }    /**     * Returns a Configuration object of the specified type.     *     * <p> A new Configuration object encapsulating the     * ConfigurationSpi implementation from the specified Provider     * object is returned.  Note that the specified Provider object     * does not have to be registered in the provider list.     *     * @param type the specified Configuration type.  See Appendix A in the     *    <a href="../../../../../technotes/guides/security/crypto/CryptoSpec.html#AppA">     *    Java Cryptography Architecture API Specification &amp; Reference </a>     *    for a list of standard Configuration types.     *     * @param params parameters for the Configuration, which may be null.     *     * @param provider the Provider.     *     * @return the new Configuration object.     *     * @exception SecurityException if the caller does not have permission     *		to get a Configuration instance for the specified type.     *     * @exception NullPointerException if the specified type is null.     *     * @exception IllegalArgumentException if the specified Provider is null,     *		or if the specified parameters are not understood by     *		the ConfigurationSpi implementation from the specified Provider.     *     * @exception NoSuchAlgorithmException if the specified Provider does not     *		support a ConfigurationSpi implementation for the specified     *		type.     *     * @see Provider     * @since 1.6     */    public static Configuration getInstance(String type,				Configuration.Parameters params,				Provider provider)		throws NoSuchAlgorithmException {	if (provider == null) {	    throw new IllegalArgumentException("missing provider");	}	checkPermission(type);	try {	    GetInstance.Instance instance = GetInstance.getInstance							("Configuration",							ConfigurationSpi.class,							type,							params,							provider);	    return new ConfigDelegate((ConfigurationSpi)instance.impl,							instance.provider,							type,							params);	} catch (NoSuchAlgorithmException nsae) {	    return handleException (nsae);	}    }    private static Configuration handleException(NoSuchAlgorithmException nsae)		throws NoSuchAlgorithmException {	Throwable cause = nsae.getCause();	if (cause instanceof IllegalArgumentException) {	    throw (IllegalArgumentException)cause;	}	throw nsae;    }    /**     * Return the Provider of this Configuration.     *     * <p> This Configuration instance will only have a Provider if it     * was obtained via a call to <code>Configuration.getInstance</code>.     * Otherwise this method returns null.     *     * @return the Provider of this Configuration, or null.     *     * @since 1.6     */    public Provider getProvider() {	return null;    }    /**     * Return the type of this Configuration.     *     * <p> This Configuration instance will only have a type if it     * was obtained via a call to <code>Configuration.getInstance</code>.     * Otherwise this method returns null.     *     * @return the type of this Configuration, or null.     *     * @since 1.6     */    public String getType() {	return null;    }    /**     * Return Configuration parameters.     *     * <p> This Configuration instance will only have parameters if it     * was obtained via a call to <code>Configuration.getInstance</code>.     * Otherwise this method returns null.     *     * @return Configuration parameters, or null.     *     * @since 1.6     */    public Configuration.Parameters getParameters() {	return null;    }    /**     * Retrieve the AppConfigurationEntries for the specified <i>name</i>     * from this Configuration.     *     * <p>     *     * @param name the name used to index the Configuration.     *      * @return an array of AppConfigurationEntries for the specified <i>name</i>     *		from this Configuration, or null if there are no entries     *		for the specified <i>name</i>     */    public abstract AppConfigurationEntry[] getAppConfigurationEntry							(String name);    /**     * Refresh and reload the Configuration.     *     * <p> This method causes this Configuration object to refresh/reload its     * contents in an implementation-dependent manner.     * For example, if this Configuration object stores its entries in a file,     * calling <code>refresh</code> may cause the file to be re-read.     *     * <p> The default implementation of this method does nothing.     * This method should be overridden if a refresh operation is supported     * by the implementation.     *     * @exception SecurityException if the caller does not have permission     *				to refresh its Configuration.     */    public void refresh() { }    /**     * This subclass is returned by the getInstance calls.  All Configuration     * calls are delegated to the underlying ConfigurationSpi.     */    private static class ConfigDelegate extends Configuration {        private ConfigurationSpi spi;        private Provider p;        private String type;        private Configuration.Parameters params;        private ConfigDelegate(ConfigurationSpi spi, Provider p,                        String type, Configuration.Parameters params) {            this.spi = spi;            this.p = p;            this.type = type;            this.params = params;        }        public String getType() { return type; }        public Configuration.Parameters getParameters() { return params; }        public Provider getProvider() { return p; }	public AppConfigurationEntry[] getAppConfigurationEntry(String name) {            return spi.engineGetAppConfigurationEntry(name);	}        public void refresh() {            spi.engineRefresh();        }    }    /**     * This represents a marker interface for Configuration parameters.     *     * @since 1.6     */    public static interface Parameters { }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -