org.fourthline.cling.support.lastchange
Class LastChangeAwareServiceManager<T extends LastChangeDelegator>
java.lang.Object
org.fourthline.cling.model.DefaultServiceManager<T>
org.fourthline.cling.support.lastchange.LastChangeAwareServiceManager<T>
- All Implemented Interfaces:
- ServiceManager<T>
public class LastChangeAwareServiceManager<T extends LastChangeDelegator>
- extends DefaultServiceManager<T>
Handles the "initial" event state for GENA subscriptions to services using LastChange.
When a GENA subscription is made on your AVTransport/RenderingControl service, you have to
read the initial state of the service. Ususally Cling would do this for you and simply
access all the state variables of your service behind the scenes. But the
AVTransport/RenderingControl service doesn't use regular UPnP state variable eventing
internally, they rely on the awful "LastChange" mechanism for their "logical" instances.
Use this ServiceManager
instead of the default one for
these services.
- Author:
- Christian Bauer
Methods inherited from class org.fourthline.cling.model.DefaultServiceManager |
createPropertyChangeListener, createPropertyChangeSupport, createServiceInstance, execute, getCurrentState, getCurrentState, getImplementation, getLockTimeoutMillis, getPropertyChangeSupport, getService, init, lock, toString, unlock |
lastChangeParser
protected final LastChangeParser lastChangeParser
LastChangeAwareServiceManager
public LastChangeAwareServiceManager(LocalService<T> localService,
LastChangeParser lastChangeParser)
LastChangeAwareServiceManager
public LastChangeAwareServiceManager(LocalService<T> localService,
Class<T> serviceClass,
LastChangeParser lastChangeParser)
getLastChangeParser
protected LastChangeParser getLastChangeParser()
fireLastChange
public void fireLastChange()
- Call this method to propagate all accumulated "LastChange" values to GENA subscribers.
readInitialEventedStateVariableValues
protected Collection<StateVariableValue> readInitialEventedStateVariableValues()
throws Exception
- Overrides:
readInitialEventedStateVariableValues
in class DefaultServiceManager<T extends LastChangeDelegator>
- Throws:
Exception
Copyright © 2013 4th Line GmbH, Switzerland. All Rights Reserved.