"org.apache.catalina.webresources.TomcatURLStreamHandlerFactory", getClass().getClassLoader())) { TomcatURLStreamHandlerFactory.register();
protected void configureSslStoreProvider(AbstractHttp11JsseProtocol<?> protocol, SslStoreProvider sslStoreProvider) { Assert.isInstanceOf(Http11NioProtocol.class, protocol, "SslStoreProvider can only be used with Http11NioProtocol"); TomcatURLStreamHandlerFactory instance = TomcatURLStreamHandlerFactory .getInstance(); instance.addUserFactory( new SslStoreProviderUrlStreamHandlerFactory(sslStoreProvider)); try { if (sslStoreProvider.getKeyStore() != null) { protocol.setKeystorePass(""); protocol.setKeystoreFile( SslStoreProviderUrlStreamHandlerFactory.KEY_STORE_URL); } if (sslStoreProvider.getTrustStore() != null) { protocol.setTruststorePass(""); protocol.setTruststoreFile( SslStoreProviderUrlStreamHandlerFactory.TRUST_STORE_URL); } } catch (Exception ex) { throw new WebServerException("Could not load store: " + ex.getMessage(), ex); } }
/** * Register this factory with the JVM. May be called more than once. The * implementation ensures that registration only occurs once. * * @return <code>true</code> if the factory is already registered with the * JVM or was successfully registered as a result of this call. * <code>false</code> if the factory was disabled prior to this * call. */ public static boolean register() { return getInstanceInternal(true).isRegistered(); }
private static TomcatURLStreamHandlerFactory getInstanceInternal(boolean register) { // Double checked locking. OK because instance is volatile. if (instance == null) { synchronized (TomcatURLStreamHandlerFactory.class) { if (instance == null) { instance = new TomcatURLStreamHandlerFactory(register); } } } return instance; }
/** * Obtain a reference to the singleton instance. It is recommended that * callers check the value of {@link #isRegistered()} before using the * returned instance. * * @return A reference to the singleton instance */ public static TomcatURLStreamHandlerFactory getInstance() { getInstanceInternal(true); return instance; }
TomcatURLStreamHandlerFactory.release(this);
/** * Prevent this this factory from registering with the JVM. May be called * more than once. * * @return <code>true</code> if the factory is already disabled or was * successfully disabled as a result of this call. * <code>false</code> if the factory was already registered prior * to this call. */ public static boolean disable() { return !getInstanceInternal(false).isRegistered(); }
private static TomcatURLStreamHandlerFactory getInstanceInternal(boolean register) { // Double checked locking. OK because instance is volatile. if (instance == null) { synchronized (TomcatURLStreamHandlerFactory.class) { if (instance == null) { instance = new TomcatURLStreamHandlerFactory(register); } } } return instance; }
/** * Obtain a reference to the singleton instance. It is recommended that * callers check the value of {@link #isRegistered()} before using the * returned instance. */ public static TomcatURLStreamHandlerFactory getInstance() { getInstanceInternal(true); return instance; }
TomcatURLStreamHandlerFactory.release(this);
/** * Prevent this this factory from registering with the JVM. May be called * more than once. * * @return <code>true</code> if the factory is already disabled or was * successfully disabled as a result of this call. * <code>false</code> if the factory was already registered prior * to this call. */ public static boolean disable() { return !getInstanceInternal(false).isRegistered(); }
protected void registerURLStreamHandlerFactory() { // Ensure support for jar:war:file:/ URLs will be available (required // for resource JARs in packed WAR files). TomcatURLStreamHandlerFactory.register(); }
private static TomcatURLStreamHandlerFactory getInstanceInternal(boolean register) { // Double checked locking. OK because instance is volatile. if (instance == null) { synchronized (TomcatURLStreamHandlerFactory.class) { if (instance == null) { instance = new TomcatURLStreamHandlerFactory(register); } } } return instance; }
/** * Obtain a reference to the singleton instance. It is recommended that * callers check the value of {@link #isRegistered()} before using the * returned instance. * * @return A reference to the singleton instance */ public static TomcatURLStreamHandlerFactory getInstance() { getInstanceInternal(true); return instance; }
TomcatURLStreamHandlerFactory.release(this);
/** * Register this factory with the JVM. May be called more than once. The * implementation ensures that registration only occurs once. * * @return <code>true</code> if the factory is already registered with the * JVM or was successfully registered as a result of this call. * <code>false</code> if the factory was disabled prior to this * call. */ public static boolean register() { return getInstanceInternal(true).isRegistered(); }
protected void registerURLStreamHandlerFactory() { // Ensure support for jar:war:file:/ URLs will be available (required // for resource JARs in packed WAR files). TomcatURLStreamHandlerFactory.register(); }
/** * Prevent this this factory from registering with the JVM. May be called * more than once. * * @return <code>true</code> if the factory is already disabled or was * successfully disabled as a result of this call. * <code>false</code> if the factory was already registered prior * to this call. */ public static boolean disable() { return !getInstanceInternal(false).isRegistered(); }
@Override protected void initInternal() throws LifecycleException { super.initInternal(); cacheJmxName = register(cache, getObjectNameKeyProperties() + ",name=Cache"); // Ensure support for jar:war:file:/ URLs will be available (required // for resource JARs in packed WAR files). TomcatURLStreamHandlerFactory.register(); if (context == null) { throw new IllegalStateException( sm.getString("standardRoot.noContext")); } for (ArrayList<WebResourceSet> list : allResources) { for (WebResourceSet webResourceSet : list) { webResourceSet.init(); } } }
/** * Register this factory with the JVM. May be called more than once. The * implementation ensures that registration only occurs once. * * @return <code>true</code> if the factory is already registered with the * JVM or was successfully registered as a result of this call. * <code>false</code> if the factory was disabled prior to this * call. */ public static boolean register() { return getInstanceInternal(true).isRegistered(); }