java.lang.Object
net.i2p.router.JobImpl
All Implemented Interfaces:
Job
Direct Known Subclasses:
Analysis, Analysis.InitJob, Banlist.Cleanup, Blocklist.BanlistJob, Blocklist.CleanupJob, Blocklist.ReadinJob, BootCommSystemJob, BootNetworkDbJob, BootPeerManagerJob, BuildHandler.HandleReq, BuildHandler.TimeoutReq, BuildHandler.TunnelBuildMessageHandlerJob, BuildHandler.TunnelBuildNextHopFailJob, BuildHandler.TunnelBuildReplyMessageHandlerJob, BuildRequestor.TunnelBuildFirstHopFailJob, BuildTrustedLinksJob, ClientConnectionRunner.MessageDeliveryStatusUpdate, ClientManager.DistributeLocal, ClientManager.HandleJob, ContactDrivenRefreshJob, CreateRouterInfoJob, CreateSessionJob, ExpireJob, ExpireLeasesJob, ExpireRoutersJob, FloodfillMonitorJob, FloodfillNetworkDatabaseFacade.DropLookupFailedJob, FloodfillNetworkDatabaseFacade.DropLookupFoundJob, FloodfillNetworkDatabaseFacade.FloodFailedJob, FloodfillNetworkDatabaseFacade.FloodSuccessJob, FloodfillRouterInfoFloodJob, FloodfillVerifyStoreJob, FloodfillVerifyStoreJob.VerifyReplyJob, FloodfillVerifyStoreJob.VerifyTimeoutJob, FloodOnlyLookupMatchJob, FloodOnlyLookupTimeoutJob, FloodSearchJob, HandleDatabaseLookupMessageJob, HandleFloodfillDatabaseStoreMessageJob, HandleGarlicMessageJob, InboundGatewayReceiver.ReceiveJob, InNetMessagePool.SharedShortCircuitDataJob, InNetMessagePool.SharedShortCircuitGatewayJob, IntroducerLookupJob, IterativeLookupJob, IterativeTimeoutJob, KademliaNetworkDatabaseFacade.BatchRepublishJob, KademliaNetworkDatabaseFacade.PurgeMatchingRoutersJob, KademliaNetworkDatabaseFacade.RefreshClientLeaseSetsJob, KeyManager.SynchronizeKeysJob, LoadClientAppsJob, LoadRouterInfoJob, LookupDestJob, LookupDestJob.DoneJob, MessageHistory.ReinitializeJob, MessageHistory.WriteJob, MessageReceivedJob, NetDbRenderer.LookupWaiter, OutboundClientMessageOneShotJob, OutboundClientMessageOneShotJob.DispatchJob, OutboundClientMessageOneShotJob.LookupLeaseSetFailedJob, OutboundClientMessageOneShotJob.SendJob, OutboundClientMessageOneShotJob.SendSuccessJob, OutboundClientMessageOneShotJob.SendTimeoutJob, OutboundMessageDistributor.DistributeJob, OutboundReceiver.LookupFailedJob, OutboundReceiver.SendFailedJob, OutboundReceiver.SendJob, PeerTestJob, PeerTestJob.PeerReplyFoundJob, PeerTestJob.PeerReplyTimeoutJob, PersistentDataStore.ReadJob, PersistentDataStore.ReadRouterJob, PersistRouterInfoJob, ProbeStalePeerJob, PublishLocalRouterInfoJob, ReadConfigJob, RebuildRouterInfoJob, RefreshRoutersJob, ReportAbuseJob, RepublishLeaseSetJob, RepublishLeaseSetJob.OnRepublishFailure, RepublishLeaseSetJob.OnRepublishSuccess, RequestLeaseSetJob, RequestLeaseSetJob.CheckLeaseRequestStatus, SearchJob, SearchJob.FailedJob, SearchJob.RequeuePending, SearchReplyJob, SearchUpdateReplyFoundJob, SendMessageDirectJob, SingleLookupJob, StartAcceptingClientsJob, StartExplorersJob, StartupJob, StoreJob, StoreJob.FailedJob, StoreJob.SendSuccessJob, StoreJob.WaitJob, TestJob, TestJob.OnTestReply, TestJob.OnTestTimeout, TestJob.PumpJob, TunnelDispatcher.LeaveTunnel, TunnelParticipant.Found, TunnelParticipant.SendJob, TunnelParticipant.TimeoutJob, TunnelPeerSelector.PreConnectFailJob, TunnelPoolManager.BootstrapPool, TunnelPoolManager.FastTierProbeJob, TunnelPoolManager.RefreshLeaseSetsJob, TunnelPoolManager.RemoveSlowTunnelsJob, UpdateRoutingKeyModifierJob, VMCommSystem.ReceiveJob

public abstract class JobImplextends Object implements Job
Base implementation of a Job

For use by the router only. Not to be used by applications or plugins.

  • Field Details

    • _context

      private final RouterContext _context
      The router context the job runs in.
    • _timing

      private final JobTiming _timing
      When the job was scheduled and ran.
    • _idSrc

      private static final AtomicLong _idSrc
      Hands out the next job id.
    • _id

      public final long _id
      Unique job identifier. Public so the job number can be referenced for tunnel builds on /jobs.
    • _madeReadyOn

      private volatile long _madeReadyOn
      When the job was last made ready, in ms.
  • Constructor Details

    • JobImpl

      public JobImpl(RouterContext context)
      Create a new JobImpl.
      Parameters:
      context - the router context that will run this job
  • Method Details

    • getJobId

      public long getJobId()
      The unique job ID for this job.
      Specified by:
      getJobId in interface Job
      Returns:
      the unique job identifier
    • getTiming

      public JobTiming getTiming()
      The timing object for this job.
      Specified by:
      getTiming in interface Job
      Returns:
      the JobTiming object controlling when this job runs
    • getContext

      public final RouterContext getContext()
      The router context that this job belongs to.
      Returns:
      the RouterContext for this job
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getMadeReadyOn

      public long getMadeReadyOn()
      The timestamp when this job was last made ready for execution.
      Returns:
      timestamp in milliseconds when job was made ready, or 0 if not yet ready
    • madeReady

      public void madeReady(long now)
      For JobQueue only, not for external use.
      Parameters:
      now - the current time in milliseconds
    • dropped

      public void dropped()
      Default implementation does nothing. Called when the job is dropped due to router overload. Subclasses can override to perform cleanup or requeueing of other tasks.
      Specified by:
      dropped in interface Job
    • requeue

      protected void requeue(long delayMs)
      Requeue this job to run after the specified delay. Warning - only call this from runJob() or if the Job is not already queued, otherwise it may get the job queue out of order.
      Parameters:
      delayMs - the delay in milliseconds before the job should run again