Package org.apache.hivemind.util

Examples of org.apache.hivemind.util.ContextResource


    static final String HIVE_MODULE_XML = "/WEB-INF/hivemodule.xml";

    protected void addWebInfDescriptor(ServletContext context, ClassResolver resolver,
            RegistryBuilder builder)
    {
        ContextResource r = new ContextResource(context, HIVE_MODULE_XML);

        if (r.getResourceURL() != null)
        {
            XmlModuleReader reader = new XmlModuleReader(builder.getRegistryDefinition(),
                    resolver, builder.getErrorHandler());
            reader.readModule(r);
        }
View Full Code Here


     */

    protected void addWebInfDescriptor(ServletContext context, ClassResolver resolver,
            RegistryBuilder builder)
    {
        ContextResource r = new ContextResource(context, HIVE_MODULE_XML);

        if (r.getResourceURL() != null)
        {
            ModuleDescriptorProvider provider = new XmlModuleDescriptorProvider(resolver, r);

            builder.addModuleDescriptorProvider(provider);
        }
View Full Code Here

     * @since 4.0
     */

    protected void addModuleIfExists(RegistryBuilder builder, ServletContext context, String path)
    {
        Resource r = new ContextResource(context, path);

        if (r.getResourceURL() == null)
            return;

        builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(_resolver, r));
    }
View Full Code Here

     * @since 4.0
     */

    protected void addModuleIfExists(RegistryBuilder builder, ServletContext context, String path)
    {
        Resource r = new ContextResource(context, path);

        if (r.getResourceURL() == null)
            return;

        builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(_resolver, r));
    }
View Full Code Here

        ServletContext context = servlet.getServletContext();
        String servletName = servlet.getServletName();
        String expectedName = servletName + ".application";

        Resource webInfLocation = new ContextResource(context, "/WEB-INF/");
        Resource webInfAppLocation = webInfLocation.getRelativeResource(servletName + "/");

        Resource result = check(webInfAppLocation, expectedName);
        if (result != null)
            return result;
View Full Code Here

        ApplicationSpecification result = new ApplicationSpecification();

        // Pretend the file exists in the most common expected location.

        Resource virtualLocation = new ContextResource(servlet.getServletContext(), "/WEB-INF/"
                + servletName + ".application");

        result.setSpecificationLocation(virtualLocation);

        result.setName(servletName);
View Full Code Here

        ServletContext context = servlet.getServletContext();
        String servletName = servlet.getServletName();
        String expectedName = servletName + ".application";

        Resource webInfLocation = new ContextResource(context, "/WEB-INF/");
        Resource webInfAppLocation = webInfLocation.getRelativeResource(servletName + "/");

        Resource result = check(webInfAppLocation, expectedName);
        if (result != null)
            return result;
View Full Code Here

        ApplicationSpecification result = new ApplicationSpecification();

        // Pretend the file exists in the most common expected location.

        Resource virtualLocation = new ContextResource(servlet.getServletContext(), "/WEB-INF/"
                + servletName + ".application");

        result.setSpecificationLocation(virtualLocation);

        result.setName(servletName);
View Full Code Here

        configControl.setReturnValue("fred");

        log.isDebugEnabled();
        logControl.setReturnValue(true);

        Resource r = new ContextResource(context, "/WEB-INF/fred/fred.application");

        log.debug("Checking for existence of " + r);

        context.getResource(r.getPath());
        contextControl.setReturnValue(new URL("file:/context" + r.getPath()));

        log.debug("Found " + r);

        IApplicationSpecification as = new ApplicationSpecification();
View Full Code Here

        configControl.setReturnValue("barney");

        log.isDebugEnabled();
        logControl.setReturnValue(false);

        Resource r = new ContextResource(context, "/WEB-INF/barney.application");

        context.getResource("/WEB-INF/barney/barney.application");
        contextControl.setReturnValue(null);

        log.isDebugEnabled();
        logControl.setReturnValue(false);

        context.getResource(r.getPath());
        contextControl.setReturnValue(new URL("file:/context" + r.getPath()));

        log.debug("Found " + r);

        IApplicationSpecification as = new ApplicationSpecification();
View Full Code Here

TOP

Related Classes of org.apache.hivemind.util.ContextResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.