Class AbstractServiceWrapper<T>
java.lang.Object
com._1c.g5.v8.dt.internal.pm.wrappers.AbstractServiceWrapper<T>
- All Implemented Interfaces:
IServiceWrapper<T>
- Direct Known Subclasses:
DefaultServiceWrapper
,SingletonServiceWrapper
An abstract implementation of
IServiceWrapper
.
If the service is singleton or not is specified within classes extending this interface.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractServiceWrapper
(ServiceBinder<T> serviceBinder) Creates new instance with givenServiceBinder
. -
Method Summary
Modifier and TypeMethodDescriptioncreateProxy
(IProcessConnection processConnection) IServiceWrapper.createProxy(IProcessConnection)
method implementation.void
Disposes instance associated with given proxy.protected abstract IInstanceConnection
getInstanceConnection
(IProcessConnection processConnection) Provides a remote invoker for the service using given remote invoker provider.
-
Field Details
-
serviceBinder
The service binder.
-
-
Constructor Details
-
AbstractServiceWrapper
Creates new instance with givenServiceBinder
.- Parameters:
serviceBinder
- givenServiceBinder
(notnull
)
-
-
Method Details
-
createProxy
public T createProxy(IProcessConnection processConnection) throws InstantiationException, IllegalAccessException, IOException, InterruptedException IServiceWrapper.createProxy(IProcessConnection)
method implementation.- Specified by:
createProxy
in interfaceIServiceWrapper<T>
- Parameters:
processConnection
- given process connection (notnull
)- Returns:
- a proxy to service instance create within the process (not
null
) - Throws:
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 reasonIllegalAccessException
- if could not instantiate the implementation by it's default constructor (for instance, if the default constructor is unaccessible)IOException
- if request of starting a new process is failedInterruptedException
- if request of starting a new process is interrupted
-
dispose
Description copied from interface:IServiceWrapper
Disposes instance associated with given proxy.- Specified by:
dispose
in interfaceIServiceWrapper<T>
- Parameters:
proxy
- given proxy (notnull
)
-
getInstanceConnection
protected abstract IInstanceConnection getInstanceConnection(IProcessConnection processConnection) throws IOException, InstantiationException, IllegalAccessException Provides a remote invoker for the service using given remote invoker provider. Creates new or returns existing running within the process - depends on if the service is singleton.
- Parameters:
processConnection
- given remote invoker provider (notnull
)- Returns:
- a remote invoker for the service (not
null
) - Throws:
IOException
- if connection with process failsInstantiationException
- 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 reasonIllegalAccessException
- if could not instantiate the implementation by it's default constructor (for instance, if the default constructor is unaccessible)
-