Example usage for java.util Collections EMPTY_MAP

List of usage examples for java.util Collections EMPTY_MAP

Introduction

In this page you can find the example usage for java.util Collections EMPTY_MAP.

Prototype

Map EMPTY_MAP

To view the source code for java.util Collections EMPTY_MAP.

Click Source Link

Document

The empty map (immutable).

Usage

From source file:org.apache.geronimo.tomcat.deployment.TomcatModuleBuilderTest.java

private void verifyStartable(String warName) throws Exception {
    WebModuleInfo info = deployWar(warName);
    assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(info.moduleName));
    Set names = info.configuration
            .findGBeans(new AbstractNameQuery(info.moduleName.getArtifact(), Collections.EMPTY_MAP));
    log.debug("names: " + names);
    for (Iterator iterator = names.iterator(); iterator.hasNext();) {
        AbstractName objectName = (AbstractName) iterator.next();
        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(objectName));
    }/*from  w  w w . j ava  2  s  .c o m*/
    undeployWar(info.configuration);
}

From source file:de.betterform.xml.config.DefaultConfig.java

/**
 * Read custom instance serializer that are used by AbstractConnector.
 * // w ww . j av a  2  s  .c  o  m
 * @param configContext
 *            the context holding the configuration.
 * @param sectionPath
 *            the context relative path to the section.
 * @param scheme
 *            the name of the attribute holding the scheme.
 * @param method
 *            the name of the attribute holding the method.
 * @param mediatype
 *            the name of the attribute holding the mediatype.
 * @param serializerClass
 *            the name of the attribute holding the InstanceSerializer
 *            implementation.
 * @return the specified configuration section in a hash map.
 * @throws Exception
 *             if any error occured during configuration loading.
 */
private InstanceSerializerMap loadSerializer(NodeInfo configContext, String sectionPath, String scheme,
        String method, String mediatype, String serializerClass) throws Exception {
    InstanceSerializerMap map = new InstanceSerializerMap();
    List nodeset = XPathCache.getInstance().evaluate(configContext, sectionPath, Collections.EMPTY_MAP, null);

    for (int i = 0; i < nodeset.size(); ++i) {
        Element element = (Element) XPathUtil.getAsNode(nodeset, i + 1);

        try {

            String schemeVal = element.getAttribute(scheme);
            schemeVal = ("".equals(schemeVal)) ? "*" : schemeVal;

            String methodVal = element.getAttribute(method);
            methodVal = ("".equals(methodVal)) ? "*" : methodVal;

            String mediatypeVal = element.getAttribute(mediatype);
            mediatypeVal = ("".equals(mediatypeVal)) ? "*" : mediatypeVal;

            String classVal = element.getAttribute(serializerClass);
            if (classVal == null) {
                continue;
            }

            InstanceSerializer serializer = (InstanceSerializer) Class.forName(classVal).newInstance();

            map.registerSerializer(schemeVal, methodVal, mediatypeVal, serializer);

        } catch (Exception e) {
            // silently ignore invalid references ...
            LOGGER.error("registerSerializer(\"" + scheme + "\",\"" + method + "\"," + mediatype + "\",\""
                    + serializerClass + "\") failed: " + e.getMessage(), e);
        }
    }

    return map;
}

From source file:org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.java

public ModelAndView handleURI(String uri, GrailsWebRequest webRequest) {
    return handleURI(uri, webRequest, Collections.EMPTY_MAP);
}

From source file:org.codehaus.groovy.grails.web.servlet.mvc.AbstractGrailsControllerHelper.java

public ModelAndView handleURI(String uri, GrailsWebRequest request) {
    return handleURI(uri, request, Collections.EMPTY_MAP);
}

From source file:fr.inria.atlanmod.neoemf.map.datastore.MapPersistenceBackendFactoryTest.java

@Test
public void testCreatePersistentBackendNoOption() throws InvalidDataStoreException {
    PersistenceBackend persistentBackend = persistenceBackendFactory.createPersistentBackend(testFile,
            Collections.EMPTY_MAP);
    assert persistentBackend instanceof MapPersistenceBackend : "Invalid backend created";
    // Need to test further the nature of the MapDB engine
}

From source file:eu.agilejava.snoop.scan.SnoopRegistrationClient.java

private void readConfiguration() throws SnoopConfigurationException {

    Map<String, Object> snoopConfig = Collections.EMPTY_MAP;
    try {//  w w w  .j a v  a2  s  . c  om
        Yaml yaml = new Yaml();
        Map<String, Object> props = (Map<String, Object>) yaml
                .load(Thread.currentThread().getContextClassLoader().getResourceAsStream("/snoop.yml"));

        snoopConfig = (Map<String, Object>) props.get("snoop");

    } catch (YAMLException e) {
        LOGGER.config(() -> "No configuration file. Using env properties.");
    }

    applicationConfig.setServiceName(SnoopExtensionHelper.getServiceName());
    final String host = readProperty("host", snoopConfig);
    final String port = readProperty("port", snoopConfig);
    applicationConfig.setServiceHome(host + ":" + port + "/");
    applicationConfig.setServiceRoot(readProperty("serviceRoot", snoopConfig));

    LOGGER.config(() -> "application config: " + applicationConfig.toJSON());

    serviceUrl = "ws://" + readProperty("snoopService", snoopConfig);
}

From source file:org.eclipselabs.spray.xtext.ui.internal.RegisterPlatformGenmodelListener.java

protected void unregisterGenmodel(IFile file) {
    ResourceSet rs = new ResourceSetImpl();
    Resource emfResource = rs//w w w  .j  a  v  a  2s .  c om
            .createResource(URI.createPlatformResourceURI((file.getFullPath().toPortableString()), true));
    try {
        emfResource.load(Collections.EMPTY_MAP);
        genModelHelper.unregisterGenModel(emfResource.getResourceSet(), emfResource.getURI());
        emfResource.unload();
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:info.magnolia.cms.util.ConfigUtil.java

/**
 * Convert the string to a JDOM Document.
 *//*w ww. j  av a 2 s.  c  o m*/
public static org.jdom.Document string2JDOM(String xml) throws JDOMException, IOException {
    return string2JDOM(xml, Collections.EMPTY_MAP);
}

From source file:de.betterform.xml.xforms.model.Instance.java

/**
 * Returns an iterator over all existing model items.
 *
 * @return an iterator over all existing model items.
 * @throws XFormsException/*www .jav a2 s .  c  o m*/
 */
public Iterator iterateModelItems() throws XFormsException {
    return iterateModelItems(getInstanceNodeset(), 1, "/", Collections.EMPTY_MAP, null, true);
}

From source file:de.betterform.agent.web.flux.FluxFacade.java

public List<XMLEvent> dispatchEventTypeWithContext(String id, String eventType, String sessionKey,
        Object[] contextInfo) throws XFormsException {
    Map params;/*from w ww  .  j  ava  2 s.  c  om*/
    if (contextInfo != null) {
        params = new HashMap();

        for (int i = 0; i < contextInfo.length; i++) {
            params.put("param" + i, contextInfo[i]);
        }

    } else {
        params = Collections.EMPTY_MAP;
    }

    return dispatchEventTypeWithContext(id, eventType, sessionKey, params);
}