Schnittstelle ServiceManager<T>
- Typparameter:
T- The interface expected by the boundActionExecutors andStateVariableAccessors.
- Alle bekannten Implementierungsklassen:
DefaultServiceManager
The UPnP core will always access a local service implementation through
this manager, available with LocalService.getManager():
-
The
ActionExecutors use the manager to process UPnP control invocations. It's the service manager's job to translate such an action invocation into an actual method invocation, or any other procedure that satisfies the requirements. TheActionExecutorworks together with the manager, for example, theMethodActionExecutorexpects that an action method can be invoked through reflection on the instance returned by the manager'sgetImplementation()method. This is possible with the theDefaultServiceManager. A different service manager might require a different set of action executors, and vice versa. -
The
StateVariableAccessors use the manager to process UPnP state variable queries and GENA eventing. It's the service manager's job to return an actual value when a state variable has to be read. TheStateVariableAccessorworks together with the service manager, for example, theFieldStateVariableAccessorexpects that a state variable value can be read through reflection on a field, of the instance returned bygetImplementation(). This is possible with theDefaultServiceManager. A different service manager might require a different set of state variable accessors, and vice versa. - A service manager has to notify the UPnP core, and especially the GENA eventing system, whenever the state of any evented UPnP state variable changes. For new subscriptions GENA also has to read the current state of the service manually, when the subscription has been established and an initial event message has to be send to the subscriber.
A service manager can implement these concerns in any way imaginable. It has to be thread-safe.
- Autor:
- Christian Bauer, Jochen Hiller - Changed to use Compact2 compliant Java Beans
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final StringUse this property name when propagating change events that affect any evented UPnP state variable. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidDouble-dispatch of arbitrary commands, used by action executors and state variable accessors.Reading the state of a service manually.Provides the capability to monitor the service for state changes.
-
Felddetails
-
EVENTED_STATE_VARIABLES
Use this property name when propagating change events that affect any evented UPnP state variable. This name is detected by the GENA subsystem.- Siehe auch:
-
-
Methodendetails
-
getService
LocalService<T> getService()- Gibt zurück:
- The metadata of the service to which this manager is assigned.
-
getImplementation
T getImplementation()- Gibt zurück:
- An instance with the interface expected by the
bound
ActionExecutors andStateVariableAccessors.
-
execute
Double-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.- Parameter:
cmd- The command to execute.- Löst aus:
Exception- Any exception, without wrapping, as thrown byCommand.execute(ServiceManager)
-
getPropertyChangeSupport
PropertyChangeSupport getPropertyChangeSupport()Provides 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
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).
- Gibt zurück:
- An adapter that will notify its listeners whenever any evented state variable changes.
- The property name is the constant
-
getCurrentState
Reading the state of a service manually.- 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.
-