Fixed ugly logging in NettyRemoteSupport (plus misc minor formatting).

Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
This commit is contained in:
Jonas Bonér 2012-01-24 12:01:42 +01:00
parent 3088201bb8
commit 6db989ffa3

View file

@ -157,7 +157,10 @@ class NettyRemoteTransport(val remoteSettings: RemoteSettings, val system: Actor
def unbindClient(remoteAddress: Address): Unit = {
clientsLock.writeLock().lock()
try {
remoteClients.foreach { case (k, v) if (v.isBoundTo(remoteAddress)) { v.shutdown(); remoteClients.remove(k) } }
remoteClients foreach {
case (k, v)
if (v.isBoundTo(remoteAddress)) { v.shutdown(); remoteClients.remove(k) }
}
} finally {
clientsLock.writeLock().unlock()
}
@ -227,7 +230,8 @@ class DefaultDisposableChannelGroup(name: String) extends DefaultChannelGroup(na
override def close(): ChannelGroupFuture = {
guard.writeLock().lock()
try {
if (open.getAndSet(false)) super.close() else throw new IllegalStateException("ChannelGroup already closed, cannot add new channel")
if (open.getAndSet(false)) super.close()
else throw new IllegalStateException("ChannelGroup already closed, cannot add new channel")
} finally {
guard.writeLock().unlock()
}