Interface ConnectionPool

  • All Implemented Interfaces:

    
    public interface ConnectionPool
    
                        

    Connection Pool that maintains connections to the E3DC home power plant.

    Each implementation ensures that you always get an already authenticated connection.

    Since:

    2.0

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • getConnection

         abstract HomePowerPlantConnection getConnection()

        Provides an already authenticated connection to the E3DC home power plant.

        Returns:

        Authenticated connection to the home power plant

        Since:

        2.0

      • releaseConnection

         abstract Unit releaseConnection(HomePowerPlantConnection toRelease)

        Releases the connection toRelease to the E3DC home power plant.

        It is up to the implementation whether the connection is closed directly or pooled for later use.

        Parameters:
        toRelease - Connection to be released
        Since:

        2.0

      • executeAndRelease

         abstract <R extends Any> R executeAndRelease(Function1<HomePowerPlantConnection, R> receiver)

        Executes the passed function and returns a connection to the E3DC home power plant for use with pure

        Parameters:
        receiver - Function to be executed
        Returns:

        Return value of the passed function

        Since:

        2.0

      • shutdown

         abstract Unit shutdown()

        Closes all connections in the pool

        Since:

        2.0