src/main/java/org/jboss/loom/migrators/security/SecurityMigrator.java
private ModuleCreationAction createModuleActionForLogMod(LoginModuleAS7Bean lmAS7, String className,
                                                                    SecurityMigResource resource)
            throws MigrationException{
        File fileJar;
        try {
            fileJar = UtilsAS5.findJarFileWithClass(className, getGlobalConfig().getAS5Config().getDir(),
                    getGlobalConfig().getAS5Config().getProfileName());
        } catch (IOException ex) {
            throw new MigrationException("Failed finding jar with class " + className + ": " + ex.getMessage(), ex);
        }

        if ( resource.getModules().containsKey(fileJar) ) {
            lmAS7.setModule( resource.getModules().get(fileJar) );
            return null;
        }

        String moduleName = "security.loginModule" + resource.getIncrement();

        // Handler jar is new => create ModuleCreationAction, new module and CLI script
        lmAS7.setModule( moduleName );
        resource.getModules().put(fileJar, moduleName);

        // TODO: Dependencies are little unknown. This two are the best possibilities from example of custom login module
        String[] deps = new String[]{"javax.api", "org.picketbox", null}; // null = next is optional.

        ModuleCreationAction moduleAction = new ModuleCreationAction( this.getClass(), moduleName, deps, fileJar, Configuration.IfExists.OVERWRITE);

        return moduleAction;
    }
/**
     * Creates ModuleCreationAction for the custom made class for the Login-Module, which should be deployed as module
     *
     * @param lmAS7  Login-Module containing this class
     * @param className custom made class, which should be deployed into AS7
     * @param resource helping class containing all resources of the SecurityMigrator
     * @return  null if the JAR file containing the given class is already set for the creation of the module else
     *          created ModuleCreationAction.
     * @throws MigrationException
     */
Creates ModuleCreationAction for the custom made class for the Login-Module, which should be deployed as module
@param lmAS7  Login-Module containing this class
@param className custom made class, which should be deployed into AS7
@param resource helping class containing all resources of the SecurityMigrator
@return  null if the JAR file containing the given class is already set for the creation of the module else
created ModuleCreationAction.
Creates ModuleCreationAction for the custom made class for the Login - Module which should be deployed as module @param lmAS7 Login - Module containing this class @param className custom made class which should be deployed into AS7 @param resource helping class containing all resources of the SecurityMigrator @return null if the JAR file containing the given class is already set for the creation of the module else created ModuleCreationAction .
private ModuleCreationAction createModuleActionForLogMod(LoginModuleAS7Bean lmAS7, String className,
                                                                    SecurityMigResource resource)
            throws MigrationException{
        File fileJar;
        try {
            fileJar = UtilsAS5.findJarFileWithClass(className, getGlobalConfig().getAS5Config().getDir(),
                    getGlobalConfig().getAS5Config().getProfileName());
        } catch (IOException ex) {
            throw new MigrationException("Failed finding jar with class " + className + ": " + ex.getMessage(), ex);
        }
        if ( resource.getModules().containsKey(fileJar) ) {
            lmAS7.setModule( resource.getModules().get(fileJar) );
            return null;
        }
        String moduleName = "security.loginModule" + resource.getIncrement();
        lmAS7.setModule( moduleName );
        resource.getModules().put(fileJar, moduleName);
        String[] deps = new String[]{"javax.api", "org.picketbox", null}; 
        ModuleCreationAction moduleAction = new ModuleCreationAction( this.getClass(), moduleName, deps, fileJar, Configuration.IfExists.OVERWRITE);
        return moduleAction;
    }
private ModuleCreationAction createModuleActionForLogMod ( LoginModuleAS7Bean lmAS7 , String className , SecurityMigResource resource ) throws MigrationException { File fileJar ; try { fileJar = UtilsAS5 . findJarFileWithClass ( className , getGlobalConfig ( ) . getAS5Config ( ) . getDir ( ) , getGlobalConfig ( ) . getAS5Config ( ) . getProfileName ( ) ) ; } catch ( IOException ex ) { throw new MigrationException ( "Failed finding jar with class " + className + ": " + ex . getMessage ( ) , ex ) ; } if ( resource . getModules ( ) . containsKey ( fileJar ) ) { lmAS7 . setModule ( resource . getModules ( ) . get ( fileJar ) ) ; return null ; } String moduleName = "security.loginModule" + resource . getIncrement ( ) ; lmAS7 . setModule ( moduleName ) ; resource . getModules ( ) . put ( fileJar , moduleName ) ; String [ ] deps = new String [ ] { "javax.api" , "org.picketbox" , null } ; ModuleCreationAction moduleAction = new ModuleCreationAction ( this . getClass ( ) , moduleName , deps , fileJar , Configuration . IfExists . OVERWRITE ) ; return moduleAction ; }
Creates ModuleCreationAction for the custom made class for the Login-Module, which should be deployed as module
 @param lmAS7  Login-Module containing this class
 @param className custom made class, which should be deployed into AS7
 @param resource helping class containing all resources of the SecurityMigrator
 @return  null if the JAR file containing the given class is already set for the creation of the module else
          created ModuleCreationAction.
Creates ModuleCreationAction for the custom made class for the Login - Module which should be deployed as module @param lmAS7 Login - Module containing this class @param className custom made class which should be deployed into AS7 @param resource helping class containing all resources of the SecurityMigrator @return null if the JAR file containing the given class is already set for the creation of the module else created ModuleCreationAction .
// Handler jar is new => create ModuleCreationAction, new module and CLI script // TODO: Dependencies are little unknown. This two are the best possibilities from example of custom login module // null = next is optional.