Marked methods final that should not be allowed to be overridden

This commit is contained in:
nathan 2020-09-25 14:49:17 +02:00
parent 1688a11000
commit 816191a5b3
2 changed files with 12 additions and 4 deletions

View File

@ -79,14 +79,14 @@ open class Client<CONNECTION : Connection>(config: Configuration = Configuration
private val lockStepForReconnect = atomic<SuspendWaiter?>(null)
override fun newException(message: String, cause: Throwable?): Throwable {
final override fun newException(message: String, cause: Throwable?): Throwable {
return ClientException(message, cause)
}
/**
* So the client class can get remote objects that are THE SAME OBJECT as if called from a connection
*/
override fun getRmiConnectionSupport(): RmiManagerConnections<CONNECTION> {
final override fun getRmiConnectionSupport(): RmiManagerConnections<CONNECTION> {
return rmiConnectionSupport
}
@ -601,6 +601,10 @@ open class Client<CONNECTION : Connection>(config: Configuration = Configuration
}
}
// no impl
final override fun close0() {}
// RMI notes (in multiple places, copypasta, because this is confusing if not written down)
//
// only server can create a global object (in itself, via save)

View File

@ -33,6 +33,7 @@ import dorkbox.network.handshake.HandshakeMessage
import dorkbox.network.handshake.ServerHandshake
import dorkbox.network.rmi.RemoteObject
import dorkbox.network.rmi.RemoteObjectStorage
import dorkbox.network.rmi.RmiManagerConnections
import dorkbox.network.rmi.TimeoutException
import io.aeron.Aeron
import io.aeron.FragmentAssembler
@ -146,10 +147,13 @@ open class Server<CONNECTION : Connection>(config: ServerConfiguration = ServerC
serialization.finishInit(type, ByteArray(0))
}
override fun newException(message: String, cause: Throwable?): Throwable {
final override fun newException(message: String, cause: Throwable?): Throwable {
return ServerException(message, cause)
}
final override fun getRmiConnectionSupport(): RmiManagerConnections<CONNECTION> {
return super.getRmiConnectionSupport()
}
private suspend fun getIpcPoller(aeron: Aeron, config: ServerConfiguration): AeronPoller {
val poller = if (config.enableIpc) {
@ -642,7 +646,7 @@ open class Server<CONNECTION : Connection>(config: ServerConfiguration = ServerC
/**
* Closes the server and all it's connections. After a close, you may call 'bind' again.
*/
override fun close0() {
final override fun close0() {
// when we call close, it will shutdown the polling mechanism then wait for us to tell it to cleanup connections.
//
// Aeron + the Media Driver will have already been shutdown at this point.