01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.geronimo.connector.outbound.security;
17:
18: import java.util.Map;
19: import java.util.HashMap;
20:
21: import javax.resource.spi.ManagedConnectionFactory;
22:
23: import org.apache.geronimo.connector.outbound.ManagedConnectionFactoryWrapper;
24: import org.apache.geronimo.security.jaas.LoginModuleGBean;
25: import net.sf.cglib.beans.BeanMap;
26:
27: /**
28: * @version $Rev: 562593 $ $Date: 2007-08-03 14:39:52 -0700 (Fri, 03 Aug 2007) $
29: */
30: public class PasswordCredentialLoginModuleWrapper extends
31: LoginModuleGBean {
32: public static final String MANAGED_CONNECTION_FACTORY_OPTION = "geronimo.managedconnectionfactory.option";
33:
34: public PasswordCredentialLoginModuleWrapper(
35: String loginModuleClass,
36: String objectName,
37: boolean wrapPrincipals,
38: Map<String, Object> options,
39: String loginDomainName,
40: ManagedConnectionFactoryWrapper managedConnectionFactoryWrapper,
41: ClassLoader classLoader) {
42: super (loginModuleClass, objectName, wrapPrincipals, getOptions(
43: options, managedConnectionFactoryWrapper),
44: loginDomainName, classLoader);
45: }
46:
47: private static Map<String, Object> getOptions(
48: Map<String, Object> options,
49: ManagedConnectionFactoryWrapper managedConnectionFactoryWrapper) {
50: if (options == null) {
51: options = new HashMap<String, Object>();
52: }
53: ManagedConnectionFactory managedConnectionFactory = managedConnectionFactoryWrapper
54: .$getManagedConnectionFactory();
55: options.put(MANAGED_CONNECTION_FACTORY_OPTION,
56: managedConnectionFactory);
57: return options;
58: }
59:
60: }
|