Minor code cleanup and deprecations etc
This commit is contained in:
parent
b0a64caaec
commit
6360cd19a5
4 changed files with 26 additions and 12 deletions
|
|
@ -88,7 +88,7 @@ case class ThreadPoolConfigDispatcherBuilder(dispatcherFactory: (ThreadPoolConfi
|
|||
def build = dispatcherFactory(config)
|
||||
|
||||
//TODO remove this, for backwards compat only
|
||||
def buildThreadPool = build
|
||||
@deprecated("Use .build instead") def buildThreadPool = build
|
||||
|
||||
def withNewBoundedThreadPoolWithLinkedBlockingQueueWithUnboundedCapacity(bounds: Int): ThreadPoolConfigDispatcherBuilder =
|
||||
this.copy(config = config.copy(flowHandler = flowHandler(bounds), queueFactory = linkedBlockingQueue()))
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ case class RemoteServerClientClosed(
|
|||
case class RemoteServerWriteFailed(
|
||||
@BeanProperty request: AnyRef,
|
||||
@BeanProperty cause: Throwable,
|
||||
@BeanProperty client: RemoteServerModule, remoteAddress: InetSocketAddress) extends RemoteServerLifeCycleEvent
|
||||
@BeanProperty server: RemoteServerModule, remoteAddress: Option[InetSocketAddress]) extends RemoteServerLifeCycleEvent
|
||||
|
||||
/**
|
||||
* Thrown for example when trying to send a message using a RemoteClient that is either not started or shut down.
|
||||
|
|
@ -237,14 +237,27 @@ trait RemoteServerModule extends RemoteModule {
|
|||
/**
|
||||
* Starts the server up
|
||||
*/
|
||||
def start(host: String = ReflectiveAccess.Remote.configDefaultAddress.getHostName,
|
||||
port: Int = ReflectiveAccess.Remote.configDefaultAddress.getPort,
|
||||
loader: Option[ClassLoader] = None): RemoteServerModule
|
||||
def start(): RemoteServerModule =
|
||||
start(ReflectiveAccess.Remote.configDefaultAddress.getHostName,
|
||||
ReflectiveAccess.Remote.configDefaultAddress.getPort)
|
||||
|
||||
/**
|
||||
* Starts the server up
|
||||
*/
|
||||
def start(loader: ClassLoader): RemoteServerModule =
|
||||
start(ReflectiveAccess.Remote.configDefaultAddress.getHostName,
|
||||
ReflectiveAccess.Remote.configDefaultAddress.getPort,
|
||||
Option(loader))
|
||||
|
||||
/**
|
||||
* Starts the server up
|
||||
*/
|
||||
def start(host: String, port: Int, loader: Option[ClassLoader] = None): RemoteServerModule
|
||||
|
||||
/**
|
||||
* Shuts the server down
|
||||
*/
|
||||
def shutdownServerModule: Unit
|
||||
def shutdownServerModule(): Unit
|
||||
|
||||
/**
|
||||
* Register typed actor by interface name.
|
||||
|
|
@ -391,7 +404,7 @@ trait RemoteClientModule extends RemoteModule { self: RemoteModule =>
|
|||
/**
|
||||
* Clean-up all open connections.
|
||||
*/
|
||||
def shutdownClientModule: Unit
|
||||
def shutdownClientModule(): Unit
|
||||
|
||||
/**
|
||||
* Shuts down a specific client connected to the supplied remote address returns true if successful
|
||||
|
|
@ -424,7 +437,7 @@ trait RemoteClientModule extends RemoteModule { self: RemoteModule =>
|
|||
|
||||
private[akka] def deregisterSupervisorForActor(actorRef: ActorRef): ActorRef
|
||||
|
||||
private[akka] def registerClientManagedActor(hostname: String, port: Int, uuid: Uuid): Unit
|
||||
private[akka] def registerClientManagedActor(hostname: String, port: Int, uuid: Uuid): Unit
|
||||
|
||||
private[akka] def unregisterClientManagedActor(hostname: String, port: Int, uuid: Uuid): Unit
|
||||
private[akka] def unregisterClientManagedActor(hostname: String, port: Int, uuid: Uuid): Unit
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ trait BootableRemoteActorService extends Bootable with Logging {
|
|||
self: BootableActorLoaderService =>
|
||||
|
||||
protected lazy val remoteServerThread = new Thread(new Runnable() {
|
||||
def run = Actor.remote.start(loader = self.applicationLoader) //Use config host/port
|
||||
def run = Actor.remote.start(self.applicationLoader.getOrElse(null)) //Use config host/port
|
||||
}, "Akka Remote Service")
|
||||
|
||||
def startRemoteService = remoteServerThread.start
|
||||
|
|
|
|||
|
|
@ -172,6 +172,7 @@ abstract class RemoteClient private[akka] (
|
|||
actorRef: ActorRef,
|
||||
typedActorInfo: Option[Tuple2[String, String]],
|
||||
actorType: AkkaActorType): Option[CompletableFuture[T]] = synchronized { //TODO: find better strategy to prevent race
|
||||
|
||||
send(createRemoteMessageProtocolBuilder(
|
||||
Some(actorRef),
|
||||
Left(actorRef.uuid),
|
||||
|
|
@ -819,8 +820,8 @@ class RemoteServerHandler(
|
|||
//Not interesting at the moment
|
||||
} else if (!future.isSuccess) {
|
||||
val socketAddress = future.getChannel.getRemoteAddress match {
|
||||
case i: InetSocketAddress => i
|
||||
case _ => null
|
||||
case i: InetSocketAddress => Some(i)
|
||||
case _ => None
|
||||
}
|
||||
server.notifyListeners(RemoteServerWriteFailed(message, future.getCause, server, socketAddress))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue