Package javax.jmdns.impl
Interface DNSStatefulObject
-
- All Known Implementing Classes:
DNSStatefulObject.DefaultImplementation,HostInfo,HostInfo.HostInfoState,JmDNSImpl,ServiceInfoImpl,ServiceInfoImpl.ServiceInfoState
public interface DNSStatefulObjectSets of methods to manage the state machine.
Implementation note: This interface is accessed from multiple threads. The implementation must be thread safe.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classDNSStatefulObject.DefaultImplementationstatic classDNSStatefulObject.DNSStatefulObjectSemaphoreThis class define a semaphore.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanadvanceState(DNSTask task)Sets the state and notifies all objects that wait on the ServiceInfo.voidassociateWithTask(DNSTask task, DNSState state)Sets the task associated with this Object.booleancancelState()Sets the state and notifies all objects that wait on the ServiceInfo.booleancloseState()Sets the state and notifies all objects that wait on the ServiceInfo.JmDNSImplgetDns()Returns the DNS associated with this object.booleanisAnnounced()Returns true, if this is an announced state.booleanisAnnouncing()Returns true, if this is an announcing state.booleanisAssociatedWithTask(DNSTask task, DNSState state)Checks if this object is associated with the task and in the same state.booleanisCanceled()Returns true, if this is a canceled state.booleanisCanceling()Returns true, if this is a canceling state.booleanisClosed()Returns true, if this is a closed state.booleanisClosing()Returns true, if this is a closing state.booleanisProbing()Returns true, if this is a probing state.booleanrecoverState()Sets the state and notifies all objects that wait on the ServiceInfo.voidremoveAssociationWithTask(DNSTask task)Remove the association of the task with this Object.booleanrevertState()Sets the state and notifies all objects that wait on the ServiceInfo.booleanwaitForAnnounced(long timeout)Waits for the object to be announced.booleanwaitForCanceled(long timeout)Waits for the object to be canceled.
-
-
-
Method Detail
-
getDns
JmDNSImpl getDns()
Returns the DNS associated with this object.- Returns:
- DNS resolver
-
associateWithTask
void associateWithTask(DNSTask task, DNSState state)
Sets the task associated with this Object.- Parameters:
task- associated taskstate- state of the task
-
removeAssociationWithTask
void removeAssociationWithTask(DNSTask task)
Remove the association of the task with this Object.- Parameters:
task- associated task
-
isAssociatedWithTask
boolean isAssociatedWithTask(DNSTask task, DNSState state)
Checks if this object is associated with the task and in the same state.- Parameters:
task- associated taskstate- state of the task- Returns:
trueis the task is associated with this object,falseotherwise.
-
advanceState
boolean advanceState(DNSTask task)
Sets the state and notifies all objects that wait on the ServiceInfo.- Parameters:
task- associated task- Returns:
trueif the state was changed by this thread,falseotherwise.- See Also:
DNSState.advance()
-
revertState
boolean revertState()
Sets the state and notifies all objects that wait on the ServiceInfo.- Returns:
trueif the state was changed by this thread,falseotherwise.- See Also:
DNSState.revert()
-
cancelState
boolean cancelState()
Sets the state and notifies all objects that wait on the ServiceInfo.- Returns:
trueif the state was changed by this thread,falseotherwise.
-
closeState
boolean closeState()
Sets the state and notifies all objects that wait on the ServiceInfo.- Returns:
trueif the state was changed by this thread,falseotherwise.
-
recoverState
boolean recoverState()
Sets the state and notifies all objects that wait on the ServiceInfo.- Returns:
trueif the state was changed by this thread,falseotherwise.
-
isProbing
boolean isProbing()
Returns true, if this is a probing state.- Returns:
trueif probing state,falseotherwise
-
isAnnouncing
boolean isAnnouncing()
Returns true, if this is an announcing state.- Returns:
trueif announcing state,falseotherwise
-
isAnnounced
boolean isAnnounced()
Returns true, if this is an announced state.- Returns:
trueif announced state,falseotherwise
-
isCanceling
boolean isCanceling()
Returns true, if this is a canceling state.- Returns:
trueif canceling state,falseotherwise
-
isCanceled
boolean isCanceled()
Returns true, if this is a canceled state.- Returns:
trueif canceled state,falseotherwise
-
isClosing
boolean isClosing()
Returns true, if this is a closing state.- Returns:
trueif closing state,falseotherwise
-
isClosed
boolean isClosed()
Returns true, if this is a closed state.- Returns:
trueif closed state,falseotherwise
-
waitForAnnounced
boolean waitForAnnounced(long timeout)
Waits for the object to be announced.- Parameters:
timeout- the maximum time to wait in milliseconds.- Returns:
trueif the object is announced,falseotherwise
-
waitForCanceled
boolean waitForCanceled(long timeout)
Waits for the object to be canceled.- Parameters:
timeout- the maximum time to wait in milliseconds.- Returns:
trueif the object is canceled,falseotherwise
-
-