add_service


Description:

[ Version ( since = "3.2" ) ]
public virtual Service add_service (string uid, string protocol, ProviderType type) throws Error

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.

Parameters:

this

a Session

uid

a unique identifier string

protocol

the service protocol

type

the service type

Returns:

a Service instance, or null on error