当前位置: 首页>>代码示例>>Java>>正文


Java Dictionary.put方法代码示例

本文整理汇总了Java中java.util.Dictionary.put方法的典型用法代码示例。如果您正苦于以下问题:Java Dictionary.put方法的具体用法?Java Dictionary.put怎么用?Java Dictionary.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.Dictionary的用法示例。


在下文中一共展示了Dictionary.put方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import java.util.Dictionary; //导入方法依赖的package包/类
public void start ( final BundleContext context ) throws Exception
{
    this.factory = new EventPoolConfigurationFactory ( context );

    final Dictionary<String, String> properties = new Hashtable<String, String> ();
    properties.put ( ConfigurationAdministrator.FACTORY_ID, context.getBundle ().getSymbolicName () + ".pool" );
    properties.put ( Constants.SERVICE_VENDOR, "Eclipse SCADA Project" );
    properties.put ( Constants.SERVICE_DESCRIPTION, "Event pool service factory" );
    context.registerService ( ConfigurationFactory.class.getName (), this.factory, properties );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:11,代码来源:Activator.java

示例2: testSetProperties

import java.util.Dictionary; //导入方法依赖的package包/类
/**
 * Test method for
 * {@link org.eclipse.gemini.blueprint.mock.MockServiceRegistration#setProperties(java.util.Dictionary)}.
 */
public void testSetProperties() {
	Dictionary props = new Hashtable();
	Object value = new Object();
	String key = "foo";
	props.put(key, value);

	assertNull(mock.getReference().getProperty(key));
	mock.setProperties(props);
	assertSame(value, mock.getReference().getProperty(key));
	mock.setReference(createMock(ServiceReference.class));

	try {
		mock.setProperties(props);
		fail("should have thrown exception");
	}
	catch (RuntimeException ex) {
		// expected
	}
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:24,代码来源:MockServiceRegistrationTest.java

示例3: testStickinessWhenServiceGoesDown

import java.util.Dictionary; //导入方法依赖的package包/类
public void testStickinessWhenServiceGoesDown() throws Exception {
	interceptor.setSticky(true);
	interceptor.afterPropertiesSet();

	ServiceListener sl = (ServiceListener) bundleContext.getServiceListeners().iterator().next();

	Dictionary props = new Hashtable();
	// increase service ranking
	props.put(Constants.SERVICE_RANKING, 10);

	ServiceReference higherRankingRef = new MockServiceReference(null, props, null);
	refs = new ServiceReference[] { new MockServiceReference(), higherRankingRef };

	assertTrue(Arrays.equals(bundleContext.getServiceReferences((String)null, null), refs));

	assertEquals(1, SimpleTargetSourceLifecycleListener.BIND);
	assertEquals(0, SimpleTargetSourceLifecycleListener.UNBIND);

	sl.serviceChanged(new ServiceEvent(ServiceEvent.UNREGISTERING, refs[0]));

	assertEquals(2, SimpleTargetSourceLifecycleListener.BIND);
	assertEquals(0, SimpleTargetSourceLifecycleListener.UNBIND);

	assertSame("incorrect backing reference selected", higherRankingRef, ((ServiceReferenceProxy) interceptor
			.getServiceReference()).getTargetServiceReference());
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:27,代码来源:OsgiServiceDynamicInterceptorListenerTest.java

示例4: start

import java.util.Dictionary; //导入方法依赖的package包/类
@Override
public void start ( final BundleContext bundleContext ) throws Exception
{
    Activator.context = bundleContext;

    logger.info ( "Starting JDBC Security Provider" );

    this.serviceFactory = new JdbcAuthenticationServiceFactory ( bundleContext );
    final Dictionary<String, Object> properties = new Hashtable<String, Object> ();
    properties.put ( Constants.SERVICE_DESCRIPTION, "A JDBC authentication service" );
    properties.put ( Constants.SERVICE_VENDOR, "Eclipse SCADA Project" );
    properties.put ( ConfigurationAdministrator.FACTORY_ID, bundleContext.getBundle ().getSymbolicName () + ".authenticator" );
    this.handle = bundleContext.registerService ( ConfigurationFactory.class, this.serviceFactory, properties );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:15,代码来源:Activator.java

示例5: createService

import java.util.Dictionary; //导入方法依赖的package包/类
@Override
protected Entry<DaveDevice> createService ( final UserInformation userInformation, final String configurationId, final BundleContext context, final Map<String, String> parameters ) throws Exception
{
    final DaveDevice device = new DaveDevice ( this.context, configurationId, parameters );

    final Dictionary<String, String> properties = new Hashtable<String, String> ();
    properties.put ( "daveDevice", configurationId );
    return new Entry<DaveDevice> ( configurationId, device, context.registerService ( DaveDevice.class, device, properties ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:10,代码来源:ConfigurationFactoryImpl.java

示例6: testGetServiceRankingWithInvalidClass

import java.util.Dictionary; //导入方法依赖的package包/类
public void testGetServiceRankingWithInvalidClass() {
	int ranking = 12345;
	Dictionary dict = new Hashtable();
	dict.put(Constants.SERVICE_RANKING, (long) ranking);
	ServiceReference ref = new MockServiceReference(null, dict, null);
	assertEquals(0, OsgiServiceReferenceUtils.getServiceRanking(ref));
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:8,代码来源:OsgiServiceReferenceUtilsTest.java

示例7: setLambdaSlider

import java.util.Dictionary; //导入方法依赖的package包/类
public void setLambdaSlider() {
	Dictionary<Integer, JLabel> ld = lambdaS.getLabelTable();

	for (int i = lambdaS.getMinimum(); i <= lambdaS.getMaximum(); i += lambdaS.getMajorTickSpacing()) {
		ld.put(new Integer(i), new JLabel("" + Formatter.formatNumber(i * lambdaMultiplier, 2)));
	}

	//for (int i = 0; i <= 4; i++) {
	//	ld.put(new Integer(i * 25), new JLabel("" + Formatter.formatNumber(i * 0.25, 2)));
	//}
	lambdaS.setLabelTable(ld);
	ql.setLambda(lambdaMultiplier * lambdaS.getValue());
	lambdaL.setText(lambdaStrS + Formatter.formatNumber(lambdaS.getValue() * lambdaMultiplier, 2) + lambdaStrE);
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:15,代码来源:MMQueues.java

示例8: createService

import java.util.Dictionary; //导入方法依赖的package包/类
@Override
protected Entry<DataStoreDataSource> createService ( final UserInformation userInformation, final String configurationId, final BundleContext context, final Map<String, String> parameters ) throws Exception
{
    logger.debug ( "Creating new memory source: {}", configurationId );

    final DataStoreDataSource source = new DataStoreDataSource ( context, configurationId, this.executor, this.dataNodeTracker );
    source.update ( parameters );

    final Dictionary<String, String> properties = new Hashtable<String, String> ();
    properties.put ( DataSource.DATA_SOURCE_ID, configurationId );

    this.objectPool.addService ( configurationId, source, properties );

    return new Entry<DataStoreDataSource> ( configurationId, source );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:16,代码来源:DataStoreSourceFactory.java

示例9: start

import java.util.Dictionary; //导入方法依赖的package包/类
@Override
public void start ( final BundleContext context ) throws Exception
{
    this.executor = new ExportedExecutorService ( "org.eclipse.scada.da.server.component", 1, 1, 1, TimeUnit.MINUTES ); //$NON-NLS-1$

    this.hive = new Hive ( context, this.executor );

    this.hive.start ();
    final Dictionary<String, Object> properties = new Hashtable<> ();
    properties.put ( Constants.SERVICE_VENDOR, "Eclipse SCADA Project" );
    properties.put ( "hive.id", this.hive.getHiveId () ); //$NON-NLS-1$
    this.handle = context.registerService ( org.eclipse.scada.da.core.server.Hive.class, this.hive, properties );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:14,代码来源:Activator.java

示例10: testValue

import java.util.Dictionary; //导入方法依赖的package包/类
public void testValue() throws Exception {
	Dictionary dict = new Properties();
	dict.put("joe", "satriani");

	MapBasedDictionary wrapper = new MapBasedDictionary();
	wrapper.putAll(dict);
	assertTrue(wrapper.containsValue("satriani"));
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:9,代码来源:MapBasedDictionaryTest.java

示例11: fillProperties

import java.util.Dictionary; //导入方法依赖的package包/类
protected void fillProperties ( final Map<String, Variant> properties, final Dictionary<String, String> props )
{
    final Variant description = properties.get ( "description" );
    if ( description != null )
    {
        final String str = description.asString ( null );
        if ( str != null )
        {
            props.put ( Constants.SERVICE_DESCRIPTION, str );
        }
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:13,代码来源:DataItemFactory.java

示例12: addMandatoryProperties

import java.util.Dictionary; //导入方法依赖的package包/类
private void addMandatoryProperties(Dictionary dict) {
	// add mandatory properties
	Object id = dict.get(Constants.SERVICE_ID);
	if (id == null || !(id instanceof Long))
		dict.put(Constants.SERVICE_ID, new Long(GLOBAL_SERVICE_ID++));

	if (dict.get(Constants.OBJECTCLASS) == null)
		dict.put(Constants.OBJECTCLASS, objectClass);

	Object ranking = dict.get(Constants.SERVICE_RANKING);
	if (ranking == null || !(ranking instanceof Integer))
		dict.put(Constants.SERVICE_RANKING, new Integer(0));

	serviceId = ((Long) dict.get(Constants.SERVICE_ID)).longValue();
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:16,代码来源:MockServiceReference.java

示例13: start

import java.util.Dictionary; //导入方法依赖的package包/类
@Override
public void start ( final BundleContext context ) throws Exception
{
    if ( !Boolean.getBoolean ( "org.eclipse.scada.utils.ui.server.disableMainPage" ) )
    {
        final MainPageProvider mainPageProvider = new MainPageProvider ();
        final Dictionary<String, Object> properties = new Hashtable<> ( 2 );
        properties.put ( Constants.SERVICE_VENDOR, "Eclipse SCADA Project" );
        this.mainPageHandle = context.registerService ( PageProvider.class, mainPageProvider, properties );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:12,代码来源:Activator.java

示例14: setClassList

import java.util.Dictionary; //导入方法依赖的package包/类
@Override
public void setClassList(List<VFClass> classList) {
	this.classList = classList;
	Dictionary<String, Object> properties = new Hashtable<>();
	properties.put("model", classList);
	properties.put("icfg", icfg);
	Event modelChanged = new Event(DataModel.EA_TOPIC_DATA_MODEL_CHANGED, properties);
	eventAdmin.postEvent(modelChanged);
}
 
开发者ID:VisuFlow,项目名称:visuflow-plugin,代码行数:10,代码来源:DataModelImpl.java

示例15: enableDummyAuthorization

import java.util.Dictionary; //导入方法依赖的package包/类
public synchronized void enableDummyAuthorization ()
{
    if ( this.authzHandle != null )
    {
        return;
    }

    final Dictionary<String, Object> properties = new Hashtable<String, Object> ();
    properties.put ( Constants.SERVICE_DESCRIPTION, "A dummy authorization service" );
    properties.put ( Constants.SERVICE_VENDOR, "Eclipse SCADA Project" );
    properties.put ( Constants.SERVICE_RANKING, this.authorizationPriority );

    System.out.println ( String.format ( "Injecting dummy authorization service with priority: %s", this.authorizationPriority ) );
    this.authzHandle = this.context.registerService ( AuthorizationManager.class, this.authorizationService, properties );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:16,代码来源:Console.java


注:本文中的java.util.Dictionary.put方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。