Fix main entry point for the interpreters

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6816 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2007-09-18 16:01:50 +00:00
parent 1747086061
commit 0d7da3e6e6
4 changed files with 21 additions and 20 deletions

View File

@@ -65,24 +65,25 @@ public abstract class BaseInterpreter extends AbstractLifecycleBean
*/
protected String lastCommand = null;
/**
* Main entry point.
*/
public static void main(String[] args)
public static void runMain(String beanName)
{
ApplicationContext context = ApplicationContextHelper.getApplicationContext();
BaseInterpreter console = getConsoleBean(context);
runMain(context, beanName);
}
public static void runMain(ApplicationContext context, String beanName)
{
BaseInterpreter console = getConsoleBean(context, beanName);
console.username = DEFAULT_ADMIN;
console.rep();
System.exit(0);
}
public static BaseInterpreter getConsoleBean(ApplicationContext context)
public static BaseInterpreter getConsoleBean(ApplicationContext context, String beanName)
{
return null;
return (BaseInterpreter)context.getBean(beanName);
}
/**