/** * Add a hashtable to the context * @param hashtable the Hashtable to be added */ public void addToContext( Hashtable hashtable ) { Validate.notNull(hashtable,"hashtable"); String name = null; Object value = null; Enumeration keys = hashtable.keys(); while( keys.hasMoreElements() ) { name = (String) keys.nextElement(); value = hashtable.get( name ); this.addToContext( name, value ); } }
/** * Add a hashtable to the context * * @param hashtable the Hashtable to be added */ public void addToContext(Hashtable<?, ?> hashtable) { Validate.notNull(hashtable, "hashtable"); String name = null; Object value = null; Enumeration<?> keys = hashtable.keys(); while (keys.hasMoreElements()) { name = (String) keys.nextElement(); value = hashtable.get(name); this.addToContext(name, value); } }
/** * Create the final Avalon context passed to YAAFI containing * <ul> * <li>user-supplied context</li> * <li>urn:avalon:home</li> * <li>urn:avalon:temp</li> * <li>urn:avalon:name</li> * <li>urn:avalon:partition</li> * <li>urn:avalon:classloader</li> * </ul> * * @return the final Context * @throws Exception if filename not defined * @throws IOException if file not found */ public Context createFinalContext() throws IOException, Exception { // 1) add the application root dir this.addToContext(AvalonMerlinConstants.URN_AVALON_HOME, this.getApplicationRootDir()); // 2) add the temp root dir this.addToContext(AvalonMerlinConstants.URN_AVALON_TEMP, this.getTempRootDir()); // 3) add the Avalon name this.addToContext(AvalonMerlinConstants.URN_AVALON_NAME, ServiceConstants.ROLE_NAME); // 4) add the Avalon partition name this.addToContext(AvalonMerlinConstants.URN_AVALON_PARTITION, "root"); // 5) add the class loader this.addToContext(AvalonMerlinConstants.URN_AVALON_CLASSLOADER, this.getComponentClassLoader()); return this.getContext(); }
this.addToContext( AvalonMerlinConstants.URN_AVALON_HOME, this.getApplicationRootDir() this.addToContext( AvalonMerlinConstants.URN_AVALON_TEMP, this.getTempRootDir() this.addToContext( AvalonMerlinConstants.URN_AVALON_NAME, ServiceConstants.ROLE_NAME this.addToContext( AvalonMerlinConstants.URN_AVALON_PARTITION, "root" this.addToContext( AvalonMerlinConstants.URN_AVALON_CLASSLOADER, this.getComponentClassLoader()