public class Locator extends Object
| Constructor and Description |
|---|
Locator() |
| Modifier and Type | Method and Description |
|---|---|
void |
addService(Service service)
Registers a new service.
|
static Locator |
getDefault()
Returns a default locator (singleton).
|
Service |
getService(String identifier)
Retrieves a specific service.
|
<T> T |
getService(String identifier,
Class<T> type)
Retrieves a specific service a casts it to the provided class type.
|
List<Service> |
getServices()
Returns all registered services.
|
GestureDevice<?,?> |
getSharedDevice(String identifier) |
void |
removeService(Service service)
Removes a service based on its unique identifier.
|
void |
setSharedDevice(String identifier,
GestureDevice<?,?> device) |
void |
startAll()
Starts all registered services.
|
void |
stopAll()
Stops all registered services.
|
public void addService(Service service)
service - the service to be registered.public Service getService(String identifier)
identifier - the identifier of the service to be retrieved.public <T> T getService(String identifier, Class<T> type)
identifier - the identifier of the service to be retrieved.type - the class type the returned service should be automatically
casted to.public List<Service> getServices()
public void removeService(Service service)
service - the service to be removed.public void startAll()
public void stopAll()
public static Locator getDefault()
public void setSharedDevice(String identifier, GestureDevice<?,?> device)
public GestureDevice<?,?> getSharedDevice(String identifier)
Copyright © 2007-2012 Global Information Systems Group, ETH Zurich. All Rights Reserved.