Constructor
new module:br /Service Registry Class()
Methods
clear()
Resets the ServiceRegistryClass
back to its initial state.
deregister Service(sIdentifier)
De-register a service that is currently registered in the
ServiceRegistryClass
.
Parameters:
Name | Type | Description |
---|---|---|
sIdentifier |
String | The alias or interface name used to uniquely identify the service. |
get Service(identifier)
Retrieve the service linked to the identifier within the application. The identifier could be a service alias or a service interface.
Parameters:
Name | Type | Description |
---|---|---|
identifier |
String | The alias or interface name used to uniquely identify the service. |
Throws:
-
If no service could be found for the given identifier.
- Type
- Error
is Service Registered(identifier)
Determine whether a service has been registered for a given identifier.
Parameters:
Name | Type | Description |
---|---|---|
identifier |
String | The alias or interface name used to uniquely identify the service. |
register Service(identifier, service)
Register an object that will be responsible for implementing the given interface within the application.
Parameters:
Name | Type | Description |
---|---|---|
identifier |
String | The alias used to uniquely identify the service. |
service |
Object | The object responsible for providing the service. |
Throws:
-
If a service has already been registered for the given interface or if no instance object is provided.
- Type
- Error