public static class DNSStatefulObject.DefaultImplementation extends java.util.concurrent.locks.ReentrantLock implements DNSStatefulObject
DNSStatefulObject.DefaultImplementation, DNSStatefulObject.DNSStatefulObjectSemaphore| 构造器和说明 |
|---|
DefaultImplementation() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
advanceState(DNSTask task)
Sets the state and notifies all objects that wait on the ServiceInfo.
|
void |
associateWithTask(DNSTask task,
DNSState state)
Sets the task associated with this Object.
|
boolean |
cancelState()
Sets the state and notifies all objects that wait on the ServiceInfo.
|
boolean |
closeState()
Sets the state and notifies all objects that wait on the ServiceInfo.
|
JmDNSImpl |
getDns()
Returns the DNS associated with this object.
|
boolean |
isAnnounced()
Returns true, if this is an announced state.
|
boolean |
isAnnouncing()
Returns true, if this is an announcing state.
|
boolean |
isAssociatedWithTask(DNSTask task,
DNSState state)
Checks if this object is associated with the task and in the same state.
|
boolean |
isCanceled()
Returns true, if this is a canceled state.
|
boolean |
isCanceling()
Returns true, if this is a canceling state.
|
boolean |
isClosed()
Returns true, if this is a closed state.
|
boolean |
isClosing()
Returns true, if this is a closing state.
|
boolean |
isProbing()
Returns true, if this is a probing state.
|
boolean |
recoverState()
Sets the state and notifies all objects that wait on the ServiceInfo.
|
void |
removeAssociationWithTask(DNSTask task)
Remove the association of the task with this Object.
|
boolean |
revertState()
Sets the state and notifies all objects that wait on the ServiceInfo.
|
protected void |
setDns(JmDNSImpl dns) |
protected void |
setState(DNSState state) |
protected void |
setTask(DNSTask task) |
java.lang.String |
toString() |
boolean |
waitForAnnounced(long timeout)
Waits for the object to be announced.
|
boolean |
waitForCanceled(long timeout)
Waits for the object to be canceled.
|
public JmDNSImpl getDns()
getDns 在接口中 DNSStatefulObjectprotected void setDns(JmDNSImpl dns)
public void associateWithTask(DNSTask task, DNSState state)
associateWithTask 在接口中 DNSStatefulObjecttask - associated taskstate - state of the taskpublic void removeAssociationWithTask(DNSTask task)
removeAssociationWithTask 在接口中 DNSStatefulObjecttask - associated taskpublic boolean isAssociatedWithTask(DNSTask task, DNSState state)
isAssociatedWithTask 在接口中 DNSStatefulObjecttask - associated taskstate - state of the tasktrue is the task is associated with this object, false otherwise.protected void setTask(DNSTask task)
protected void setState(DNSState state)
state - the state to setpublic boolean advanceState(DNSTask task)
advanceState 在接口中 DNSStatefulObjecttask - associated tasktrue if the state was changed by this thread, false otherwise.DNSState.advance()public boolean revertState()
revertState 在接口中 DNSStatefulObjecttrue if the state was changed by this thread, false otherwise.DNSState.revert()public boolean cancelState()
cancelState 在接口中 DNSStatefulObjecttrue if the state was changed by this thread, false otherwise.public boolean closeState()
closeState 在接口中 DNSStatefulObjecttrue if the state was changed by this thread, false otherwise.public boolean recoverState()
recoverState 在接口中 DNSStatefulObjecttrue if the state was changed by this thread, false otherwise.public boolean isProbing()
isProbing 在接口中 DNSStatefulObjecttrue if probing state, false otherwisepublic boolean isAnnouncing()
isAnnouncing 在接口中 DNSStatefulObjecttrue if announcing state, false otherwisepublic boolean isAnnounced()
isAnnounced 在接口中 DNSStatefulObjecttrue if announced state, false otherwisepublic boolean isCanceling()
isCanceling 在接口中 DNSStatefulObjecttrue if canceling state, false otherwisepublic boolean isCanceled()
isCanceled 在接口中 DNSStatefulObjecttrue if canceled state, false otherwisepublic boolean isClosing()
isClosing 在接口中 DNSStatefulObjecttrue if closing state, false otherwisepublic boolean isClosed()
isClosed 在接口中 DNSStatefulObjecttrue if closed state, false otherwisepublic boolean waitForAnnounced(long timeout)
waitForAnnounced 在接口中 DNSStatefulObjecttimeout - the maximum time to wait in milliseconds.true if the object is announced, false otherwisepublic boolean waitForCanceled(long timeout)
waitForCanceled 在接口中 DNSStatefulObjecttimeout - the maximum time to wait in milliseconds.true if the object is canceled, false otherwisepublic java.lang.String toString()
toString 在类中 java.util.concurrent.locks.ReentrantLock