From commits-return-15757-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Mon Mar 21 15:24:17 2011 Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 36153 invoked from network); 21 Mar 2011 15:24:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Mar 2011 15:24:17 -0000 Received: (qmail 16620 invoked by uid 500); 21 Mar 2011 15:24:17 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 16575 invoked by uid 500); 21 Mar 2011 15:24:17 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 16568 invoked by uid 99); 21 Mar 2011 15:24:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Mar 2011 15:24:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Mar 2011 15:24:14 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E21D62388A19; Mon, 21 Mar 2011 15:23:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1083831 - in /activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker: LocalRouter.scala Queue.scala Date: Mon, 21 Mar 2011 15:23:41 -0000 To: commits@activemq.apache.org From: chirino@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110321152341.E21D62388A19@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: chirino Date: Mon Mar 21 15:23:41 2011 New Revision: 1083831 URL: http://svn.apache.org/viewvc?rev=1083831&view=rev Log: Pass the destination dto to the create destination method as sub classes may find that data handy. Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala?rev=1083831&r1=1083830&r2=1083831&view=diff ============================================================================== --- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala (original) +++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala Mon Mar 21 15:23:41 2011 @@ -125,12 +125,12 @@ class LocalRouter(val host:VirtualHost) asScalaIterable(destination_by_path.get( path )) } - def create_destination(path:Path, security:SecurityContext):Result[D,String] + def create_destination(path:Path, destination:DestinationDTO, security:SecurityContext):Result[D,String] - def get_or_create_destination(path:Path, security:SecurityContext):Result[D,String] = { + def get_or_create_destination(path:Path, destination:DestinationDTO, security:SecurityContext):Result[D,String] = { Option(destination_by_path.chooseValue(path)). map(Success(_)). - getOrElse( create_destination(path, security)) + getOrElse( create_destination(path, destination, security)) } def add_destination(path:Path, dest:D) = { @@ -164,7 +164,7 @@ class LocalRouter(val host:VirtualHost) // Should we attempt to auto create the destination? if( !wildcard ) { if ( matches.isEmpty && auto_create_destinations ) { - val rc = create_destination(path, security) + val rc = create_destination(path, destination, security) if( rc.failed ) { return rc.map_success(_=> Zilch); } @@ -228,7 +228,7 @@ class LocalRouter(val host:VirtualHost) // Should we attempt to auto create the destination? if ( matches.isEmpty && auto_create_destinations ) { - val rc = create_destination(path, security) + val rc = create_destination(path, destination, security) if( rc.failed ) { return rc.map_success(_=> Zilch); } @@ -320,7 +320,7 @@ class LocalRouter(val host:VirtualHost) // We may need to create the topic... if( !wildcard && matches.isEmpty ) { - create_destination(path, null) + create_destination(path, destination, null) matches = get_destination_matches(path) } @@ -336,7 +336,7 @@ class LocalRouter(val host:VirtualHost) } - def create_destination(path:Path, security:SecurityContext):Result[Topic,String] = { + def create_destination(path:Path, destination:DestinationDTO, security:SecurityContext):Result[Topic,String] = { // We can't create a wild card destination.. only wild card subscriptions. assert( !PathParser.containsWildCards(path) ) @@ -400,7 +400,8 @@ class LocalRouter(val host:VirtualHost) import OptionSupport._ if( queue.config.unified.getOrElse(false) ) { // hook up the queue to be a subscriber of the topic. - val topic = topic_domain.get_or_create_destination(path, null).success + + val topic = topic_domain.get_or_create_destination(path, new TopicDestinationDTO(queue.binding.binding_dto.name), null).success topic.bind(null, queue) } } @@ -412,12 +413,12 @@ class LocalRouter(val host:VirtualHost) import OptionSupport._ if( queue.config.unified.getOrElse(false) ) { // unhook the queue from the topic - val topic = topic_domain.get_or_create_destination(path, null).success + val topic = topic_domain.get_or_create_destination(path, new TopicDestinationDTO(queue.binding.binding_dto.name), null).success topic.unbind(queue, false) } } - def create_destination(path: Path, security: SecurityContext) = { + def create_destination(path: Path, destination:DestinationDTO, security: SecurityContext) = { val dto = new QueueDestinationDTO dto.name = DestinationParser.encode_path(path) @@ -639,7 +640,7 @@ class LocalRouter(val host:VirtualHost) */ def _get_or_create_destination(dto: DestinationDTO, security:SecurityContext): Result[DomainDestination, String] = { val path = DestinationParser.decode_path(dto.name) - domain(dto).get_or_create_destination(path, security) + domain(dto).get_or_create_destination(path, dto, security) } Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala?rev=1083831&r1=1083830&r2=1083831&view=diff ============================================================================== --- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala (original) +++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala Mon Mar 21 15:23:41 2011 @@ -550,7 +550,7 @@ class Queue(val router: LocalRouter, val import OptionSupport._ if( config.unified.getOrElse(false) ) { // this is a unified queue.. actually have the produce bind to the topic, instead of the - val topic = router.topic_domain.get_or_create_destination(binding.destination, null).success + val topic = router.topic_domain.get_or_create_destination(binding.destination, binding.binding_dto, null).success topic.connect(destination, producer) } else { producer.bind(this::Nil)