Instantiates a new Service for this.
The uid
identifies the service for future lookup. The protocol
indicates which
Provider holds the Type of the
Service subclass to instantiate. The type
explicitly designates the
service as a Store or
Transport.
If the given uid
has already been added, the existing Service with
that uid
is returned regardless of whether it agrees with the given protocol
and type
.
If no Provider is available to handle the given protocol
, or if the
Provider does not specify a valid Type for type
,
the function sets throws and returns null.
The returned Service is referenced for thread-safety and must be unreferenced with unref when finished with it.
this |
a Session |
uid |
a unique identifier string |
protocol |
the service protocol |
type |
the service type |
a Service instance, or null on error |