Search in sources :

Example 1 with Dictionary

use of java.util.Dictionary in project jetty.project by eclipse.

the class WarUrlActivator method start.

/**
     * Register the url stream handler factory.
     * 
     * @param context
     */
@SuppressWarnings("unchecked")
public void start(BundleContext context) throws Exception {
    Dictionary props = new Hashtable();
    props.put(URLConstants.URL_HANDLER_PROTOCOL, new String[] { "war" });
    context.registerService(URLStreamHandlerService.class.getName(), new WarUrlStreamHandler(), props);
}
Also used : Dictionary(java.util.Dictionary) URLStreamHandlerService(org.osgi.service.url.URLStreamHandlerService) Hashtable(java.util.Hashtable)

Example 2 with Dictionary

use of java.util.Dictionary in project jphp by jphp-compiler.

the class UISlider method __getLabelTable.

@Signature
protected Memory __getLabelTable(Environment env, Memory... args) {
    Dictionary dictionary = component.getLabelTable();
    ArrayMemory result = new ArrayMemory();
    for (Object key : Collections.list(dictionary.keys())) {
        JLabel label = (JLabel) dictionary.get(key);
        result.refOfIndex((Integer) key).assign(label.getText());
    }
    return result.toConstant();
}
Also used : ArrayMemory(php.runtime.memory.ArrayMemory) Dictionary(java.util.Dictionary)

Example 3 with Dictionary

use of java.util.Dictionary in project jphp by jphp-compiler.

the class UISliderTag method addUnknown.

@Override
@SuppressWarnings("unchecked")
public void addUnknown(JSlider component, Node node, UIReader uiReader) {
    if (node.getNodeName().equalsIgnoreCase("item")) {
        Dictionary hashtable = component.getLabelTable();
        if (component.getLabelTable() == null)
            hashtable = new Hashtable();
        Node value = node.getAttributes().getNamedItem("value");
        int index = hashtable.size() - 1;
        if (value != null)
            index = Integer.parseInt(value.getNodeValue());
        hashtable.put(index, new JLabel(node.getTextContent()));
        if (component.getLabelTable() == null)
            component.setLabelTable(hashtable);
    }
}
Also used : Dictionary(java.util.Dictionary) Hashtable(java.util.Hashtable) Node(org.w3c.dom.Node)

Example 4 with Dictionary

use of java.util.Dictionary in project opennms by OpenNMS.

the class SyslogdReceiverJavaNetBlueprintIT method addServicesOnStartup.

@SuppressWarnings("rawtypes")
@Override
protected void addServicesOnStartup(Map<String, KeyValueHolder<Object, Dictionary>> services) {
    // Register any mock OSGi services here
    final MessageDispatcherFactory messageProducerFactory = mock(MessageDispatcherFactory.class);
    final MinionIdentity minionIdentity = mock(MinionIdentity.class);
    services.put(MessageDispatcherFactory.class.getName(), new KeyValueHolder<Object, Dictionary>(messageProducerFactory, new Properties()));
    services.put(MinionIdentity.class.getName(), new KeyValueHolder<Object, Dictionary>(minionIdentity, new Properties()));
}
Also used : Dictionary(java.util.Dictionary) MinionIdentity(org.opennms.minion.core.api.MinionIdentity) Properties(java.util.Properties) MessageDispatcherFactory(org.opennms.core.ipc.sink.api.MessageDispatcherFactory)

Example 5 with Dictionary

use of java.util.Dictionary in project opennms by OpenNMS.

the class LocationAwareDetectorClientIT method addServicesOnStartup.

@SuppressWarnings("rawtypes")
@Override
protected void addServicesOnStartup(Map<String, KeyValueHolder<Object, Dictionary>> services) {
    services.put(MinionIdentity.class.getName(), new KeyValueHolder<Object, Dictionary>(new MinionIdentity() {

        @Override
        public String getId() {
            return "0";
        }

        @Override
        public String getLocation() {
            return REMOTE_LOCATION_NAME;
        }
    }, new Properties()));
    Properties props = new Properties();
    props.setProperty("alias", "opennms.broker");
    services.put(Component.class.getName(), new KeyValueHolder<Object, Dictionary>(queuingservice, props));
    services.put(ServiceDetectorRegistry.class.getName(), new KeyValueHolder<Object, Dictionary>(serviceDetectorRegistry, new Properties()));
}
Also used : Dictionary(java.util.Dictionary) ServiceDetectorRegistry(org.opennms.netmgt.provision.detector.registry.api.ServiceDetectorRegistry) MinionIdentity(org.opennms.minion.core.api.MinionIdentity) Properties(java.util.Properties) Component(org.apache.camel.Component)

Aggregations

Dictionary (java.util.Dictionary)541 Hashtable (java.util.Hashtable)231 Test (org.junit.Test)152 Properties (java.util.Properties)101 Configuration (org.osgi.service.cm.Configuration)86 ServiceReference (org.osgi.framework.ServiceReference)84 Enumeration (java.util.Enumeration)62 IOException (java.io.IOException)60 ArrayList (java.util.ArrayList)51 Map (java.util.Map)50 HashMap (java.util.HashMap)48 ServiceRegistration (org.osgi.framework.ServiceRegistration)46 BundleContext (org.osgi.framework.BundleContext)40 List (java.util.List)39 ByteArrayInputStream (java.io.ByteArrayInputStream)34 InputStream (java.io.InputStream)33 FooService (org.apache.felix.ipojo.runtime.core.services.FooService)29 State (org.eclipse.osgi.service.resolver.State)29 BundleDescription (org.eclipse.osgi.service.resolver.BundleDescription)28 Bundle (org.osgi.framework.Bundle)28