The initial context is the starting point for all naming operations. In BI Beans, the initial context for the persistence service is an InitialPersistenceManager
. The InitialPersistenceManager
represents the root folder in the BI Beans Catalog where Persistable
components can be saved.
To create an initial context, you construct the hash table of environment properties and then construct a new InitialPersistenceManager
, passing the hash table as an argument to the constructor.
The following example creates an initial context for an application that uses the default storage manager.
// create the hash table and set environment properties // session is the BISession object Hashtable persistenceEnvironment = new Hashtable(); persistenceEnvironment.put(PSRConstants.Login.USER_NAME, "REL2"); persistenceEnvironment.put(PSRConstants.Login.PASSWORD, "REL2"); persistenceEnvironment.put(PSRConstants.Login.SERVICE, "SJ816SUN"); persistenceEnvironment.put(PSRConstants.BISESSION, session); //create initial context InitialPersistenceManager pmRoot = null; try{ pmroot = new InitialPersistenceManager(persistenceEnvironment); } catch (NamingException ne){ ne.printStackTrace(); }