Package org.jdrupes.vmoperator.manager
Class PoolMonitor
java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
org.jdrupes.vmoperator.manager.AbstractMonitor<K8sDynamicModel,K8sDynamicModels,Channel>
org.jdrupes.vmoperator.manager.PoolMonitor
- All Implemented Interfaces:
Iterable<ComponentType>,Channel,ComponentType,Eligible,Manager
Watches for changes of VM pools.
Reports the changes using
VmPoolChanged events fired on a special pipeline to
avoid concurrent change informations.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jgrapes.core.Channel
Channel.Default -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidhandleChange(K8sClient client, io.kubernetes.client.util.Watch.Response<K8sDynamicModel> response) Handle an observed change.voidonAttached(Attached event) On attached.voidonGetPools(GetPools event) Return the requested pools.voidTrack VM definition changes.protected voidInvoked byAbstractMonitor.onStart(Start)after the namespace has been configured and before starting the observer.Methods inherited from class org.jdrupes.vmoperator.manager.AbstractMonitor
client, client, context, context, namespace, namespace, onConfigurationUpdate, onStart, options, optionsMethods inherited from class org.jgrapes.core.Component
channel, component, defaultCriterion, isEligibleFor, setNameMethods inherited from class org.jgrapes.core.internal.ComponentVertex
activeEventPipeline, addHandler, attach, channelReplacements, children, componentPath, componentVertex, detach, fire, initComponentsHandlers, iterator, name, newEventPipeline, newEventPipeline, parent, registerAsGenerator, root, toString, unregisterAsGeneratorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PoolMonitor
Instantiates a new VM pool manager.- Parameters:
componentChannel- the component channel
-
-
Method Details
-
onAttached
On attached.- Parameters:
event- the event
-
prepareMonitoring
Description copied from class:AbstractMonitorInvoked byAbstractMonitor.onStart(Start)after the namespace has been configured and before starting the observer.This is the last opportunity to invoke
AbstractMonitor.context(APIResource).- Overrides:
prepareMonitoringin classAbstractMonitor<K8sDynamicModel,K8sDynamicModels, Channel> - Throws:
IOException- Signals that an I/O exception has occurred.io.kubernetes.client.openapi.ApiException- the api exception
-
handleChange
protected void handleChange(K8sClient client, io.kubernetes.client.util.Watch.Response<K8sDynamicModel> response) Description copied from class:AbstractMonitorHandle an observed change.The method is invoked by the observer thread(s). It is the responsibility of the implementing class to fire derived events on the appropriate event pipeline.
- Specified by:
handleChangein classAbstractMonitor<K8sDynamicModel,K8sDynamicModels, Channel> - Parameters:
client- the clientresponse- the change
-
onVmResourceChanged
@Handler public void onVmResourceChanged(VmResourceChanged event) throws io.kubernetes.client.openapi.ApiException Track VM definition changes.- Parameters:
event- the event- Throws:
io.kubernetes.client.openapi.ApiException
-
onGetPools
Return the requested pools.- Parameters:
event- the event
-