Interface IServiceWrapper<T>

Type Parameters:
T - the service
All Known Implementing Classes:
AbstractServiceWrapper, DefaultServiceWrapper, SingletonServiceWrapper

public interface IServiceWrapper<T>

A wrapper of one service's instances running within one process.

  • Method Summary

    Modifier and Type
    Method
    Description
    createProxy(IProcessConnection processConnection)
    Returns a proxy to service instance created within separate process represented by given processConnection.
    void
    dispose(Object proxy)
    Disposes instance associated with given proxy.
  • Method Details

    • createProxy

      Returns a proxy to service instance created within separate process represented by given processConnection.

      Parameters:
      processConnection - given process connection (not null)
      Returns:
      a proxy to service instance create within the process (not null)
      Throws:
      IllegalStateException - if 'java.security.policy' system property is not set (System.getProperty("java.security.policy") returns null), or service for key is not bound.
      IllegalAccessException - if could not instantiate the implementation by it's default constructor (for instance, if the default constructor is unaccessible)
      InstantiationException - if the implementation represents an abstract class, an interface, an array class, a primitive type, or void; or if the class has no nullary constructor; or if the instantiation fails for some other reason
      IOException - if request of starting a new process is failed
      InterruptedException - if request of starting a new process is interrupted
      InstanceObtainingException - when failed to create connection with instance of service, created within a separate process because of connection fail
    • dispose

      void dispose(Object proxy)
      Disposes instance associated with given proxy.
      Parameters:
      proxy - given proxy (not null)