Klasse DefaultServiceManager<T>
- Alle implementierten Schnittstellen:
- ServiceManager<T>
 Creates instance of the defined service class when it is first needed (acts as a factory),
 manages the instance in a field (it's shared), and synchronizes (locks) all
 multi-threaded access. A locking attempt will timeout after 500 milliseconds with
 a runtime exception if another operation is already in progress. Override
 getLockTimeoutMillis() to customize this behavior, e.g. if your service
 bean is slow and requires more time for typical action executions or state
 variable reading.
 
- Autor:
- Christian Bauer, Jochen Hiller - Changed to use Compact2 compliant Java Beans
- 
Verschachtelte Klassen - ÜbersichtVerschachtelte KlassenModifizierer und TypKlasseBeschreibungprotected class
- 
FeldübersichtFelderModifizierer und TypFeldBeschreibungprotected final ReentrantLockprotected PropertyChangeSupportprotected final LocalService<T> protected TVon Schnittstelle geerbte Felder org.jupnp.model.ServiceManagerEVENTED_STATE_VARIABLES
- 
KonstruktorübersichtKonstruktorenModifiziererKonstruktorBeschreibungprotectedDefaultServiceManager(LocalService<T> service) DefaultServiceManager(LocalService<T> service, Class<T> serviceClass) 
- 
MethodenübersichtModifizierer und TypMethodeBeschreibungprotected PropertyChangeListenercreatePropertyChangeListener(T serviceImpl) protected PropertyChangeSupportcreatePropertyChangeSupport(T serviceImpl) protected TvoidDouble-dispatch of arbitrary commands, used by action executors and state variable accessors.Reading the state of a service manually.protected Collection<StateVariableValue> getCurrentState(String[] variableNames) protected intProvides the capability to monitor the service for state changes.protected voidinit()protected voidlock()protected Collection<StateVariableValue> toString()protected voidunlock()
- 
Felddetails- 
service
- 
serviceClass
- 
lock
- 
serviceImpl
- 
propertyChangeSupport
 
- 
- 
Konstruktordetails- 
DefaultServiceManager
- 
DefaultServiceManager
 
- 
- 
Methodendetails- 
lockprotected void lock()
- 
unlockprotected void unlock()
- 
getLockTimeoutMillisprotected int getLockTimeoutMillis()
- 
getService- Angegeben von:
- getServicein Schnittstelle- ServiceManager<T>
- Gibt zurück:
- The metadata of the service to which this manager is assigned.
 
- 
getImplementation- Angegeben von:
- getImplementationin Schnittstelle- ServiceManager<T>
- Gibt zurück:
- An instance with the interface expected by the
         bound ActionExecutors andStateVariableAccessors.
 
- 
getPropertyChangeSupportBeschreibung aus Schnittstelle kopiert:ServiceManagerProvides the capability to monitor the service for state changes.The GENA subsystem expects that this adapter will notify its listeners whenever any evented UPnP state variable of the service has changed its state. The following change event is expected: - The property name is the constant ServiceManager.EVENTED_STATE_VARIABLES.
- The "old value" can be null, only the current state has to be included.
- The "new value" is a CollectionofStateVariableValue, representing the current state of the service after the change.
 The collection has to include values for all state variables, no matter what state variable was updated. Any other event is ignored (e.g. individual property changes). - Angegeben von:
- getPropertyChangeSupportin Schnittstelle- ServiceManager<T>
- Gibt zurück:
- An adapter that will notify its listeners whenever any evented state variable changes.
 
- The property name is the constant 
- 
executeBeschreibung aus Schnittstelle kopiert:ServiceManagerDouble-dispatch of arbitrary commands, used by action executors and state variable accessors.The service manager will execute the given Commandand it might decorate the execution, for example, by locking/unlocking access to a shared service implementation before and after the execution.- Angegeben von:
- executein Schnittstelle- ServiceManager<T>
- Parameter:
- cmd- The command to execute.
- Löst aus:
- Exception- Any exception, without wrapping, as thrown by- Command.execute(ServiceManager)
 
- 
getCurrentStateBeschreibung aus Schnittstelle kopiert:ServiceManagerReading the state of a service manually.- Angegeben von:
- getCurrentStatein Schnittstelle- ServiceManager<T>
- Gibt zurück:
- A CollectionofStateVariableValue, representing the current state of the service, that is, all evented state variable values.
- Löst aus:
- Exception- Any error that occurred when the service's state was accessed.
 
- 
getCurrentState- Löst aus:
- Exception
 
- 
initprotected void init()
- 
createServiceInstance
- 
createPropertyChangeSupport- Löst aus:
- Exception
 
- 
createPropertyChangeListener- Löst aus:
- Exception
 
- 
readInitialEventedStateVariableValues- Löst aus:
- Exception
 
- 
toString
 
-