Interface DpwsFramework

  • All Superinterfaces:
    com.google.common.util.concurrent.Service
    All Known Implementing Classes:
    DpwsFrameworkImpl

    public interface DpwsFramework
    extends com.google.common.util.concurrent.Service
    Interface that supplies DPWS core functions.

    This service is required to be started before any other interaction with the DPWS stack. It is required once per Guice module.

    DpwsFramework is responsible to run a multicast UDP queue in order to send and receive discovery messages. Moreover, it prints out a list of network adapters for information purposes.

    Do not forget to stop the DPWS framework for a graceful shutdown.

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service

        com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void registerService​(Collection<com.google.common.util.concurrent.Service> services)
      Registers a service to attach to the framework's lifecycle.
      void setNetworkInterface​(NetworkInterface networkInterface)
      Sets the network interface to be used by the framework.
      • Methods inherited from interface com.google.common.util.concurrent.Service

        addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, failureCause, isRunning, startAsync, state, stopAsync
    • Method Detail

      • setNetworkInterface

        void setNetworkInterface​(NetworkInterface networkInterface)
        Sets the network interface to be used by the framework.

        This may only be set while the framework isn't running.

        Parameters:
        networkInterface - a network interface.
      • registerService

        void registerService​(Collection<com.google.common.util.concurrent.Service> services)
        Registers a service to attach to the framework's lifecycle.

        Starts and shuts down registered services when starting and stopping the framework. Whenever a constructor (outside of the dpws package) receives a wrapped thread pool, it must register the service using this method to ensure it is properly cleaned up when shutting down the device but not the JVM.

        • Services registered when the framework is already running will be started.
        • Services will be shutdown in the inverse order they're registered in, i.e. the last service registered will be the first to shut down.
        Parameters:
        services - Services to register for startup and shutdown.