Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 8204 invoked from network); 21 Apr 2010 16:32:24 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Apr 2010 16:32:24 -0000 Received: (qmail 39723 invoked by uid 500); 21 Apr 2010 16:32:24 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 39692 invoked by uid 500); 21 Apr 2010 16:32:23 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 39684 invoked by uid 99); 21 Apr 2010 16:32:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Apr 2010 16:32:23 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of chubrilo@gmail.com designates 209.85.218.225 as permitted sender) Received: from [209.85.218.225] (HELO mail-bw0-f225.google.com) (209.85.218.225) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Apr 2010 16:32:17 +0000 Received: by bwz25 with SMTP id 25so7412466bwz.8 for ; Wed, 21 Apr 2010 09:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:received:message-id:subject :from:to:content-type; bh=5b+xkrHqYZvqe1x9xOtRky/166kqeN5rqOd9FFDmze4=; b=Sk+MGOgTW3nglLVGJCL7rfNw9Tr0kZR42VYwKoiG7J8UBfzqHYW6fpHSv9TZx76jNd JxRtFfus8TO161AJW/EDxvtv63lbD7oWIStlSKAtnW8uqZfjoj+fvzJN0EzlgZPT6QeX uHkAe6EDmM13RZ30j+Yetck4aK9AJrPnODDZk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=ZKasARbPGrbQtG6TUC+RdYX/b+ob9ywZzRBs/3itMIxpRlwdewH1FMPT44QVAoGHhY RIC9fh7LzwrACZR+1D+wtqHdoaGCGs08b0G90jn1f94xPuIwnB3GBP9/6Hj6ROLpM/44 fvpq5Zi/6ghdSPOhrsgrtBFwdmdA3LrzZRZMQ= MIME-Version: 1.0 Sender: chubrilo@gmail.com Received: by 10.239.153.205 with HTTP; Wed, 21 Apr 2010 09:31:57 -0700 (PDT) In-Reply-To: <28288052.post@talk.nabble.com> References: <28288052.post@talk.nabble.com> Date: Wed, 21 Apr 2010 18:31:57 +0200 X-Google-Sender-Auth: 20d7377e6ab2a9fd Received: by 10.239.159.208 with SMTP id z16mr794352hbc.125.1271867517079; Wed, 21 Apr 2010 09:31:57 -0700 (PDT) Message-ID: Subject: Re: Xbean and Plugin/Broker Inheritance -- plugin help needed From: Dejan Bosanac To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=001485f5ce6a8e8f880484c1bb1a X-Virus-Checked: Checked by ClamAV on apache.org --001485f5ce6a8e8f880484c1bb1a Content-Type: text/plain; charset=ISO-8859-1 Hi Davis, checkout this article http://activemq.apache.org/developing-plugins.html#DevelopingPlugins-ConfiguringpluginswithoutcustomXML Cheers -- Dejan Bosanac - http://twitter.com/dejanb Open Source Integration - http://fusesource.com/ ActiveMQ in Action - http://www.manning.com/snyder/ Blog - http://www.nighttale.net On Wed, Apr 21, 2010 at 5:59 PM, davis wrote: > > Hi, I want to develop my own custom authorization plugin/broker. > > I'm going to first attempt to just subclass the AuthorizationBroker that is > in ActiveMQ..e.g. > > import org.apache.activemq.broker.Broker; > import org.apache.activemq.security.AuthorizationBroker; > import org.apache.activemq.security.AuthorizationMap; > > public MyAuthorizationBroker extends AuthorizationBroker { > public MyAuthorizationBroker(Broker next, AuthorizationMap > authorizationMap) { > super(next, authorizationMap); > } > } > > Now, my plugin: > > public class MyAuthorizationPlugin implements BrokerPlugin { > > private AuthorizationMap map; > > public MyAuthorizationPlugin() { > } > > public MyAuthorizationPlugin(AuthorizationMap map) { > this.map = map; > } > > public Broker installPlugin(Broker broker) { > if (map == null) { > throw new IllegalArgumentException("You must configure a 'map' > property"); > } > return new MyAuthorizationBroker(broker, map); > } > > public AuthorizationMap getMap() { > return map; > } > > public void setMap(AuthorizationMap map) { > this.map = map; > } > > } > > > So, that is simple enough, but I'm having difficulting trying to figure out > how to declare this in spring with or without xbean. > > > > > > > > > The problem is that the XSD inside the tag will not allow > anything other than the standard amq elements like the > . The only way I can put my own plugin in there > is > to use standard spring bean notation like this: > > > class="com.example.MyAuthorizationPlugin"> > > > > > Now, I'm stuck trying to initialize the AuthorizationMap. > > In the AMQ example listed here: http://activemq.apache.org/security.html > > They show it like this: > > > > > > admin="admins" /> > > > > > > The XSD/Spring won't let me declare the authorizationMap element, even if I > try it inside a property: > > class="com.example.MyAuthorizationPlugin"> > > > > etc... > > > > > > It seems that in the XSD maps to the class > DefaultAuthorizationMap. I guess the next step is to try to define > standard > spring beans for all these things, and then initialize it up that way. > > It would be much nicer, if I could somehow use Xbean to do this, but I'm > not > that familiar with XBean. Even if I created my own XBean annotations for > my > subclasses, and generated an XSD that was on the classpath and included it, > I'm guessing that I still wouldn't be able to do something like this: > > > > > > > > Because the amq namespace XSD won't allow it, so I'd have to hack that file > and point to a local copy or just forget it and go back to standard spring > bean notation. > > I'm spinning my wheels here...this is a bit frustrating. Anyone else > develop custom plugins...and how do you specify these in the spring XML..? > Do you just throw out the XBean stuff altogether, or is there some trick to > this that I am missing? > > Thanks in advance, > Davis > -- > View this message in context: > http://old.nabble.com/Xbean-and-Plugin-Broker-Inheritance----plugin-help-needed-tp28288052p28288052.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > --001485f5ce6a8e8f880484c1bb1a--