io.vertx.servicediscovery.spi

## Interface ServiceType

- All Known Subinterfaces:
    DataSource, EventBusService, HttpEndpoint, JDBCDataSource, MessageSource

      public interface ServiceType

  Represents a service type.

  A service type is for example: `http-endpoint`, `data source`, `message source`. It defines what kind of resources is accessed through the service. For example, in the case of a `http endpoint`, the service object is a HTTP client. For `message source` it would a a consumer on which you set a handler receiving the message.

  You can define your own service type by implementing this interface and configure the SPI file (META-INF/services/io.vertx.ext.discovery.spi.ServiceType) with your own implementation.

  Author:
    Clement Escoffier

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `UNKNOWN` Unknown type.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ServiceReference` | `get(Vertx vertx, ServiceDiscovery discovery, Record record, JsonObject configuration)` Gets the `service` for the given record.
    `String` | `name()`

- - ### Field Detail

    - #### UNKNOWN

          static final String UNKNOWN

      Unknown type.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### name

          String name()

      Returns:
        the name of the type.

    - #### get

          ServiceReference get(Vertx vertx,
                               ServiceDiscovery discovery,
                               Record record,
                               JsonObject configuration)

      Gets the `service` for the given record. The record's type must match the current type. From the returned `ServiceReference`, the consumer can start using the service and release it.
      Parameters:
        `vertx` - the vert.x instance
        `discovery` - the discovery instance requesting the reference
        `record` - the record
        `configuration` - some optional configuration, maybe be `null` or empty
      Returns:
        the retrieved `ServiceReference`

Copyright © 2016. All rights reserved.