Return-Path: X-Original-To: apmail-shiro-dev-archive@www.apache.org Delivered-To: apmail-shiro-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A97074E3B for ; Sun, 15 May 2011 19:40:10 +0000 (UTC) Received: (qmail 23977 invoked by uid 500); 15 May 2011 19:40:10 -0000 Delivered-To: apmail-shiro-dev-archive@shiro.apache.org Received: (qmail 23928 invoked by uid 500); 15 May 2011 19:40:09 -0000 Mailing-List: contact dev-help@shiro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@shiro.apache.org Delivered-To: mailing list dev@shiro.apache.org Received: (qmail 23920 invoked by uid 99); 15 May 2011 19:40:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 May 2011 19:40:09 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [74.125.83.45] (HELO mail-gw0-f45.google.com) (74.125.83.45) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 May 2011 19:40:02 +0000 Received: by gwb19 with SMTP id 19so1647849gwb.32 for ; Sun, 15 May 2011 12:39:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.185.233 with SMTP id u69mr3683219yhm.19.1305488380868; Sun, 15 May 2011 12:39:40 -0700 (PDT) Sender: les.hazlewood@anjinllc.com Received: by 10.236.108.137 with HTTP; Sun, 15 May 2011 12:39:40 -0700 (PDT) Date: Sun, 15 May 2011 12:39:40 -0700 X-Google-Sender-Auth: IC0EE001cfvxaEi2-PyVg43F9XU Message-ID: Subject: Request for feedback - name for Shiro component Map? From: Les Hazlewood To: dev@shiro.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org While working on SHIRO-293 [1], I realized that the typical way of setting up a Shiro web environment with the current Factory mechanism isn't right. That is, the following code for a web application isn't sufficient: Factory secMgrFactory = new IniSecurityManagerFactory("classpath:shiro.ini"); SecurityManager secMgr = secMgrFactory.getInstance(); The reason is that web environments require more objects than just the SecurityManager. At a minimum, in addition to the SecurityManager, we must be able to acquire the various Servlet Filters that might be configured (authc, login, etc). So, instead it makes more sense to have this for web apps: Factory> environmentFactory = .... where the map is composed of an object name in the INI config (the key) to object (the value) mapping. From there we can acquire anything that was created as a result of INI config. However, referencing Map all over the place imposes a sloppy-looking API. So I believe we should create an interface that represents that Map of Shiro objects. What should it be called? In the Spring world, this concept is called an 'ApplicationContext', which more or less makes sense. But what should we call this one? ApplicationEnvironment? Keep in mind that this map of objects is application-specific (i.e. static memory not necessary). Any ideas? Thanks, Les [1] https://issues.apache.org/jira/browse/SHIRO-291