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 TypeMethodDescriptioncreateProxy
(IProcessConnection processConnection) Returns a proxy to service instance created within separate process represented by givenprocessConnection.
void
Disposes instance associated with given proxy.
-
Method Details
-
createProxy
T createProxy(IProcessConnection processConnection) throws InstantiationException, IllegalAccessException, IOException, InterruptedException Returns a proxy to service instance created within separate process represented by given
processConnection.
- Parameters:
processConnection
- given process connection (notnull
)- 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 reasonIOException
- if request of starting a new process is failedInterruptedException
- if request of starting a new process is interruptedInstanceObtainingException
- when failed to create connection with instance of service, created within a separate process because of connection fail
-
dispose
Disposes instance associated with given proxy.- Parameters:
proxy
- given proxy (notnull
)
-