public class ServiceSchemeRegistry extends Object implements Iterable<ServiceScheme>
ServiceSchemeRegistry
provides a mechanism manage a collection
of ServiceScheme
s together with the ability to search the registry for
said ServiceScheme
s, either by name or service name.
ServiceSchemeRegistry
s are Iterable
, the order of iteration
being the order in which the ServiceScheme
s where added to the said
ServiceSchemeRegistry
.
Constructor and Description |
---|
ServiceSchemeRegistry()
Constructs a
ServiceSchemeRegistry . |
Modifier and Type | Method and Description |
---|---|
ServiceScheme |
findSchemeBySchemeName(String sSchemeName)
Attempts to locate a
ServiceScheme registered with the specified
Scheme.getSchemeName() . |
ServiceScheme |
findSchemeByServiceName(String sServiceName)
Attempts to locate a
ServiceScheme registered with the specified
ServiceScheme.getServiceName() giving preference to "autostart"
schemes. |
Iterator<ServiceScheme> |
iterator() |
void |
register(ServiceScheme scheme)
Attempts to register the specified
ServiceScheme . |
int |
size()
Determines the number of
Scheme s registered with the
ServiceSchemeRegistry . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public ServiceSchemeRegistry()
ServiceSchemeRegistry
.public Iterator<ServiceScheme> iterator()
iterator
in interface Iterable<ServiceScheme>
public void register(ServiceScheme scheme)
ServiceScheme
.scheme
- the ServiceScheme
to registerIllegalArgumentException
- if a ServiceScheme
with the same
scheme and/or service name has already
been registeredpublic ServiceScheme findSchemeBySchemeName(String sSchemeName)
ServiceScheme
registered with the specified
Scheme.getSchemeName()
.sSchemeName
- the scheme of the ServiceScheme
to findServiceScheme
or
null
if not registeredpublic ServiceScheme findSchemeByServiceName(String sServiceName)
ServiceScheme
registered with the specified
ServiceScheme.getServiceName()
giving preference to "autostart"
schemes.sServiceName
- the service name of ServiceScheme
to findServiceScheme
or
null
if not registeredpublic int size()
Scheme
s registered with the
ServiceSchemeRegistry
.Scheme
s