clarencen/lshift — Issue #289: Add InboundEndpointManager
Author: clarencen
Created: 2011-11-14 22:42:24+00:00
State: open

The Configuration frontend should fire an event to (to be created) InboundEndpointManager for every CRUD operation on an Endpoint. The manager is responsible for firing up non-global non-static endpoints on demand (e.g. per-Participant queues in an AMQP scenario). The factory is responsible for knowing whether an endpoint receiver already exists for any given URL. Here are some design traits for this:

@@@
trait InboundEndpointFactory {
def canHandleInboundEndpoint(url:String, contentType:String)
def ensureEndpointReceiver(e:Endpoint)
}
@@@

@@@
class InboundEndpointManager {
def registerFactory(f:InboundEndpointFactory) = ()
def start {
endpoints.foreach(e => {
factories.filter(f => f.canHandleInboundEndpoint(e.inboundUrl, e.contentType)).foreach(f => f.ensureInboundEndpoint(e))
})
}
}
@@@

Note that this is a pre-requisite for #143.