Source Code Cross Referenced for Lookup.java in  » Authentication-Authorization » josso-1.7 » org » josso » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Authentication Authorization » josso 1.7 » org.josso 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * JOSSO: Java Open Single Sign-On
003:         *
004:         * Copyright 2004-2008, Atricore, Inc.
005:         *
006:         * This is free software; you can redistribute it and/or modify it
007:         * under the terms of the GNU Lesser General Public License as
008:         * published by the Free Software Foundation; either version 2.1 of
009:         * the License, or (at your option) any later version.
010:         *
011:         * This software is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014:         * Lesser General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU Lesser General Public
017:         * License along with this software; if not, write to the Free
018:         * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
019:         * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
020:         */
021:        package org.josso;
022:
023:        import org.apache.commons.logging.Log;
024:        import org.apache.commons.logging.LogFactory;
025:        import org.josso.agent.SSOAgent;
026:        import org.josso.gateway.SSOWebConfiguration;
027:        import org.josso.gateway.identity.service.SSOIdentityProvider;
028:        import org.josso.gateway.identity.service.SSOIdentityProviderImpl;
029:        import org.josso.gateway.assertion.AssertionManager;
030:        import org.josso.gateway.assertion.AssertionManagerImpl;
031:        import org.josso.gateway.event.client.SSOEventManagerClient;
032:        import org.josso.gateway.event.client.SSOEventManagerClientImpl;
033:        import org.josso.gateway.reverseproxy.ReverseProxyConfiguration;
034:
035:        /**
036:         * This class provides a singleton interface to the SSO components
037:         * This class should be used by any client that needs a reference to a
038:         * component.
039:         *
040:         * @author <a href="mailto:gbrigand@josso.org">Gianluca Brigandi</a>
041:         * @version CVS $Id: Lookup.java 508 2008-02-18 13:32:29Z sgonzalez $
042:         */
043:
044:        public class Lookup {
045:
046:            private static final Log logger = LogFactory.getLog(Lookup.class);
047:
048:            /** Single statically instantiated instance of lookup. */
049:            private static final Lookup INSTANCE = new Lookup();
050:            private String _resourceName;
051:            /** Reference to the component keeper. */
052:            private ComponentKeeper _componentKeeper;
053:
054:            /** Reference to the Cached component instances */
055:            private SecurityDomain _securityDomain;
056:            private SSOAgent _ssoAgent;
057:            private ReverseProxyConfiguration _reverseProxyConfiguration;
058:            private SSOWebConfiguration _ssoWebConfiguration;
059:            private AssertionManager _assertionManager;
060:            private SSOIdentityProvider _ssoIdentityProvider;
061:
062:            /**
063:             * Private constructor so that this class can only be instantiated by the singleton.
064:             */
065:            private Lookup() {
066:            }
067:
068:            /**
069:             * Static factory method for getting a reference to the singleton
070:             * Lookup.
071:             *
072:             * @return Lookup
073:             */
074:            public static Lookup getInstance() {
075:                return Lookup.INSTANCE;
076:            }
077:
078:            public void init(String resourceName) {
079:                logger.info("Init resourceName <" + resourceName + ">");
080:                this ._resourceName = resourceName;
081:            }
082:
083:            /**
084:             * Fetches the security domain component.
085:             *
086:             * @return a reference to the component specified by name
087:             */
088:            public SecurityDomain lookupSecurityDomain() throws Exception {
089:
090:                if (_securityDomain == null) {
091:
092:                    _securityDomain = getComponentKeeper()
093:                            .fetchSecurityDomain();
094:
095:                    // This compoment should be initialized first ...
096:                    logger.info("Initializing SSOEventManager ...");
097:                    _securityDomain.getEventManager().initialize();
098:                    logger.info("Initializing SSOEventManager ... DONE");
099:
100:                    logger.info("Initializing SSOIdentityManager ...");
101:                    _securityDomain.getIdentityManager().initialize();
102:                    logger.info("Initializing SSOIdentityManager ... DONE");
103:
104:                    logger.info("Initializing SSOSessionManager ...");
105:                    _securityDomain.getSessionManager().initialize();
106:                    logger.info("Initializing SSOSessionManager ... DONE");
107:
108:                    logger.info("Initializing SSOAuditManager ...");
109:                    _securityDomain.getAuditManager().initialize();
110:                    logger.info("Initializing SSOAuditManager ... DONE");
111:                }
112:
113:                return _securityDomain;
114:            }
115:
116:            /**
117:             * Fetches the Single Sign-On agent component.
118:             *
119:             * @return a reference to the agent component.
120:             */
121:            public SSOAgent lookupSSOAgent() throws Exception {
122:                if (_ssoAgent == null)
123:                    _ssoAgent = getComponentKeeper().fetchSSOAgent();
124:
125:                return _ssoAgent;
126:            }
127:
128:            public SSOEventManagerClient lookupSSOEventManagerClient() {
129:                // TODO : Make this configurable :
130:                return new SSOEventManagerClientImpl();
131:            }
132:
133:            /**
134:             * Fetches the Reverse Proxy Configuration.
135:             *
136:             * @return a reference to the reverse proxy configuration.
137:             */
138:            public ReverseProxyConfiguration lookupReverseProxyConfiguration()
139:                    throws Exception {
140:                if (_reverseProxyConfiguration == null)
141:                    _reverseProxyConfiguration = getComponentKeeper()
142:                            .fetchReverseProxyConfiguration();
143:
144:                return _reverseProxyConfiguration;
145:            }
146:
147:            /**
148:             * Fetches the SSO web configuration.
149:             */
150:            public SSOWebConfiguration lookupSSOWebConfiguration()
151:                    throws Exception {
152:                if (_ssoWebConfiguration == null)
153:                    _ssoWebConfiguration = getComponentKeeper()
154:                            .fetchSSOWebConfiguration();
155:
156:                return _ssoWebConfiguration;
157:            }
158:
159:            /**
160:             * Obtains the Identity Provider
161:             */
162:            public SSOIdentityProvider lookupSSOIdentityProvider()
163:                    throws Exception {
164:                if (_ssoIdentityProvider == null)
165:                    _ssoIdentityProvider = new SSOIdentityProviderImpl();
166:
167:                return _ssoIdentityProvider;
168:            }
169:
170:            /**
171:             * Obtains the Assertion Manager
172:             */
173:            public AssertionManager lookupAssertionManager() throws Exception {
174:                if (_assertionManager == null)
175:                    _assertionManager = new AssertionManagerImpl();
176:
177:                return _assertionManager;
178:            }
179:
180:            /**
181:             * Gets the ComponentKeeper for the system.
182:             * The first time a component keeper is required. This method tries to get a ComponentKeeperFactory instance
183:             * to build the ComponentKeeper.
184:             *
185:             * If no factory can be found, the default component keeper is used.
186:             *
187:             * @return the ComponentKeeper
188:             *
189:             * @see ComponentKeeperImpl
190:             * @see ComponentKeeperFactory
191:             *
192:             */
193:            public ComponentKeeper getComponentKeeper() throws Exception {
194:
195:                if (this ._componentKeeper == null) {
196:                    ComponentKeeperFactory factory = ComponentKeeperFactory
197:                            .getInstance();
198:                    factory.setResourceFileName(this ._resourceName);
199:                    _componentKeeper = factory.newComponentKeeper();
200:                    logger.info("Using ComponentKeeper : "
201:                            + this ._componentKeeper.getClass().getName());
202:                }
203:
204:                return this ._componentKeeper;
205:            }
206:
207:            public static void main(String args[]) throws Exception {
208:                Lookup.getInstance().lookupSecurityDomain();
209:            }
210:
211:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.