/**
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package org.apache.geronimo.connector.outbound.security;

import java.util.Map;

import javax.resource.spi.ManagedConnectionFactory;

import org.apache.geronimo.connector.outbound.ManagedConnectionFactoryWrapper;
import org.apache.geronimo.security.jaas.LoginModuleGBean;

/**
 * @version $Rev$ $Date$
 */
public class PasswordCredentialLoginModuleWrapper extends LoginModuleGBean {
    public static final String MANAGED_CONNECTION_FACTORY_OPTION = "geronimo.managedconnectionfactory.option";

    public PasswordCredentialLoginModuleWrapper(String loginModuleClass, String objectName, boolean wrapPrincipals, Map<String, Object> options, String loginDomainName, ManagedConnectionFactoryWrapper managedConnectionFactoryWrapper, ClassLoader classLoader) {
        super(loginModuleClass, objectName, wrapPrincipals, options, loginDomainName, classLoader);
        ManagedConnectionFactory managedConnectionFactory = managedConnectionFactoryWrapper.$getManagedConnectionFactory();
        getOptions().put(MANAGED_CONNECTION_FACTORY_OPTION, managedConnectionFactory);
    }

}

@@ -886,16 +886,42 @@
 til.Map;
+%0Aimport java.util.HashMap;
 %0A%0Aimport
@@ -1104,16 +1104,51 @@
 leGBean;
+%0Aimport net.sf.cglib.beans.BeanMap;
 %0A%0A/**%0A *
@@ -1688,47 +1688,339 @@
 ls, 
-options, loginDomainName, classLoader);
+getOptions(options, managedConnectionFactoryWrapper), loginDomainName, classLoader);%0A    %7D%0A%0A    private static Map%3CString, Object%3E getOptions(Map%3CString, Object%3E options, ManagedConnectionFactoryWrapper managedConnectionFactoryWrapper) %7B%0A        if (options == null) %7B%0A            options = new HashMap%3CString, Object%3E();%0A        %7D
 %0A   
@@ -2152,20 +2152,15 @@
     
-getO
+o
 ptions
-()
 .put
@@ -2222,16 +2222,40 @@
 ctory);%0A
+        return options;%0A
     %7D%0A%0A%7D

deal with an empty options map