/** * @see org.apache.avalon.framework.activity.Disposable#dispose() */ public void dispose() { this.serviceManager = null; this.parameters = new Parameters(); this.context = new DefaultContext(); ServiceManagerServiceImpl.instance = null; }
/** * @see org.apache.avalon.framework.activity.Disposable#dispose() */ public void dispose() { this.serviceManager = null; this.parameters = new Parameters(); this.context = new DefaultContext(); ServiceManagerServiceImpl.instance = null; }
/** * Create a <code>Parameters</code> object from a <code>Properties</code> * object. * * @param properties the Properties * @return This <code>Parameters</code> instance. */ public static Parameters fromProperties( final Properties properties ) { final Parameters parameters = new Parameters(); final Enumeration names = properties.propertyNames(); while( names.hasMoreElements() ) { final String key = names.nextElement().toString(); final String value = properties.getProperty( key ); parameters.setParameter( key, value ); } return parameters; }
/** * Create a Parameters object. * The first value of each parameter is added to the Parameters object. * @return An Parameters object - if no parameters are defined this is an * empty object. */ public static Parameters getFirstParameters(SourceParameters params) { Parameters result = new Parameters(); Iterator iter = params.getParameterNames(); String parName; while( iter.hasNext() ) { parName = (String)iter.next(); result.setParameter( parName, params.getParameter( parName ) ); } return result; }
/** * Create a Parameters object. * The first value of each parameter is added to the Parameters object. * @deprecated Use {@link AvalonSourceUtil#getFirstParameters(SourceParameters)} or * {@link #getFirstParametersMap}. * @return An Parameters object - if no parameters are defined this is an * empty object. */ public Parameters getFirstParameters() { Parameters result = new Parameters(); Iterator iter = this.getParameterNames(); String parName; while( iter.hasNext() ) { parName = (String)iter.next(); result.setParameter( parName, this.getParameter( parName ) ); } return result; }
/** * Load the parameters * * @param location The location as a file * @param isEncrypted is the file encrypted * @return The loaded configuration * @throws Exception Something went wrong */ private Parameters loadParameters(String location, String isEncrypted) throws Exception { InputStreamLocator locator = this.createInputStreamLocator(); InputStream is = locator.locate(location); Parameters result = new Parameters(); if (is != null) { try { is = this.getDecryptingInputStream(is, isEncrypted); Properties props = new Properties(); props.load(is); result = Parameters.fromProperties(props); } finally { safeClose(is); } } return result; }
final Parameters params = new Parameters(); if (sp != null) { SourceParameters remainingParameters = (SourceParameters) sp.clone();
/** * Load the parameters * @param location The location as a file * @param isEncrypted is the file encrypted * @return The loaded configuration * @throws Exception Something went wrong */ private Parameters loadParameters( String location, String isEncrypted ) throws Exception { InputStreamLocator locator = this.createInputStreamLocator(); InputStream is = locator.locate( location ); Parameters result = new Parameters(); if( is != null ) { try { is = this.getDecryptingInputStream( is, isEncrypted ); Properties props = new Properties(); props.load( is ); result = Parameters.fromProperties( props ); } finally { safeClose(is); } } return result; }
this.configurationParameters = new Parameters();
final Parameters params = new Parameters();
final Parameters params = new Parameters(); params.setParameter(SourceRefresher.PARAM_CACHE_INTERVAL, String.valueOf(source.getExpiration()));
} else if (callerParams != Parameters.EMPTY_PARAMETERS) { Parameters newParams = new Parameters();
/** * Initialize the default source resolver * * @throws Exception when there is an error. */ protected void initializeDefaultSourceResolver() throws Exception { final DefaultServiceManager manager = new DefaultServiceManager(); final DefaultServiceSelector selector = new DefaultServiceSelector(); final URLSourceFactory file = new URLSourceFactory(); file.enableLogging( getLogger() ); selector.put( "*", file ); final ResourceSourceFactory resource = new ResourceSourceFactory(); resource.enableLogging( getLogger() ); selector.put( "resource", resource ); manager.put( ResourceSourceFactory.ROLE + "Selector", selector ); final SourceResolverImpl resolver = new SourceResolverImpl(); ContainerUtil.enableLogging( resolver, getLogger() ); ContainerUtil.contextualize( resolver, m_childContext ); ContainerUtil.service( resolver, manager ); ContainerUtil.parameterize( resolver, new Parameters() ); m_defaultSourceResolver = resolver; }