YAACC - UPNP Client and Server
|
Binds the metadata of a service to a service implementation, unified interface for accessing local services. More...
Public Member Functions | |
LocalService< T > | getService () |
T | getImplementation () |
void | execute (Command< T > cmd) throws Exception |
Double-dispatch of arbitrary commands, used by action executors and state variable accessors. | |
PropertyChangeSupport | getPropertyChangeSupport () |
Provides the capability to monitor the service for state changes. | |
Collection< StateVariableValue > | getCurrentState () throws Exception |
Reading the state of a service manually. | |
Static Public Attributes | |
static final String | EVENTED_STATE_VARIABLES = "_EventedStateVariables" |
Use this property name when propagating change events that affect any evented UPnP state variable. | |
Binds the metadata of a service to a service implementation, unified interface for accessing local services.
The UPnP core will always access a local service implementation through this manager, available with org.fourthline.cling.model.meta.LocalService#getManager()
:
org.fourthline.cling.model.action.ActionExecutor
s 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. The org.fourthline.cling.model.action.ActionExecutor
works together with the manager, for example, the org.fourthline.cling.model.action.MethodActionExecutor
expects that an action method can be invoked through reflection on the instance returned by the manager's getImplementation()
method. This is possible with the the org.fourthline.cling.model.DefaultServiceManager
. A different service manager might require a different set of action executors, and vice versa. org.fourthline.cling.model.state.StateVariableAccessor
s 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. The org.fourthline.cling.model.state.StateVariableAccessor
works together with the service manager, for example, the org.fourthline.cling.model.state.FieldStateVariableAccessor
expects that a state variable value can be read through reflection on a field, of the instance returned by getImplementation()
. This is possible with the org.fourthline.cling.model.DefaultServiceManager
. A different service manager might require a different set of state variable accessors, and vice versa. A service manager can implement these concerns in any way imaginable. It has to be thread-safe.
<T> | The interface expected by the bound org.fourthline.cling.model.action.ActionExecutor s and org.fourthline.cling.model.state.StateVariableAccessor s. |
void org.fourthline.cling.model.ServiceManager< T >.execute | ( | Command< T > | cmd | ) | throws Exception |
Double-dispatch of arbitrary commands, used by action executors and state variable accessors.
The service manager will execute the given org.fourthline.cling.model.Command
and it might decorate the execution, for example, by locking/unlocking access to a shared service implementation before and after the execution.
cmd | The command to execute. |
Exception | Any exception, without wrapping, as thrown by org.fourthline.cling.model.Command#execute(ServiceManager) |
Implemented in org.fourthline.cling.model.DefaultServiceManager< T >.
Collection< StateVariableValue > org.fourthline.cling.model.ServiceManager< T >.getCurrentState | ( | ) | throws Exception |
Reading the state of a service manually.
Collection
of org.fourthline.cling.model.state.StateVariableValue
, representing the current state of the service, that is, all evented state variable values. Exception | Any error that occurred when the service's state was accessed. |
Implemented in org.fourthline.cling.model.DefaultServiceManager< T >.
T org.fourthline.cling.model.ServiceManager< T >.getImplementation | ( | ) |
org.fourthline.cling.model.action.ActionExecutor
s and org.fourthline.cling.model.state.StateVariableAccessor
s. Implemented in org.fourthline.cling.model.DefaultServiceManager< T >.
Referenced by org.fourthline.cling.model.action.AbstractActionExecutor.execute().
PropertyChangeSupport org.fourthline.cling.model.ServiceManager< T >.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:
EVENTED_STATE_VARIABLES
. null
, only the current state has to be included. Collection
of org.fourthline.cling.model.state.StateVariableValue
, 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).
Implemented in org.fourthline.cling.model.DefaultServiceManager< T >.
LocalService< T > org.fourthline.cling.model.ServiceManager< T >.getService | ( | ) |
Implemented in org.fourthline.cling.model.DefaultServiceManager< T >.
|
static |
Use this property name when propagating change events that affect any evented UPnP state variable.
This name is detected by the GENA subsystem.
Referenced by org.fourthline.cling.model.gena.LocalGENASubscription.propertyChange().