- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.util.ssl.KeyStoreScanner
-
- All Implemented Interfaces:
Container,Destroyable,Dumpable,Dumpable.DumpableContainer,LifeCycle,Scanner.DiscreteListener,Scanner.Listener
public class KeyStoreScanner extends ContainerLifeCycle implements Scanner.DiscreteListener
The
KeyStoreScanneris used to monitor the KeyStore file used by theSslContextFactory. It will reload theSslContextFactoryif it detects that the KeyStore file has been modified.If the TrustStore file needs to be changed, then this should be done before touching the KeyStore file, the
SslContextFactory.reload(Consumer)will only occur after the KeyStore file has been modified.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopException
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Constructor Summary
Constructors Constructor Description KeyStoreScanner(SslContextFactory sslContextFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfileAdded(java.lang.String filename)Called when a file is added.voidfileChanged(java.lang.String filename)Called when a file is changed.voidfileRemoved(java.lang.String filename)Called when a file is removed.intgetScanInterval()voidreload()booleanscan(long waitMillis)voidsetScanInterval(int scanInterval)-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListeners
-
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Methods inherited from interface org.eclipse.jetty.util.Scanner.DiscreteListener
pathAdded, pathChanged, pathRemoved
-
-
-
-
Constructor Detail
-
KeyStoreScanner
public KeyStoreScanner(SslContextFactory sslContextFactory)
-
-
Method Detail
-
fileAdded
public void fileAdded(java.lang.String filename)
Description copied from interface:Scanner.DiscreteListenerCalled when a file is added. May not be called ifScanner.DiscreteListener.pathAdded(Path)is overridden.- Specified by:
fileAddedin interfaceScanner.DiscreteListener- Parameters:
filename- thePath.toRealPath(LinkOption...)as a string of the added file
-
fileChanged
public void fileChanged(java.lang.String filename)
Description copied from interface:Scanner.DiscreteListenerCalled when a file is changed. May not be called ifScanner.DiscreteListener.pathChanged(Path)is overridden.- Specified by:
fileChangedin interfaceScanner.DiscreteListener- Parameters:
filename- thePath.toRealPath(LinkOption...)as a string of the changed file
-
fileRemoved
public void fileRemoved(java.lang.String filename)
Description copied from interface:Scanner.DiscreteListenerCalled when a file is removed. May not be called ifScanner.DiscreteListener.pathRemoved(Path)is overridden.- Specified by:
fileRemovedin interfaceScanner.DiscreteListener- Parameters:
filename- thePath.toRealPath(LinkOption...)as a string of the removed file
-
scan
@ManagedOperation(value="Scan for changes in the SSL Keystore", impact="ACTION") public boolean scan(long waitMillis)
-
reload
@ManagedOperation(value="Reload the SSL Keystore", impact="ACTION") public void reload()
-
getScanInterval
@ManagedAttribute("scanning interval to detect changes which need reloaded") public int getScanInterval()
-
setScanInterval
public void setScanInterval(int scanInterval)
-
-