Java Code Examples for java.util.Dictionary

The following are top voted examples for showing how to use java.util.Dictionary. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: neoscada   File: ObjectPoolImpl.java   Source Code and License 6 votes vote down vote up
@Override
public synchronized void removeService ( final String id, final S service )
{
    if ( this.disposed )
    {
        return;
    }

    logger.debug ( "Removing service: {} -> {}", id, service );

    final Map<S, Dictionary<?, ?>> serviceMap = this.services.get ( id );
    if ( serviceMap == null )
    {
        return;
    }
    final Dictionary<?, ?> properties = serviceMap.remove ( service );
    if ( properties != null )
    {
        if ( serviceMap.isEmpty () )
        {
            this.services.remove ( id );
        }
        fireRemoveService ( id, service, properties );
    }
}
 
Example 2
Project: athena   File: ClusterIpManager.java   Source Code and License 6 votes vote down vote up
@Modified
protected void modified(ComponentContext context) {
    log.info("Received configuration change...");
    Dictionary<?, ?> properties = context != null ? context.getProperties() : new Properties();
    String newIp = get(properties, "aliasIp");
    String newMask = get(properties, "aliasMask");
    String newAdapter = get(properties, "aliasAdapter");

    // Process any changes in the parameters...
    if (!Objects.equals(newIp, aliasIp) ||
            !Objects.equals(newMask, aliasMask) ||
            !Objects.equals(newAdapter, aliasAdapter)) {
        synchronized (this) {
            log.info("Reconfiguring with aliasIp={}, aliasMask={}, aliasAdapter={}, wasLeader={}",
                     newIp, newMask, newAdapter, wasLeader);
            if (wasLeader) {
                removeIpAlias(aliasIp, aliasMask, aliasAdapter);
                addIpAlias(newIp, newMask, newAdapter);
            }
            aliasIp = newIp;
            aliasMask = newMask;
            aliasAdapter = newAdapter;
        }
    }
}
 
Example 3
Project: neoscada   File: Activator.java   Source Code and License 6 votes vote down vote up
private void activate ( final DataSourceFactory dataSourceFactory ) throws Exception
{
    logger.debug ( "Activate storage" );
    this.scheduler = ScheduledExportedExecutorService.newSingleThreadExportedScheduledExecutor ( "org.eclipse.scada.ae.server.storage.postgresql/ScheduledExecutor" );

    final Properties dbProperties = DataSourceHelper.getDataSourceProperties ( SPECIFIC_PREFIX, DataSourceHelper.DEFAULT_PREFIX );

    final String schema = getSchema ();
    final String instance = getInstance ();
    this.jdbcStorage = new JdbcStorage ( dataSourceFactory, this.scheduler, dbProperties, DataSourceHelper.isConnectionPool ( SPECIFIC_PREFIX, DataSourceHelper.DEFAULT_PREFIX, false ), schema, instance );
    this.jdbcStorage.start ();

    final Dictionary<String, Object> properties = new Hashtable<String, Object> ( 2 );
    properties.put ( Constants.SERVICE_DESCRIPTION, "PostgreSQL specific JDBC implementation for org.eclipse.scada.ae.server.storage.Storage" );
    properties.put ( Constants.SERVICE_VENDOR, "Eclipse SCADA Project" );
    this.jdbcStorageHandle = context.registerService ( new String[] { JdbcStorage.class.getName (), Storage.class.getName () }, this.jdbcStorage, properties );
    logger.debug ( "Storage activated - {}", this.jdbcStorageHandle );
}
 
Example 4
Project: neoscada   File: EventPoolManager.java   Source Code and License 6 votes vote down vote up
private void createPool ( final Storage storage, final EventManager eventManager )
{
    logger.info ( "Create pool: {}", this.id );
    try
    {
        this.pool = new EventPoolImpl ( this.executor, storage, eventManager, this.filter, this.size );

        this.pool.start ();

        logger.info ( "pool {} created", this.id );

        final Dictionary<String, String> properties = new Hashtable<String, String> ();
        properties.put ( Constants.SERVICE_PID, this.id );
        this.poolHandle = this.context.registerService ( EventQuery.class.getName (), this.pool, properties );
    }
    catch ( final Exception e )
    {
        logger.warn ( "Failed to create event pool: " + this.id, e );
    }
}
 
Example 5
Project: OpenJSharp   File: ImageView.java   Source Code and License 6 votes vote down vote up
/**
 * Loads the image from the URL <code>getImageURL</code>. This should
 * only be invoked from <code>refreshImage</code>.
 */
private void loadImage() {
    URL src = getImageURL();
    Image newImage = null;
    if (src != null) {
        Dictionary cache = (Dictionary)getDocument().
                                getProperty(IMAGE_CACHE_PROPERTY);
        if (cache != null) {
            newImage = (Image)cache.get(src);
        }
        else {
            newImage = Toolkit.getDefaultToolkit().createImage(src);
            if (newImage != null && getLoadsSynchronously()) {
                // Force the image to be loaded by using an ImageIcon.
                ImageIcon ii = new ImageIcon();
                ii.setImage(newImage);
            }
        }
    }
    image = newImage;
}
 
Example 6
Project: aries-jpa   File: PersistenceProviderTracker.java   Source Code and License 6 votes vote down vote up
@Override
public StoredPerProvider addingService(ServiceReference<PersistenceProvider> reference) {
    String providerName = (String)reference.getProperty(JAVAX_PERSISTENCE_PROVIDER);
    // FIXME should be set when creating the EMF was successful
    if (punit.getPersistenceProviderClassName() == null) {
        punit.setProviderClassName(providerName);
    }
    StoredPerProvider stored = new StoredPerProvider();
    LOGGER.info("Found provider for " + punit.getPersistenceUnitName() + " " + punit.getPersistenceProviderClassName());
    
    PersistenceProvider provider = context.getService(reference);

    createAndCloseDummyEMF(provider);

    stored.builder = new AriesEntityManagerFactoryBuilder(context, provider, reference.getBundle(), punit);
    Dictionary<String, ?> props = AriesEntityManagerFactoryBuilder.createBuilderProperties(punit, punit.getBundle());
    stored.reg = context.registerService(EntityManagerFactoryBuilder.class, stored.builder , props);
    return stored;
}
 
Example 7
Project: gemini.blueprint   File: OsgiServiceReferenceUtilsTest.java   Source Code and License 6 votes vote down vote up
protected void setUp() throws Exception {
	classes = new String[] { Object.class.getName(), Cloneable.class.getName(), Serializable.class.getName() };

	// lowest service reference
	Dictionary dict1 = new Hashtable();
	dict1.put(Constants.SERVICE_RANKING, Integer.MIN_VALUE);
	ref1 = new MockServiceReference(null, dict1, null);

	// neutral service reference
	Dictionary dict2 = new Hashtable();
	dict2.put(Constants.SERVICE_ID, (long) 20);

	ref2 = new MockServiceReference(null, dict2, null);

	// neutral service reference
	Dictionary dict3 = new Hashtable();
	dict3.put(Constants.SERVICE_ID, (long) 30);

	ref3 = new MockServiceReference(null, dict3, null);

	ctrl = createStrictControl();
	context = ctrl.createMock(BundleContext.class);

}
 
Example 8
Project: MapAnalyst   File: SliderUtils.java   Source Code and License 6 votes vote down vote up
public static void addSuffixToSliderLabels(JSlider slider, String suffix) {

        assert (slider != null && suffix != null);

        Dictionary oldLabels = slider.getLabelTable();
        Enumeration oldKeys = oldLabels.keys();
        Hashtable newLabelTable = new Hashtable();
        while (oldKeys.hasMoreElements()) {
            Object key = oldKeys.nextElement();
            Object value = oldLabels.get(key);
            assert (value instanceof String);
            String str = ((String)value).concat(suffix);
            JLabel label = new JLabel(str);
            newLabelTable.put(key, label);
        }

        slider.setLabelTable(newLabelTable);
    }
 
Example 9
Project: parabuild-ci   File: InvocationContextImpl.java   Source Code and License 6 votes vote down vote up
/**
 * Constructs a servlet invocation context for a specified servlet container,
 * request, and cookie headers.
 **/
InvocationContextImpl( ServletUnitClient client, ServletRunner runner, String target, WebRequest request, Dictionary clientHeaders, byte[] messageBody ) throws IOException, MalformedURLException {
    _client      = client;
    _application = runner.getApplication();
    _requestURL  = request.getURL();
    _target      = target;

    final ServletUnitHttpRequest suhr = new ServletUnitHttpRequest( _application.getServletRequest( _requestURL ), request, runner.getContext(),
                                                   clientHeaders, messageBody );
    _request = suhr;
    Cookie[] cookies = getCookies( clientHeaders );
    for (int i = 0; i < cookies.length; i++) suhr.addCookie( cookies[i] );

    if (_application.usesBasicAuthentication()) suhr.readBasicAuthentication();
    else if (_application.usesFormAuthentication()) suhr.readFormAuthentication();

    HttpSession session = _request.getSession( /* create */ false );
    if (session != null) ((ServletUnitHttpSession) session).access();
}
 
Example 10
Project: neoscada   File: Activator.java   Source Code and License 6 votes vote down vote up
@Override
public void start ( final BundleContext context ) throws Exception
{
    Activator.instance = this;
    this.context = context;

    this.executor = Executors.newSingleThreadExecutor ( new NamedThreadFactory ( context.getBundle ().getSymbolicName () ) );
    this.factory = new SumSourceFactory ( context, this.executor );

    final Dictionary<String, String> properties = new Hashtable<String, String> ();
    properties.put ( Constants.SERVICE_DESCRIPTION, "A summary data source" );
    properties.put ( Constants.SERVICE_VENDOR, "Eclipse SCADA Project" );
    properties.put ( ConfigurationAdministrator.FACTORY_ID, context.getBundle ().getSymbolicName () );

    context.registerService ( ConfigurationFactory.class.getName (), this.factory, properties );
}
 
Example 11
Project: jdk8u-jdk   File: BasicSliderUI.java   Source Code and License 6 votes vote down vote up
/**
 * Returns the biggest value that has an entry in the label table.
 *
 * @return biggest value that has an entry in the label table, or
 *         null.
 * @since 1.6
 */
protected Integer getHighestValue() {
    Dictionary dictionary = slider.getLabelTable();

    if (dictionary == null) {
        return null;
    }

    Enumeration keys = dictionary.keys();

    Integer max = null;

    while (keys.hasMoreElements()) {
        Integer i = (Integer) keys.nextElement();

        if (max == null || i > max) {
            max = i;
        }
    }

    return max;
}
 
Example 12
Project: aries-jpa   File: Activator.java   Source Code and License 6 votes vote down vote up
private void handlePotentialEclipseLink(Bundle b) {
    if (!ECLIPSELINK_JPA_PROVIDER_BUNDLE_SYMBOLIC_NAME.equals(b.getSymbolicName())) {
        return;
    }
    if (registeredProviders.containsKey(b)) {
        return;
    }
    
    PersistenceProvider provider = createEclipselinkProvider(b);
    if (provider == null) {
        return;
    }

    LOG.debug("Adding new EclipseLink provider for bundle {}", b);
    PersistenceProvider proxiedProvider = new EclipseLinkPersistenceProvider(provider, b);
    
    Dictionary<String, Object> props = new Hashtable<String, Object>(); // NOSONAR
    props.put("org.apache.aries.jpa.container.weaving.packages", getJPAPackages(b));
    props.put("javax.persistence.provider", ECLIPSELINK_JPA_PROVIDER_CLASS_NAME);
    ServiceRegistration<?> reg = context.registerService(PersistenceProvider.class, proxiedProvider, props);
    
    ServiceRegistration<?> old = registeredProviders.putIfAbsent(b, reg);
    if (old != null) {
        reg.unregister();
    }
}
 
Example 13
Project: neoscada   File: BeanConfigurationFactory.java   Source Code and License 6 votes vote down vote up
public Dictionary<String, ?> getProperties ()
{
    try
    {
        final Dictionary<String, Object> result = new Hashtable<String, Object> ();

        final Map<?, ?> properties = new BeanUtilsBean2 ().describe ( this.targetBean );
        for ( final Map.Entry<?, ?> entry : properties.entrySet () )
        {
            if ( entry.getValue () != null )
            {
                result.put ( entry.getKey ().toString (), entry.getValue () );
            }
        }
        return result;
    }
    catch ( final Exception e )
    {
        logger.warn ( "Failed to get dictionary", e );
        return new Hashtable<String, Object> ( 1 );
    }
}
 
Example 14
Project: neoscada   File: AbstractMasterItemMonitor.java   Source Code and License 6 votes vote down vote up
private synchronized void connect () throws InvalidSyntaxException
{
    if ( this.configuration.masterId == null )
    {
        setUnsafe ();
        throw new RuntimeException ( String.format ( "'%s' is not set", MasterItem.MASTER_ID ) );
    }

    logger.debug ( "Setting up for master item: {}", this.configuration.masterId );

    this.tracker = new SingleObjectPoolServiceTracker<MasterItem> ( this.poolTracker, this.configuration.masterId, new ServiceListener<MasterItem> () {

        @Override
        public void serviceChange ( final MasterItem service, final Dictionary<?, ?> properties )
        {
            AbstractMasterItemMonitor.this.setMasterItem ( service );
        }
    } );

    this.tracker.open ();
}
 
Example 15
Project: neoscada   File: Activator.java   Source Code and License 5 votes vote down vote up
@Override
public void start ( final BundleContext context ) throws Exception
{
    Activator.context = context;
    this.scheduler = ScheduledExportedExecutorService.newSingleThreadExportedScheduledExecutor ( context.getBundle ().getSymbolicName () + ".scheduler" );
    this.factory = new MovingAverageDataSourceFactory ( context, this.scheduler );

    final Dictionary<String, String> properties = new Hashtable<String, String> ();
    properties.put ( Constants.SERVICE_DESCRIPTION, "An averaging data source over time" );
    properties.put ( Constants.SERVICE_VENDOR, "Eclipse SCADA Project" );
    properties.put ( ConfigurationAdministrator.FACTORY_ID, context.getBundle ().getSymbolicName () );

    context.registerService ( ConfigurationFactory.class.getName (), this.factory, properties );
}
 
Example 16
Project: gemini.blueprint   File: MockServiceReferenceTest.java   Source Code and License 5 votes vote down vote up
private MockServiceReference createReference(Long id, Integer ranking) {
	Dictionary dict = new Properties();
	dict.put(Constants.SERVICE_ID, id);
	if (ranking != null)
		dict.put(Constants.SERVICE_RANKING, ranking);

	return new MockServiceReference(null, dict, null);
}
 
Example 17
Project: openjdk-jdk10   File: BasicSliderUI.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the width of the widest label.
 * @return the width of the widest label
 */
protected int getWidthOfWidestLabel() {
    @SuppressWarnings("rawtypes")
    Dictionary dictionary = slider.getLabelTable();
    int widest = 0;
    if ( dictionary != null ) {
        Enumeration<?> keys = dictionary.keys();
        while ( keys.hasMoreElements() ) {
            JComponent label = (JComponent) dictionary.get(keys.nextElement());
            widest = Math.max( label.getPreferredSize().width, widest );
        }
    }
    return widest;
}
 
Example 18
Project: neoscada   File: Activator.java   Source Code and License 5 votes vote down vote up
public void start ( final BundleContext context ) throws Exception
{
    this.factory = new ProxyDataSourceFactory ( context );

    final Dictionary<String, String> properties = new Hashtable<String, String> ();
    properties.put ( Constants.SERVICE_DESCRIPTION, "Proxy data sources" );
    properties.put ( Constants.SERVICE_VENDOR, "Eclipse SCADA Project" );
    properties.put ( ConfigurationAdministrator.FACTORY_ID, "da.datasource.proxy" );

    context.registerService ( ConfigurationFactory.class.getName (), this.factory, properties );
}
 
Example 19
Project: gemini.blueprint   File: ApplicationContextConfigurationTest.java   Source Code and License 5 votes vote down vote up
public void tstConfigLocationsInMetaInfWithHeaderAndDependencies() throws Exception {
	Dictionary headers = new Hashtable();
	headers.put("Spring-Context", "META-INF/spring/context.xml;wait-for-dependencies:=false");
	EntryLookupControllingMockBundle aBundle = new EntryLookupControllingMockBundle(headers);
	aBundle.setResultsToReturnOnNextCallToFindEntries(META_INF_SPRING_CONTENT);
	aBundle.setEntryReturnOnNextCallToGetEntry(new URL(META_INF_SPRING_CONTENT[0]));
	ApplicationContextConfiguration config = new ApplicationContextConfiguration(aBundle);
	String[] configFiles = config.getConfigurationLocations();
	assertTrue("bundle should be Spring powered", config.isSpringPoweredBundle());
	assertEquals("2 config files", 1, configFiles.length);
	assertEquals("osgibundle:META-INF/spring/context.xml", configFiles[0]);
}
 
Example 20
Project: improved-journey   File: TFIDFMeasure.java   Source Code and License 5 votes vote down vote up
private void GenerateTermFrequency()
{
	for(int i=0; i < _numDocs  ; i++)
	{								
		String curDoc=_docs[i];
		Dictionary freq=GetWordFrequency(curDoc);
		Enumeration enums=freq.keys();
		
		while(enums.hasMoreElements()){
			String word=(String) enums.nextElement();
			int wordFreq=(Integer)freq.get(word);
			int termIndex=GetTermIndex(word);
                  if(termIndex == -1)
                      continue;
			_termFreq [termIndex][i]=wordFreq;
			_docFreq[termIndex] ++;

			if (wordFreq > _maxTermFreq[i]) _maxTermFreq[i]=wordFreq;	
		}
		//DictionaryEnumerator enums=freq.GetEnumerator() ;
		_maxTermFreq[i]=Integer.MIN_VALUE ;
		/*freq.elements()
		Object ele=null;
		while ((ele=enums.nextElement())!=null)
		{
			
			String word=(String)ele.
			int wordFreq=(int)enums.Value ;
			int termIndex=GetTermIndex(word);
                  if(termIndex == -1)
                      continue;
			_termFreq [termIndex][i]=wordFre/q;
			_docFreq[termIndex] ++;

			if (wordFreq > _maxTermFreq[i]) _maxTermFreq[i]=wordFreq;					
		}*/
	}
}
 
Example 21
Project: gemini.blueprint   File: ApplicationContextConfigurationTest.java   Source Code and License 5 votes vote down vote up
public void testCreateAsynchronouslyDefaultTrueIfGarbage() {
	// *;flavour
	Dictionary headers = new Hashtable();
	headers.put("Spring-Context", "*;favour:=false");
	EntryLookupControllingMockBundle aBundle = new EntryLookupControllingMockBundle(headers);
	aBundle.setResultsToReturnOnNextCallToFindEntries(META_INF_SPRING_CONTENT);
	ApplicationContextConfiguration config = new ApplicationContextConfiguration(aBundle);
	assertTrue("bundle should have create-asynchronously = true", config.isCreateAsynchronously());
}
 
Example 22
Project: OpenJSharp   File: BasicSliderUI.java   Source Code and License 5 votes vote down vote up
/**
 * Returns true if all the labels from the label table have the same
 * baseline.
 *
 * @return true if all the labels from the label table have the
 *         same baseline
 * @since 1.6
 */
protected boolean labelsHaveSameBaselines() {
    if (!checkedLabelBaselines) {
        checkedLabelBaselines = true;
        Dictionary dictionary = slider.getLabelTable();
        if (dictionary != null) {
            sameLabelBaselines = true;
            Enumeration elements = dictionary.elements();
            int baseline = -1;
            while (elements.hasMoreElements()) {
                JComponent label = (JComponent) elements.nextElement();
                Dimension pref = label.getPreferredSize();
                int labelBaseline = label.getBaseline(pref.width,
                                                      pref.height);
                if (labelBaseline >= 0) {
                    if (baseline == -1) {
                        baseline = labelBaseline;
                    }
                    else if (baseline != labelBaseline) {
                        sameLabelBaselines = false;
                        break;
                    }
                }
                else {
                    sameLabelBaselines = false;
                    break;
                }
            }
        }
        else {
            sameLabelBaselines = false;
        }
    }
    return sameLabelBaselines;
}
 
Example 23
Project: neoscada   File: DataItemFactory.java   Source Code and License 5 votes vote down vote up
protected void registerItem ( final DataItem newItem, final String localId, final Map<String, Variant> properties )
{
    final Dictionary<String, String> props = new Hashtable<String, String> ();

    fillProperties ( properties, props );

    final ServiceRegistration<DataItem> handle = this.context.registerService ( DataItem.class, newItem, props );
    this.items.put ( localId, newItem );
    this.itemRegs.put ( localId, handle );
}
 
Example 24
Project: gemini.blueprint   File: ServiceReferenceComparatorTest.java   Source Code and License 5 votes vote down vote up
private ServiceReference createReference(Long id, Integer ranking) {
	Dictionary dict = new Properties();
	dict.put(Constants.SERVICE_ID, id);
	if (ranking != null)
		dict.put(Constants.SERVICE_RANKING, ranking);

	return new MockServiceReference(null, dict, null);
}
 
Example 25
Project: gemini.blueprint   File: ApplicationContextConfigurationTest.java   Source Code and License 5 votes vote down vote up
public void testCreateAsynchronouslyDefaultTrueIfAbsent() {
	// *;flavour
	Dictionary headers = new Hashtable();
	EntryLookupControllingMockBundle aBundle = new EntryLookupControllingMockBundle(headers);
	aBundle.setResultsToReturnOnNextCallToFindEntries(META_INF_SPRING_CONTENT);
	ApplicationContextConfiguration config = new ApplicationContextConfiguration(aBundle);
	assertTrue("bundle should have create-asynchronously = true", config.isCreateAsynchronously());
}
 
Example 26
Project: neoscada   File: Activator.java   Source Code and License 5 votes vote down vote up
private void registerRemoteExporter ( final BundleContext context )
{
    // TODO: create clientConnection
    final Dictionary<String, Object> props = new Hashtable<String, Object> ( 1 );
    props.put ( Constants.SERVICE_RANKING, 10 );
    context.registerService ( HttpExporter.class.getName (), new RemoteHttpExporter (), props );
}
 
Example 27
Project: gemini.blueprint   File: OsgiEventDispatcher.java   Source Code and License 5 votes vote down vote up
public void refreshFailure(BlueprintEvent event) {
	Dictionary<String, Object> props = init(event);

	Throwable th = event.getCause();
	props.put(EXCEPTION, th);
	props.put(CAUSE, th);
	props.put(EXCEPTION_CLASS, th.getClass().getName());
	String msg = th.getMessage();
	props.put(EXCEPTION_MESSAGE, (msg != null ? msg : ""));
	initDependencies(props, event);
	sendEvent(new Event(TOPIC_FAILURE, props));
}
 
Example 28
Project: neoscada   File: Activator.java   Source Code and License 5 votes vote down vote up
@Override
public void start ( final BundleContext context ) throws Exception
{
    this.factory = new DriverFactoryImpl ();

    final Dictionary<String, String> properties = new Hashtable<String, String> ();
    properties.put ( org.eclipse.scada.core.client.DriverFactory.INTERFACE_NAME, "da" );
    properties.put ( org.eclipse.scada.core.client.DriverFactory.DRIVER_NAME, "sfp" );
    properties.put ( Constants.SERVICE_DESCRIPTION, "Eclipse SCADA DA SFP Adapter" );
    properties.put ( Constants.SERVICE_VENDOR, "Eclipse SCADA Project" );
    this.handle = context.registerService ( org.eclipse.scada.core.client.DriverFactory.class, this.factory, properties );
}
 
Example 29
Project: gemini.blueprint   File: BlueprintEditorRegistrar.java   Source Code and License 5 votes vote down vote up
public void registerCustomEditors(PropertyEditorRegistry registry) {
	// Date
	registry.registerCustomEditor(Date.class, new DateEditor());
	// Collection concrete types
	registry.registerCustomEditor(Stack.class, new BlueprintCustomCollectionEditor(Stack.class));
	registry.registerCustomEditor(Vector.class, new BlueprintCustomCollectionEditor(Vector.class));

	// Spring creates a LinkedHashSet for Collection, RFC mandates an ArrayList
	// reinitialize default editors
	registry.registerCustomEditor(Collection.class, new BlueprintCustomCollectionEditor(Collection.class));
	registry.registerCustomEditor(Set.class, new BlueprintCustomCollectionEditor(Set.class));
	registry.registerCustomEditor(SortedSet.class, new BlueprintCustomCollectionEditor(SortedSet.class));
	registry.registerCustomEditor(List.class, new BlueprintCustomCollectionEditor(List.class));
	registry.registerCustomEditor(SortedMap.class, new CustomMapEditor(SortedMap.class));

	registry.registerCustomEditor(HashSet.class, new BlueprintCustomCollectionEditor(HashSet.class));
	registry.registerCustomEditor(LinkedHashSet.class, new BlueprintCustomCollectionEditor(LinkedHashSet.class));
	registry.registerCustomEditor(TreeSet.class, new BlueprintCustomCollectionEditor(TreeSet.class));

	registry.registerCustomEditor(ArrayList.class, new BlueprintCustomCollectionEditor(ArrayList.class));
	registry.registerCustomEditor(LinkedList.class, new BlueprintCustomCollectionEditor(LinkedList.class));

	// Map concrete types
	registry.registerCustomEditor(HashMap.class, new CustomMapEditor(HashMap.class));
	registry.registerCustomEditor(LinkedHashMap.class, new CustomMapEditor(LinkedHashMap.class));
	registry.registerCustomEditor(Hashtable.class, new CustomMapEditor(Hashtable.class));
	registry.registerCustomEditor(TreeMap.class, new CustomMapEditor(TreeMap.class));
	registry.registerCustomEditor(Properties.class, new PropertiesEditor());

	// JDK 5 types
	registry.registerCustomEditor(ConcurrentMap.class, new CustomMapEditor(ConcurrentHashMap.class));
	registry.registerCustomEditor(ConcurrentHashMap.class, new CustomMapEditor(ConcurrentHashMap.class));
	registry.registerCustomEditor(Queue.class, new BlueprintCustomCollectionEditor(LinkedList.class));

	// Legacy types
	registry.registerCustomEditor(Dictionary.class, new CustomMapEditor(Hashtable.class));
}
 
Example 30
Project: hashsdn-controller   File: RefreshingSCPModuleInfoRegistryTest.java   Source Code and License 5 votes vote down vote up
@Test
public void testConstructor() throws Exception {
    final ModuleInfoRegistry reg = mock(ModuleInfoRegistry.class);
    final SchemaContextProvider prov = mock(SchemaContextProvider.class);
    doReturn("string").when(prov).toString();
    final BundleContext ctxt = mock(BundleContext.class);
    final ServiceRegistration<?> servReg = mock(ServiceRegistration.class);
    doReturn(servReg).when(ctxt).registerService(any(Class.class), any(SchemaContextProvider.class),
            any(Dictionary.class));
    doReturn(servReg).when(ctxt).registerService(Mockito.anyString(), any(Object.class), any(Dictionary.class));
    doNothing().when(servReg).setProperties(any(Dictionary.class));

    final ClassLoadingStrategy classLoadingStrat = mock(ClassLoadingStrategy.class);
    final BindingContextProvider codecRegistryProvider = mock(BindingContextProvider.class);
    doNothing().when(codecRegistryProvider).update(classLoadingStrat, prov);
    final BindingRuntimeContext bindingRuntimeContext = mock(BindingRuntimeContext.class);
    doReturn("B-runtime-context").when(bindingRuntimeContext).toString();
    doReturn(bindingRuntimeContext).when(codecRegistryProvider).getBindingContext();

    final RefreshingSCPModuleInfoRegistry scpreg = new RefreshingSCPModuleInfoRegistry(reg, prov, classLoadingStrat,
            this.sourceProvider, codecRegistryProvider, ctxt);

    doNothing().when(servReg).unregister();

    final YangModuleInfo modInfo = mock(YangModuleInfo.class);
    doReturn("").when(modInfo).toString();
    final ObjectRegistration<YangModuleInfo> ymi = mock(ObjectRegistration.class);
    doReturn(ymi).when(reg).registerModuleInfo(modInfo);

    scpreg.registerModuleInfo(modInfo);
    scpreg.updateService();

    verify(codecRegistryProvider).update(classLoadingStrat, prov);

    scpreg.close();

    Mockito.verify(servReg, Mockito.times(1)).setProperties(any(Dictionary.class));
    Mockito.verify(servReg, Mockito.times(1)).unregister();
}
 
Example 31
Project: neoscada   File: Activator.java   Source Code and License 5 votes vote down vote up
@Override
public void start ( final BundleContext context ) throws Exception
{
    Activator.context = context;
    this.executor = Executors.newSingleThreadExecutor ( new NamedThreadFactory ( context.getBundle ().getSymbolicName () ) );
    this.factory = new AverageDataSourceFactory ( context, this.executor );

    final Dictionary<String, String> properties = new Hashtable<String, String> ();
    properties.put ( Constants.SERVICE_DESCRIPTION, "An averaging data source over multiple sources" );
    properties.put ( Constants.SERVICE_VENDOR, "Eclipse SCADA Project" );
    properties.put ( ConfigurationAdministrator.FACTORY_ID, context.getBundle ().getSymbolicName () );

    context.registerService ( ConfigurationFactory.class.getName (), this.factory, properties );
}
 
Example 32
Project: neoscada   File: Activator.java   Source Code and License 5 votes vote down vote up
public void start ( final BundleContext context ) throws Exception
{
    this.executor = Executors.newSingleThreadExecutor ( new NamedThreadFactory ( context.getBundle ().getSymbolicName () ) );
    this.factory = new MemorySourceFactory ( context, this.executor );

    final Dictionary<String, String> properties = new Hashtable<String, String> ();
    properties.put ( Constants.SERVICE_DESCRIPTION, "A memory data source" );
    properties.put ( Constants.SERVICE_VENDOR, "Eclipse SCADA Project" );
    properties.put ( ConfigurationAdministrator.FACTORY_ID, context.getBundle ().getSymbolicName () );

    context.registerService ( ConfigurationFactory.class.getName (), this.factory, properties );
}
 
Example 33
Project: elasticsearch_my   File: Settings.java   Source Code and License 5 votes vote down vote up
/**
 * Sets all the provided settings.
 */
public Builder put(Dictionary<Object,Object> properties) {
    for (Object key : Collections.list(properties.keys())) {
        map.put(Objects.toString(key), Objects.toString(properties.get(key)));
    }
    return this;
}
 
Example 34
Project: gemini.blueprint   File: BlueprintConfigUtils.java   Source Code and License 5 votes vote down vote up
/**
 * Shortcut method for retrieving the directive values. Different then
 * {@link #getDirectiveValue(Dictionary, String)} since it looks at the Bundle-Symbolic header and not at
 * Spring-Context.
 * 
 * @param headers
 * @param directiveName
 * @return
 */
private static String getBlueprintDirectiveValue(Dictionary headers, String directiveName) {
	String header = getSymNameHeader(headers);
	if (header != null) {
		String directive = ConfigUtils.getDirectiveValue(header, directiveName);
		if (directive != null)
			return directive;
	}
	return null;
}
 
Example 35
Project: neoscada   File: AbstractDataSourceFactory.java   Source Code and License 5 votes vote down vote up
@Override
public synchronized void update ( final UserInformation userInformation, final String configurationId, final Map<String, String> properties ) throws Exception
{
    DefaultDataSource source = this.dataSources.get ( configurationId );
    if ( source == null )
    {
        source = createDataSource ();
        this.dataSources.put ( configurationId, source );
        final Dictionary<String, String> props = new Hashtable<String, String> ();
        props.put ( DataSource.DATA_SOURCE_ID, configurationId );

        this.regs.put ( configurationId, this.context.registerService ( DataSource.class, source, props ) );
    }
    source.update ( properties );
}
 
Example 36
Project: neoscada   File: QueryServiceFactory.java   Source Code and License 5 votes vote down vote up
@Override
protected Entry<BundleMonitorQuery> createService ( final UserInformation userInformation, final String configurationId, final BundleContext context, final Map<String, String> parameters ) throws Exception
{
    final BundleMonitorQuery query = new BundleMonitorQuery ( this.executor, context, this.poolTracker );
    query.update ( parameters );

    final Dictionary<String, String> properties = new Hashtable<String, String> ();
    properties.put ( Constants.SERVICE_PID, configurationId );
    properties.put ( Constants.SERVICE_VENDOR, "Eclipse SCADA Project" );

    return new Entry<BundleMonitorQuery> ( configurationId, query, context.registerService ( MonitorQuery.class, query, properties ) );
}
 
Example 37
Project: aries-jpa   File: PropsConfigurationTest.java   Source Code and License 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Before
public void setup() throws Exception {
	
	when(punit.getPersistenceUnitName()).thenReturn("test-props");
	when(punit.getPersistenceProviderClassName())
		.thenReturn(ECLIPSE_PERSISTENCE_PROVIDER);
	when(punit.getTransactionType()).thenReturn(PersistenceUnitTransactionType.JTA);
	when(punit.getBundle()).thenReturn(punitBundle);
	when(punit.getProperties()).thenReturn(punitProperties);
	
	when(punitBundle.getBundleContext()).thenReturn(punitContext);
	when(punitBundle.getVersion()).thenReturn(Version.parseVersion("1.2.3"));
	
	when(containerContext.registerService(eq(ManagedService.class), 
			any(ManagedService.class), any(Dictionary.class))).thenReturn(msReg);
	when(containerContext.getService(dsfRef)).thenReturn(dsf);
	when(containerContext.getService(dsRef)).thenReturn(ds);
	when(containerContext.createFilter(Mockito.anyString()))
		.thenAnswer(new Answer<Filter>() {
			@Override
			public Filter answer(InvocationOnMock i) throws Throwable {
				return FrameworkUtil.createFilter(i.getArguments()[0].toString());
			}
		});
	
	when(punitContext.registerService(eq(EntityManagerFactory.class), any(EntityManagerFactory.class), 
			any(Dictionary.class))).thenReturn(emfReg);
	
	when(emf.isOpen()).thenReturn(true);
	
	
	Properties jdbcProps = new Properties();
	jdbcProps.setProperty("url", JDBC_URL);
	jdbcProps.setProperty("user", JDBC_USER);
	jdbcProps.setProperty("password", JDBC_PASSWORD);
	
	when(dsf.createDataSource(jdbcProps)).thenReturn(ds);
	
}
 
Example 38
Project: athena   File: Tools.java   Source Code and License 5 votes vote down vote up
/**
 * Check property name is defined as set to true.
 *
 * @param properties   properties to be looked up
 * @param propertyName the name of the property to look up
 * @param defaultValue the default value that to be assigned
 * @return value when the propertyName is defined or return the default value
 */
public static boolean isPropertyEnabled(Dictionary<?, ?> properties,
                                        String propertyName,
                                        boolean defaultValue) {
    try {
        String s = get(properties, propertyName);
        return Strings.isNullOrEmpty(s) ? defaultValue : Boolean.valueOf(s);
    } catch (ClassCastException e) {
        return defaultValue;
    }
}
 
Example 39
Project: gemini.blueprint   File: ConfigurationAdminManagerTest.java   Source Code and License 5 votes vote down vote up
public void testManagedServiceProperties() {
	assertTrue(services.isEmpty());
	assertNotNull(cam.getConfiguration());

	Dictionary props = (Dictionary) services.values().iterator().next();
	assertEquals(pid, props.get(Constants.SERVICE_PID));
}
 
Example 40
Project: Moenagade   File: Baseline.java   Source Code and License 5 votes vote down vote up
private static Integer getMaxSliderValue(JSlider slider) {
    Dictionary dictionary = slider.getLabelTable();
    if (dictionary != null) {
        Enumeration keys = dictionary.keys();
        int max = slider.getMinimum() - 1;
        while (keys.hasMoreElements()) {
            max = Math.max(max, ((Integer)keys.nextElement()).intValue());
        }
        if (max == slider.getMinimum() - 1) {
            return null;
        }
        return new Integer(max);
    }
    return null;
}
 
Example 41
Project: athena   File: FpmManager.java   Source Code and License 5 votes vote down vote up
@Modified
protected void modified(ComponentContext context) {
    Dictionary<?, ?> properties = context.getProperties();
    if (properties == null) {
        return;
    }
    String strClearRoutes = Tools.get(properties, "clearRoutes");
    clearRoutes = Boolean.parseBoolean(strClearRoutes);

    log.info("clearRoutes set to {}", clearRoutes);
}
 
Example 42
Project: gemini.blueprint   File: ApplicationContextConfigurationTest.java   Source Code and License 5 votes vote down vote up
public void tstConfigLocationsInMetaInfWithWildcardHeader() throws Exception {
	Dictionary headers = new Hashtable();
	headers.put("Spring-Context", "*;wait-for-dependencies:=false");
	EntryLookupControllingMockBundle aBundle = new EntryLookupControllingMockBundle(headers);
	aBundle.setResultsToReturnOnNextCallToFindEntries(META_INF_SPRING_CONTENT);
	aBundle.setEntryReturnOnNextCallToGetEntry(new URL(META_INF_SPRING_CONTENT[0]));
	ApplicationContextConfiguration config = new ApplicationContextConfiguration(aBundle);
	String[] configFiles = config.getConfigurationLocations();
	assertTrue("bundle should be Spring powered", config.isSpringPoweredBundle());
	assertEquals("1 config files", 1, configFiles.length);
	assertEquals(OsgiBundleXmlApplicationContext.DEFAULT_CONFIG_LOCATION, configFiles[0]);
}
 
Example 43
Project: athena   File: ControllerTest.java   Source Code and License 5 votes vote down vote up
/**
 * Tests configuring the controller.
 */
@Test
public void testConfiguration() {
    Dictionary<String, String> properties = new Hashtable<>();
    properties.put("openflowPorts", "1,2,3,4,5");
    properties.put("workerThreads", "5");

    controller.setConfigParams(properties);
    IntStream.rangeClosed(1, 5)
            .forEach(i -> assertThat(controller.openFlowPorts, hasItem(i)));
    assertThat(controller.workerThreads, is(5));
}
 
Example 44
Project: gemini.blueprint   File: OsgiServiceReferenceUtilsTest.java   Source Code and License 5 votes vote down vote up
/**
 * Test method for
 * {@link org.eclipse.gemini.blueprint.util.OsgiServiceReferenceUtils#getServiceId(org.osgi.framework.ServiceReference)}.
 */
public void testGetServiceId() {
	long id = 12345;
	Dictionary dict = new Hashtable();
	dict.put(Constants.SERVICE_ID, id);
	ServiceReference ref = new MockServiceReference(null, dict, null);
	assertEquals(id, OsgiServiceReferenceUtils.getServiceId(ref));
}
 
Example 45
Project: neoscada   File: Activator.java   Source Code and License 5 votes vote down vote up
@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 );
}
 
Example 46
Project: gemini.blueprint   File: OsgiServiceFactoryBeanTest.java   Source Code and License 5 votes vote down vote up
public void testRegisterService() throws Exception {
    Class<?>[] clazz =
            new Class<?>[]{Serializable.class, HashMap.class, Cloneable.class, Map.class, LinkedHashMap.class};

    String[] names = new String[clazz.length];

    for (int i = 0; i < clazz.length; i++) {
        names[i] = clazz[i].getName();
    }

    final Properties props = new Properties();
    final ServiceRegistration reg = new MockServiceRegistration();

    exporter.setBundleContext(new MockBundleContext() {

        public ServiceRegistration registerService(String[] clazzes, Object service, Dictionary properties) {
            assertTrue(service instanceof ServiceFactory);
            return reg;
        }
    });

    Object proxy = createMock(ServiceFactory.class);
    exporter.setTarget(proxy);
    exporter.setInterfaces(new Class<?>[]{ServiceFactory.class});
    String beanName = "boo";
    exporter.setTargetBeanName(beanName);

    expect(beanFactory.isSingleton(beanName)).andReturn(true);
    expect(beanFactory.isPrototype(beanName)).andReturn(false);
    expect(beanFactory.containsBean(beanName)).andReturn(true);
    expect(beanFactory.getBean(beanName)).andReturn(proxy);
    expect(beanFactory.getType(beanName)).andStubReturn((Class) ServiceFactory.class);
    beanFactoryControl.replay();

    exporter.afterPropertiesSet();
    assertSame(reg, exporter.registerService(clazz, props));
}
 
Example 47
Project: neoscada   File: Activator.java   Source Code and License 5 votes vote down vote up
@Override
public void start ( final BundleContext context ) throws Exception
{
    this.service = new PropertyAuthenticationService ();

    final Dictionary<String, Object> properties = new Hashtable<String, Object> ();
    properties.put ( Constants.SERVICE_DESCRIPTION, "A plain authentication service based on a system property" );
    properties.put ( Constants.SERVICE_VENDOR, "Eclipse SCADA Project" );
    properties.put ( Constants.SERVICE_RANKING, this.priority );

    context.registerService ( AuthenticationService.class.getName (), this.service, properties );
}
 
Example 48
Project: gemini.blueprint   File: TestBlueprintBuiltinConvertersTest.java   Source Code and License 5 votes vote down vote up
public void testCustomCollection() throws Exception {
	CollectionTestComponent cpn = context.getBean("customCollection", CollectionTestComponent.class);
	Object value = cpn.getPropertyValue();
	assertTrue(value instanceof MyCustomList);
	System.out.println(value.getClass());
	Collection col = (Collection) value;
	assertEquals(2, col.size());
	cpn = context.getBean("customDictionary", CollectionTestComponent.class);
	Object pv = cpn.getPropertyValue();
	assertTrue(pv instanceof Dictionary);
	assertTrue(pv instanceof MyCustomDictionary);
	assertEquals(2, ((MyCustomDictionary)pv).size());
}
 
Example 49
Project: visuflow-plugin   File: DataModelImpl.java   Source Code and License 5 votes vote down vote up
@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);
}
 
Example 50
Project: gemini.blueprint   File: MapBasedDictionaryTest.java   Source Code and License 5 votes vote down vote up
public void testPutAllDictionary() {
	Dictionary dict = new Properties();
	dict.put("joe", "satriani");

	MapBasedDictionary wrapper = new MapBasedDictionary();
	wrapper.putAll(dict);
	assertEquals(wrapper, dict);
}
 
Example 51
Project: neoscada   File: EventInjectorManager.java   Source Code and License 5 votes vote down vote up
public synchronized void start () throws Exception
{
    final BundleContext context = FrameworkUtil.getBundle ( EventInjectorManager.class ).getBundleContext ();

    this.impl = new EventInjectorImpl ( context, this.evaluator );

    final Dictionary<String, Object> properties = new Hashtable<> ();
    properties.put ( Constants.SERVICE_DESCRIPTION, "Event injector manager" );
    properties.put ( Constants.SERVICE_VENDOR, "Eclipse SCADA Project" );
    properties.put ( "osgi.command.scope", "ein" );
    properties.put ( "osgi.command.function", new String[] { "rules", "state" } );
    properties.put ( ConfigurationAdministrator.FACTORY_ID, "org.eclipse.scada.ae.server.injector" );
    context.registerService ( ConfigurationFactory.class, this.impl, properties );
}
 
Example 52
Project: neoscada   File: MqttExporter.java   Source Code and License 5 votes vote down vote up
private void setupPoolListener ( final Hive hive, final Session session )
{
    this.poolListener = new ObjectPoolListener<MqttItemToTopic> () {
        @Override
        public void serviceRemoved ( final MqttItemToTopic itemToTopic, final Dictionary<?, ?> properties )
        {
            try
            {
                unsubscribe ( session, itemToTopic );
            }
            catch ( InvalidSessionException | InvalidItemException | MqttException e )
            {
                logger.error ( "unsubscribe failed", e );
            }
        }

        @Override
        public void serviceModified ( final MqttItemToTopic itemToTopic, final Dictionary<?, ?> properties )
        {
            throw new UnsupportedOperationException ( "serviceModified must not be called" );
        }

        @Override
        public void serviceAdded ( final MqttItemToTopic itemToTopic, final Dictionary<?, ?> properties )
        {
            try
            {
                subscribe ( session, itemToTopic );
            }
            catch ( InvalidSessionException | InvalidItemException | MqttException e )
            {
                logger.error ( "subscribe failed", e );
            }
        }
    };
    this.pool.addListener ( this.poolListener );
}
 
Example 53
Project: neoscada   File: AllObjectPoolServiceTracker.java   Source Code and License 5 votes vote down vote up
@Override
public synchronized void serviceRemoved ( final S service, final Dictionary<?, ?> properties )
{
    final Dictionary<?, ?> oldProperties = this.services.remove ( service );
    if ( oldProperties != null )
    {
        fireServiceRemoved ( service, properties );
    }
}
 
Example 54
Project: ontonethub   File: JerseyEndpoint.java   Source Code and License 5 votes vote down vote up
public Dictionary<String,String> getInitParams() {
    Dictionary<String,String> initParams = new Hashtable<String,String>();
    // make jersey automatically turn resources into Viewable models and
    // hence lookup matching freemarker templates
    initParams.put("com.sun.jersey.config.feature.ImplicitViewables", "true");
    return initParams;
}
 
Example 55
Project: gemini.blueprint   File: ConfigPropertiesHandlerTest.java   Source Code and License 5 votes vote down vote up
protected void setUp() throws Exception {
    adminControl = createControl();
    admin = adminControl.createMock(ConfigurationAdmin.class);
    cfg = createMock(Configuration.class);

    config = new Hashtable<String, Object>();

    expect(admin.getConfiguration(persistentId)).andReturn(cfg).atLeastOnce();
    expect(cfg.getProperties()).andReturn(config).atLeastOnce();

    adminControl.replay();
    replay(cfg);

    bundleContext = new MockBundleContext() {

        // add Configuration admin support
        @Override
        public Object getService(ServiceReference reference) {
            return admin;
        }

        // ManagedService registration
        @Override
        public ServiceRegistration registerService(String clazz, Object service, Dictionary properties) {
            // save the callback
            if (ManagedService.class.getName().equals(clazz)) {
                msCallback = (ManagedService) service;
            }
            return super.registerService(clazz, service, properties);
        }
    };

    appContext = new GenericApplicationContext();
    appContext.getBeanFactory().addBeanPostProcessor(new BundleContextAwareProcessor(bundleContext));

    XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(appContext);
    // reader.setEventListener(this.listener);
    reader.loadBeanDefinitions(new ClassPathResource("configProperties.xml", getClass()));
    appContext.refresh();
}
 
Example 56
Project: gemini.blueprint   File: MockBundleTest.java   Source Code and License 5 votes vote down vote up
/**
 * Test method for
 * {@link org.eclipse.gemini.blueprint.mock.MockBundle#MockBundle(java.util.Dictionary)}.
 */
public void testMockBundleDictionary() {
	Dictionary headers = new Hashtable();

	mock = new MockBundle(headers);

	assertNotNull(mock.getLocation());
	assertSame(headers, mock.getHeaders());
	assertNotNull(mock.getSymbolicName());
}
 
Example 57
Project: neoscada   File: Activator.java   Source Code and License 5 votes vote down vote up
public void start ( final BundleContext context ) throws Exception
{
    this.factory = new DataSourceLoggerFactory ( context );
    final Dictionary<String, String> properties = new Hashtable<String, String> ();
    properties.put ( ConfigurationAdministrator.FACTORY_ID, context.getBundle ().getSymbolicName () );
    properties.put ( Constants.SERVICE_DESCRIPTION, "Records write requests" );
    context.registerService ( ConfigurationFactory.class.getName (), this.factory, properties );
}
 
Example 58
Project: neoscada   File: DataItemFactory.java   Source Code and License 5 votes vote down vote up
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 );
        }
    }
}
 
Example 59
Project: org.ops4j.pax.transx   File: AbstractActivator.java   Source Code and License 4 votes vote down vote up
private void updated(Dictionary<String, ?> properties) {
    if (!equals(this.configuration, properties)) {
        this.configuration = properties;
        reconfigure();
    }
}
 
Example 60
Project: visuflow-plugin   File: DataModelImpl.java   Source Code and License 4 votes vote down vote up
private void fireUnitChanged(VFUnit unit) {
	Dictionary<String, Object> properties = new Hashtable<>();
	properties.put("unit", unit);
	Event modelChanged = new Event(DataModel.EA_TOPIC_DATA_UNIT_CHANGED, properties);
	eventAdmin.postEvent(modelChanged);
}