JmDNS 3.4.1

javax.jmdns.impl.tasks.state
Class DNSStateTask

java.lang.Object
  extended by java.util.TimerTask
      extended by javax.jmdns.impl.tasks.DNSTask
          extended by javax.jmdns.impl.tasks.state.DNSStateTask
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
Announcer, Canceler, Prober, Renewer

public abstract class DNSStateTask
extends DNSTask

This is the root class for all state tasks. These tasks work with objects that implements the DNSStatefulObject interface and therefore participate in the state machine.

Author:
Pierre Frisch

Constructor Summary
DNSStateTask(JmDNSImpl jmDNSImpl, int ttl)
           
 
Method Summary
protected  void advanceObjectsState(List<DNSStatefulObject> list)
           
protected abstract  void advanceTask()
           
protected  void associate(DNSState state)
          Associate the DNS host and the service infos with this task if not already associated and in the same state.
protected abstract  DNSOutgoing buildOutgoingForDNS(DNSOutgoing out)
           
protected abstract  DNSOutgoing buildOutgoingForInfo(ServiceInfoImpl info, DNSOutgoing out)
           
protected abstract  boolean checkRunCondition()
           
protected abstract  DNSOutgoing createOugoing()
           
static int defaultTTL()
           
abstract  String getTaskDescription()
           
protected  DNSState getTaskState()
           
 int getTTL()
           
protected abstract  void recoverTask(Throwable e)
           
protected  void removeAssociation()
          Remove the DNS host and service info association with this task.
 void run()
           
static void setDefaultTTL(int value)
          For testing only do not use in production.
protected  void setTaskState(DNSState taskState)
           
 
Methods inherited from class javax.jmdns.impl.tasks.DNSTask
addAdditionalAnswer, addAnswer, addAnswer, addAuthoritativeAnswer, addQuestion, getDns, getName, start, toString
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DNSStateTask

public DNSStateTask(JmDNSImpl jmDNSImpl,
                    int ttl)
Parameters:
jmDNSImpl -
ttl -
Method Detail

getTaskDescription

public abstract String getTaskDescription()

defaultTTL

public static int defaultTTL()

setDefaultTTL

public static void setDefaultTTL(int value)
For testing only do not use in production.

Parameters:
value -

getTTL

public int getTTL()
Returns:
the ttl

associate

protected void associate(DNSState state)
Associate the DNS host and the service infos with this task if not already associated and in the same state.

Parameters:
state - target state

removeAssociation

protected void removeAssociation()
Remove the DNS host and service info association with this task.


run

public void run()
Specified by:
run in interface Runnable
Specified by:
run in class TimerTask

checkRunCondition

protected abstract boolean checkRunCondition()

buildOutgoingForDNS

protected abstract DNSOutgoing buildOutgoingForDNS(DNSOutgoing out)
                                            throws IOException
Throws:
IOException

buildOutgoingForInfo

protected abstract DNSOutgoing buildOutgoingForInfo(ServiceInfoImpl info,
                                                    DNSOutgoing out)
                                             throws IOException
Throws:
IOException

createOugoing

protected abstract DNSOutgoing createOugoing()

advanceObjectsState

protected void advanceObjectsState(List<DNSStatefulObject> list)

recoverTask

protected abstract void recoverTask(Throwable e)

advanceTask

protected abstract void advanceTask()

getTaskState

protected DNSState getTaskState()
Returns:
the taskState

setTaskState

protected void setTaskState(DNSState taskState)
Parameters:
taskState - the taskState to set

Last updated 2011-08-25 12:40

Copyright © 2002-2011 JmDNS. All Rights Reserved.