try {
Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer");
XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
Object oHandler = m_xMSF.createInstance("com.sun.star.task.InteractionHandler");
XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler);
XMasterPasswordHandling xMHandling = (XMasterPasswordHandling)UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer);
// allow the storing of the passwords
xMHandling.allowPersistentStoring(true);