org.teleal.cling.protocol
Class ReceivingAsync<M extends UpnpMessage>
java.lang.Object
org.teleal.cling.protocol.ReceivingAsync<M>
- Type Parameters:
M
- The type of UPnP message handled by this protocol.
- All Implemented Interfaces:
- Runnable
- Direct Known Subclasses:
- ReceivingNotification, ReceivingSearch, ReceivingSearchResponse, ReceivingSync
public abstract class ReceivingAsync<M extends UpnpMessage>
- extends Object
- implements Runnable
Supertype for all asynchronously executing protocols, handling reception of UPnP messages.
After instantiation by the ProtocolFactory
, this protocol run()
s and
calls its own waitBeforeExecution()
method. By default, the protocol does not wait
before then proceeding with execute()
.
- Author:
- Christian Bauer
ReceivingAsync
protected ReceivingAsync(UpnpService upnpService,
M inputMessage)
getUpnpService
public UpnpService getUpnpService()
getInputMessage
public M getInputMessage()
run
public void run()
- Specified by:
run
in interface Runnable
waitBeforeExecution
protected boolean waitBeforeExecution()
throws InterruptedException
- Provides an opportunity to pause before executing the protocol.
- Returns:
true
(default) if execution should continue after waiting.
- Throws:
InterruptedException
- If waiting has been interrupted, which also stops execution.
execute
protected abstract void execute()
getFirstHeader
protected <H extends UpnpHeader> H getFirstHeader(UpnpHeader.Type headerType,
Class<H> subtype)
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2011 Teleal GmbH, Switzerland. All Rights Reserved.