Class PerPollEventSource<R,P extends io.fabric8.kubernetes.api.model.HasMetadata>

java.lang.Object
cn.sliew.milky.common.lifecycle.AbstractLifeCycle
All Implemented Interfaces:
EventSource, ResourceEventAware<P>, ResourceEventSource<R,P>, cn.sliew.milky.common.lifecycle.LifeCycle

public class PerPollEventSource<R,P extends io.fabric8.kubernetes.api.model.HasMetadata> extends AbstractResourceEventSource<R,P> implements ResourceEventAware<P>
  • Nested Class Summary

    Nested classes/interfaces inherited from interface cn.sliew.milky.common.lifecycle.LifeCycle

    cn.sliew.milky.common.lifecycle.LifeCycle.LifeCycleResult, cn.sliew.milky.common.lifecycle.LifeCycle.LifeCycleSupportResult, cn.sliew.milky.common.lifecycle.LifeCycle.State
  • Constructor Summary

    Constructors
    Constructor
    Description
    PerPollEventSource(Class<R> resourceClass, Duration period)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    cancel(ResourceID resourceID)
     
    protected void
     
    protected void
     
    protected void
     
    void
    onResourceCreated(P resource)
     
    void
    onResourceDeleted(P resource)
     
    void
    onResourceUpdated(P newResource, P oldResource)
     
    void
    schedule(P resource, Duration delay)
     

    Methods inherited from class cn.sliew.carp.module.kubernetes.watch.source.event.source.AbstractResourceEventSource

    getResourceType

    Methods inherited from class cn.sliew.milky.common.lifecycle.AbstractLifeCycle

    addLifeCycleListener, getState, initialize, isStarted, isStopped, removeLifeCycleListener, start, stop, stop, supportInitialize, supportStart, supportStop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface cn.sliew.milky.common.lifecycle.LifeCycle

    addLifeCycleListener, getState, initialize, isStarted, isStopped, removeLifeCycleListener, start, stop, stop, supportInitialize, supportStart, supportStop
  • Constructor Details

    • PerPollEventSource

      public PerPollEventSource(Class<R> resourceClass, Duration period)
  • Method Details

    • doInitialize

      protected void doInitialize()
      Specified by:
      doInitialize in class cn.sliew.milky.common.lifecycle.AbstractLifeCycle
    • doStart

      protected void doStart()
      Specified by:
      doStart in class cn.sliew.milky.common.lifecycle.AbstractLifeCycle
    • doStop

      protected void doStop()
      Specified by:
      doStop in class cn.sliew.milky.common.lifecycle.AbstractLifeCycle
    • onResourceCreated

      public void onResourceCreated(P resource)
      Specified by:
      onResourceCreated in interface ResourceEventAware<R>
    • onResourceUpdated

      public void onResourceUpdated(P newResource, P oldResource)
      Specified by:
      onResourceUpdated in interface ResourceEventAware<R>
    • onResourceDeleted

      public void onResourceDeleted(P resource)
      Specified by:
      onResourceDeleted in interface ResourceEventAware<R>
    • schedule

      public void schedule(P resource, Duration delay)
    • cancel

      public void cancel(ResourceID resourceID)