Example usage for org.apache.wicket Application get

List of usage examples for org.apache.wicket Application get

Introduction

In this page you can find the example usage for org.apache.wicket Application get.

Prototype

public static Application get(final String applicationKey) 

Source Link

Document

Gets the Application based on the application key of that application.

Usage

From source file:org.brixcms.demo.web.dav.JcrServlet.java

License:Apache License

@Override
protected Repository getRepository() {
    WicketApplication app = (WicketApplication) Application.get("wicket.brix-demo");
    return app.getRepository();
}

From source file:org.brixcms.demo.web.dav.SimpleServlet.java

License:Apache License

private Brix getBrix() {
    WicketApplication app = (WicketApplication) Application.get("wicket.brix-demo");
    return app.getBrix();
}

From source file:org.brixcms.demo.web.dav.SimpleServlet.java

License:Apache License

@Override
public Repository getRepository() {
    WicketApplication app = (WicketApplication) Application.get("wicket.brix-demo");
    return app.getRepository();
}

From source file:org.brixcms.plugin.demo.web.dav.JcrServlet.java

License:Apache License

@Override
protected Repository getRepository() {
    BrixApplication app = (BrixApplication) Application.get("wicket.brix-demo");
    return app.getRepository();
}

From source file:org.brixcms.plugin.demo.web.dav.SimpleServlet.java

License:Apache License

private Brix getBrix() {
    BrixApplication app = (BrixApplication) Application.get("wicket.brix-demo");
    return app.getBrix();
}

From source file:org.brixcms.plugin.demo.web.dav.SimpleServlet.java

License:Apache License

@Override
public Repository getRepository() {
    BrixApplication app = (BrixApplication) Application.get("wicket.brix-demo");
    return app.getRepository();
}

From source file:org.seasar.wicket.S2WicketFilter.java

License:Apache License

private void initInternal(final boolean isServlet, FilterConfig filterConfig) throws ServletException {
    // ????????????
    destroy();//w w  w .j a  v a2  s .c  om

    // ???
    configuration = getInitParameter(filterConfig, "configuration", "development").toUpperCase();
    configPath = getInitParameter(filterConfig, "configPath", "app.dicon");
    debug = getInitParameter(filterConfig, "debug", null);
    reloadingClassPattern = getInitParameter(filterConfig, "reloadingClassPattern", null);
    useReloadingClassLoader = RuntimeConfigurationType.DEVELOPMENT.name().equalsIgnoreCase(configuration)
            && reloadingClassPattern != null;

    if (logger.isInfoEnabled()) {
        logger.info("[config] configuration='{}'", configuration);
        logger.info("[config] configPath='{}'", configPath);
        logger.info("[config] debug='{}'", debug);
        logger.info("[config] reloadingClassPattern='{}'", reloadingClassPattern);
    }

    if (RuntimeConfigurationType.DEVELOPMENT == RuntimeConfigurationType.valueOf(configuration)
            && reloadingClassPattern != null) {
        ReloadingClassLoader.getPatterns().clear();
        // ??????????
        // ???????????
        for (String classPattern : reloadingClassPattern.split(",")) {
            if (!classPattern.startsWith("-")) {
                ReloadingClassLoader.includePattern(classPattern);
            } else {
                ReloadingClassLoader.excludePattern(classPattern.substring(1));
            }
        }
        for (URL str : ReloadingClassLoader.getLocations()) {
            logger.info("[classpath] {}", str);
        }
        for (String str : ReloadingClassLoader.getPatterns()) {
            logger.info("[pattern] {}", str);
        }
    }

    ComponentDeployerFactory.setProvider(new ExternalComponentDeployerProvider());
    S2Container s2container = S2ContainerFactory.create(configPath, getClassLoader());
    s2container.setExternalContext(new HttpServletExternalContext());
    s2container.setExternalContextComponentDefRegister(new HttpServletExternalContextComponentDefRegister());
    s2container.getExternalContext().setApplication(filterConfig.getServletContext());
    s2container.init();
    SingletonS2ContainerFactory.setContainer(s2container);

    if (SmartDeployUtil.isHotdeployMode(SingletonS2ContainerFactory.getContainer())) {
        throw new ServletException("S2Wicket does not support HOT deploy mode.");
    }

    // Application???getHomePage()??????
    // ????????????

    super.init(isServlet, filterConfig);

    // ???WebApplication?????????
    WebApplication webApplication = (WebApplication) Application.get(filterConfig.getFilterName());
    webApplication.getComponentInstantiationListeners().add(new ComponentInjectionListener());
    applicationConfigType = webApplication.getConfigurationType();
    applicationEncoding = webApplication.getRequestCycleSettings().getResponseRequestEncoding();

    if (RuntimeConfigurationType.DEVELOPMENT == RuntimeConfigurationType.valueOf(configuration)) {
        webApplication.getFrameworkSettings()
                .setSerializer(new ReloadingJavaSerializer(webApplication.getApplicationKey()));
        if (debug != null) {
            webApplication.mountPage(debug, S2DebugPage.class);
        }
    }
}