org.jbpm.services.api.service

## Class ServiceRegistry

- java.lang.Object
- - org.jbpm.services.api.service.ServiceRegistry

-     public class ServiceRegistry
      extends Object

  Single ServiceRegistry that allows any service to register itself so other components can easily look them up.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CASE_RUNTIME_DATA_SERVICE`
    `static String` | `CASE_SERVICE`
    `static String` | `DEFINITION_SERVICE`
    `static String` | `DEPLOYMENT_SERVICE`
    `static String` | `EXECUTOR_SERVICE`
    `static String` | `MIGRATION_SERVICE`
    `static String` | `PROCESS_ADMIN_SERVICE`
    `static String` | `PROCESS_SERVICE`
    `static String` | `QUERY_SERVICE`
    `static String` | `RUNTIME_DATA_SERVICE`
    `protected ConcurrentHashMap<String,Object>` | `services`
    `static String` | `USER_TASK_ADMIN_SERVICE`
    `static String` | `USER_TASK_SERVICE`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Removes all services from the registry
    `static ServiceRegistry` | `get()` Returns single instance of the registry used to register and retrieve services.
    `void` | `register(String name, Object service)` Registers service under given name.
    `void` | `remove(String name)` Removes service registered under given name
    `Object` | `service(String name)` Retrieves service registered under given name

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### services

          protected volatile ConcurrentHashMap<String,Object> services

    - #### DEFINITION_SERVICE

          public static final String DEFINITION_SERVICE

    - #### DEPLOYMENT_SERVICE

          public static final String DEPLOYMENT_SERVICE

    - #### PROCESS_SERVICE

          public static final String PROCESS_SERVICE

    - #### RUNTIME_DATA_SERVICE

          public static final String RUNTIME_DATA_SERVICE

    - #### USER_TASK_SERVICE

          public static final String USER_TASK_SERVICE

    - #### QUERY_SERVICE

          public static final String QUERY_SERVICE

    - #### PROCESS_ADMIN_SERVICE

          public static final String PROCESS_ADMIN_SERVICE

    - #### MIGRATION_SERVICE

          public static final String MIGRATION_SERVICE

    - #### USER_TASK_ADMIN_SERVICE

          public static final String USER_TASK_ADMIN_SERVICE

    - #### EXECUTOR_SERVICE

          public static final String EXECUTOR_SERVICE

    - #### CASE_SERVICE

          public static final String CASE_SERVICE

      See Also:
        Constant Field Values

    - #### CASE_RUNTIME_DATA_SERVICE

          public static final String CASE_RUNTIME_DATA_SERVICE

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### get

          public static ServiceRegistry get()

      Returns single instance of the registry used to register and retrieve services.
      Returns:
        instance of the registry

    - #### register

          public void register(String name,
                               Object service)

      Registers service under given name.
      Parameters:
        `name` - name of the service
        `service` - actual service instance

    - #### remove

          public void remove(String name)

      Removes service registered under given name
      Parameters:
        `name` - name of the service

    - #### service

          public Object service(String name)

      Retrieves service registered under given name
      Parameters:
        `name` - name of the service
      Returns:
        instance of the service registered with given name
      Throws:
        `IllegalArgumentException` - thrown in case service with given name is not registered

    - #### clear

          public void clear()

      Removes all services from the registry

Copyright © 2001–2020 JBoss by Red Hat. All rights reserved.