Package se.arkalix

Interface ArSystem

    • Method Detail

      • name

        java.lang.String name()
        Gets human and machine-readable name of this system.

        If this system is running in secure mode, the returned name will be the system name in its certificate. It will otherwise be a configured name.

        Specified by:
        name in interface SystemDescription
        Returns:
        System name.
      • socketAddress

        java.net.InetSocketAddress socketAddress()
        Gets the Internet socket address this system has been configured to use.
        Specified by:
        socketAddress in interface SystemDescription
        Returns:
        Address/hostname and port number of locally bound network interface.
      • address

        default java.net.InetAddress address()
        Gets the Internet address this system has been configured to use.
        Returns:
        Local network interface address.
      • port

        default int port()
        Gets the Internet port this system has been configured to use.
        Returns:
        Port through which this system exposes its provided services.
      • consume

        ServiceQuery consume()
        Creates new query useful for resolving services provided by other Arrowhead systems.

        Resolution will always complete with an empty result unless a Plugin has been provided at system creation that is able to perform service lookup.

        Returns:
        Service query builder.
        See Also:
        ServiceQuery
      • consumedServices

        ArServiceDescriptionCache consumedServices()
        Cache of, potentially or previously, consumed services.

        Searches made in this cache will never trigger any lookup in a remote service registry. The cache is strictly local. It is, however, updated whenever a consume() operation resolves in a remote lookup. For remote lookup to work, A plugin must be provided at ArSystem creation that supports lookup.

        Returns:
        Service description cache containing services that this system has, or has considered to, consume.
      • provide

        Future<ArServiceHandle> provide​(ArService service)
        Registers given service with this system, eventually making it accessible to remote Arrowhead systems.

        It is only acceptable to register any given service once, unless it is first dismissed via the returned handle.

        Parameters:
        service - Service to be provided by this system.
        Returns:
        Future completed with service handle only if the service can be provided.
        Throws:
        java.lang.NullPointerException - If service is null.
      • providedServices

        java.util.Collection<ServiceDescription> providedServices()
        Gets descriptions of all services currently provided by this system.
        Returns:
        Stream of service descriptions.
      • pluginFacadeOf

        java.util.Optional<PluginFacade> pluginFacadeOf​(java.lang.Class<? extends Plugin> pluginClass)
        Gets PluginFacade associated with the identified system Plugin, if the identified plugin is attached to this system and the plugin explicitly provides a plugin facade.

        A plugin facade allows for some attached system plugin to be interacted with. Interfaces returned by this method must be casted into some concrete type, which should be documented by the identified plugin, to become useful.

        Parameters:
        pluginClass - The class associated with the desired plugin facade.
        Returns:
        Plugin facade associated with a plugin provided at system creation, if the plugin in question provides such a facade.
      • shutdown

        Future<?> shutdown()
        Initiates system shutdown, causing all of its services to be dismissed.

        System shutdown is irreversible, meaning that the system cannot be used to provide more services after this method has been invoked.

        Note that shutting all running systems down will not terminate the Java application hosting them, as it will be kept alive by the Schedulers they used while running. If wanting to shut down the application itself, use System.exit(int).

        Returns:
        Future completed when shutdown is finished.
      • isShuttingDown

        boolean isShuttingDown()
        Determines whether this system currently is in the process of, or already has, shut down.
        Returns:
        true only if this system is currently in the process of, or already has, shut down.
      • toString

        java.lang.String toString()
        Overrides:
        toString in class java.lang.Object