Source Code Cross Referenced for SecurityHandlerImpl.java in  » ESB » open-esb » com » sun » jbi » internal » security » 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 » ESB » open esb » com.sun.jbi.internal.security 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * BEGIN_HEADER - DO NOT EDIT
003:         *
004:         * The contents of this file are subject to the terms
005:         * of the Common Development and Distribution License
006:         * (the "License").  You may not use this file except
007:         * in compliance with the License.
008:         *
009:         * You can obtain a copy of the license at
010:         * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011:         * See the License for the specific language governing
012:         * permissions and limitations under the License.
013:         *
014:         * When distributing Covered Code, include this CDDL
015:         * HEADER in each file and include the License file at
016:         * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017:         * If applicable add the following below this CDDL HEADER,
018:         * with the fields enclosed by brackets "[]" replaced with
019:         * your own identifying information: Portions Copyright
020:         * [year] [name of copyright owner]
021:         */
022:
023:        /*
024:         * @(#)SecurityHandlerImpl.java
025:         * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026:         *
027:         * END_HEADER - DO NOT EDIT
028:         */
029:        /**
030:         *  SecurityHandler.java
031:         *
032:         *  SUN PROPRIETARY/CONFIDENTIAL.
033:         *  This software is the proprietary information of Sun Microsystems, Inc.
034:         *  Use is subject to license terms.
035:         *
036:         *  Created on October 8, 2004, 6:28 PM
037:         */package com.sun.jbi.internal.security;
038:
039:        import com.sun.jbi.EnvironmentContext;
040:        import com.sun.jbi.StringTranslator;
041:        import com.sun.jbi.component.ComponentContext;
042:        import com.sun.jbi.binding.security.DeploymentListener;
043:        import com.sun.jbi.binding.security.Interceptor;
044:
045:        import com.sun.jbi.internal.security.config.SecurityConfiguration;
046:        import com.sun.jbi.internal.security.msg.SecurityProcessor;
047:        import com.sun.jbi.internal.security.https.SSLHelper;
048:
049:        import java.util.logging.Logger;
050:
051:        /**
052:         * The SecurityHandler interface will be used a Binding Component to
053:         * secure outgoing Messages and validate incoming messages. There is a 1:1 association 
054:         * between a Binding Component and a Security Handler.
055:         *
056:         * @author Sun Microsystems, Inc.
057:         */
058:        public class SecurityHandlerImpl implements 
059:                com.sun.jbi.binding.security.SecurityHandler {
060:            /** The Instalation Security Configuration associated with this handler */
061:            private SecurityConfiguration mInstallSecConfig = null;
062:
063:            /** The Logger. */
064:            private static Logger sLogger = null;
065:
066:            /** The Security Processor */
067:            private SecurityProcessor mSecurityProcessor;
068:
069:            /** 
070:             * The Environment Context of the Component associated with the Security Handler
071:             */
072:            private com.sun.jbi.internal.security.ComponentContext mEnvCtx;
073:
074:            /** The String translator */
075:            private StringTranslator mTranslator;
076:
077:            /** The SSLHelper Util instance. */
078:            private SSLHelper mSSLHelper;
079:
080:            /** The DeploymentListenerImpl. */
081:            private DeploymentListenerImpl mDeploymentListener;
082:
083:            /** The SecurityHandlers Handle to the SecurityService. */
084:            private SecurityService mSecSvc;
085:
086:            /**
087:             * This method creates and initializes the SecurityHandler with the
088:             * SecurityConfiguration and the ComponentContext.
089:             *
090:             * @param secConfig is the installation SecurityConfiguration
091:             * @param cmpCtx is the Component Context
092:             * @param envCtx is the Security Service Environment Context
093:             * @param authLayer is the authentication layer ex. SOAP.
094:             * @param secSvc is a handle to the Security Service that created this instance.
095:             * @throws IllegalStateException if the SecurityHandler cannot be initialized
096:             * successfully.
097:             * 
098:             */
099:            protected SecurityHandlerImpl(SecurityConfiguration secConfig,
100:                    ComponentContext cmpCtx, EnvironmentContext envCtx,
101:                    SecurityService secSvc, String authLayer)
102:                    throws IllegalStateException {
103:                initialize(secConfig, cmpCtx, envCtx, secSvc, authLayer);
104:            }
105:
106:            /**
107:             * This method initializes the SecurityHandler with the
108:             * SecurityConfiguration and the ComponentContext.
109:             *
110:             * @param secConfig is the installation SecurityConfiguration
111:             * @param cmpCtx is the ComponentContext
112:             * @param envCtx is the SecurityService EnvironmentContext.
113:             * @param secSvc is a handle to the Security Service that created this instance.
114:             * @param authLayer is the authentication layer ex. SOAP.
115:             * @throws IllegalStateException if the SecurityHandler cannot be initialized
116:             * successfully.
117:             * 
118:             */
119:            public void initialize(SecurityConfiguration secConfig,
120:                    ComponentContext cmpCtx, EnvironmentContext envCtx,
121:                    SecurityService secSvc, String authLayer)
122:                    throws IllegalStateException {
123:                mSecSvc = secSvc;
124:                mEnvCtx = new BindingComponentContext(cmpCtx, envCtx);
125:                sLogger = Logger
126:                        .getLogger(com.sun.jbi.internal.security.Constants.PACKAGE);
127:
128:                mSSLHelper = new SSLHelper();
129:                mInstallSecConfig = secConfig;
130:                mSecurityProcessor = new com.sun.jbi.internal.security.msg.SecurityProcessor(
131:                        mEnvCtx, authLayer);
132:                mDeploymentListener = new DeploymentListenerImpl(secSvc
133:                        .getSchemaDir());
134:                mDeploymentListener.addDeploymentObserver(mSSLHelper);
135:                mDeploymentListener.addDeploymentObserver(mSecurityProcessor);
136:
137:                initStringTranslator();
138:                sLogger.info(mTranslator.getString(
139:                        LocalStringConstants.BC_INFO_SECHANDLER_INITIALIZED,
140:                        getComponentName()));
141:            }
142:
143:            /**
144:             * Initialize the String translator
145:             *
146:             */
147:            private void initStringTranslator() {
148:                mTranslator = mEnvCtx.getStringTranslator(Constants.PACKAGE);
149:            }
150:
151:            /**
152:             * Get an Instance of the Deployment Listener.
153:             *
154:             * @return an Instance of the Deployment Listener
155:             */
156:            public DeploymentListener getDeploymentListener() {
157:                return mDeploymentListener;
158:            }
159:
160:            /**
161:             * Get an Instance of the Interceptor.
162:             *
163:             * @return an Instance of the Deployment Listener
164:             */
165:            public Interceptor getInterceptor() {
166:                return mSecurityProcessor;
167:            }
168:
169:            /**
170:             *
171:             * Get the HttpSecurityHandler.
172:             *
173:             * @return a new Instance of the HttpSecurityHandler
174:             */
175:            public com.sun.jbi.binding.security.HttpSecurityHandler getHttpSecurityHandler() {
176:                return new com.sun.jbi.internal.security.https.HttpSecurityHandler(
177:                        mSSLHelper);
178:            }
179:
180:            /**
181:             * Get the ComponentContext of the Component associated with the
182:             * handler. The Environment Context is useful in getting the ComponentId and 
183:             * the StringTranslator
184:             *
185:             * @return the ComponentContext instance.
186:             */
187:            public com.sun.jbi.internal.security.ComponentContext getComponentContext() {
188:                return mEnvCtx;
189:            }
190:
191:            /** 
192:             * Get the Name of the Component associated with the handler.
193:             *
194:             * @return the String Component Id.
195:             */
196:            public String getComponentName() {
197:                return mEnvCtx.getComponentName();
198:            }
199:
200:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.