Interface IProcessConnectionDelegate
- All Superinterfaces:
AutoCloseable
,IConnection
,Invalidatable
,IProcessConnection
,UncaughtExceptionsGenerator
- All Known Implementing Classes:
ProcessConnectionDelegateImpl
Represents an instance to which inter-process communication mechanism's separate process side delegates requests
to process, received from the host. Because this interface's methods do not send or receive data,
overriden methods do not throw
IOException
.-
Method Summary
Modifier and TypeMethodDescriptiondefault void
close()
createInstanceConnection
(Class<? extends T> clazz, String... libraries) Creates an instance of given of given class within a process and returns a connection with that instance.default boolean
isValid()
Returns if this instance is not closed.default void
default void
Starts a connection if it is not already started.
-
Method Details
-
setUncaughtExceptionHandler
SetsThread.UncaughtExceptionHandler
. Always throwsUnsupportedOperationException
.- Specified by:
setUncaughtExceptionHandler
in interfaceUncaughtExceptionsGenerator
- Parameters:
handler
- givenThread.UncaughtExceptionHandler
(notnull
)
-
isValid
default boolean isValid()Description copied from interface:Invalidatable
Returns if this instance is not closed.- Specified by:
isValid
in interfaceInvalidatable
- Returns:
true
, ifAutoCloseable.close()
was not called,false
otherwise
-
startIfNotStarted
default void startIfNotStarted()Description copied from interface:IProcessConnection
Starts a connection if it is not already started.- Specified by:
startIfNotStarted
in interfaceIProcessConnection
-
close
default void close()Description copied from interface:IConnection
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceIConnection
-
createInstanceConnection
<T> IInstanceConnectionDelegate createInstanceConnection(Class<? extends T> clazz, String... libraries) throws InstantiationException, IllegalAccessException Description copied from interface:IProcessConnection
Creates an instance of given of given class within a process and returns a connection with that instance.- Specified by:
createInstanceConnection
in interfaceIProcessConnection
- Parameters:
clazz
- given class (notnull
)libraries
- given libraries to load before creating instance (notnull
)- Returns:
- connection with created instance of given class (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)
-