Package com.vaadin.server

Examples of com.vaadin.server.DeploymentConfiguration


    @Override
    protected DeploymentConfiguration createDeploymentConfiguration(
            Properties initParameters) {
        // Get the original configuration from the super class
        final DeploymentConfiguration originalConfiguration = super
                .createDeploymentConfiguration(initParameters);

        // And then create a proxy instance that delegates to the original
        // configuration or a customized version
        return (DeploymentConfiguration) Proxy.newProxyInstance(
                DeploymentConfiguration.class.getClassLoader(),
                new Class[] { DeploymentConfiguration.class },
                new InvocationHandler() {
                    @Override
                    public Object invoke(Object proxy, Method method,
                            Object[] args) throws Throwable {
                        if (method.getDeclaringClass() == DeploymentConfiguration.class) {
                            // Find the configuration instance to delegate to
                            DeploymentConfiguration configuration = findDeploymentConfiguration(originalConfiguration);

                            return method.invoke(configuration, args);
                        } else {
                            return method.invoke(proxy, args);
                        }
View Full Code Here


    }

    private DeploymentConfiguration findDeploymentConfiguration(
            DeploymentConfiguration originalConfiguration) throws Exception {
        // First level of cache
        DeploymentConfiguration configuration = CurrentInstance
                .get(DeploymentConfiguration.class);

        if (configuration == null) {
            // Not in cache, try to find a VaadinSession to get it from
            VaadinSession session = VaadinSession.getCurrent();
View Full Code Here

        @Conf(name = "resourceCacheTime", value = "3599") })
public class CustomDeploymentConf extends AbstractTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        DeploymentConfiguration deploymentConfiguration = getSession()
                .getService().getDeploymentConfiguration();
        addComponent(new Label("Resource cache time: "
                + deploymentConfiguration.getResourceCacheTime()));
        addComponent(new Label("Custom config param: "
                + deploymentConfiguration.getApplicationOrSystemProperty(
                        "customParam", null)));
    }
View Full Code Here

TOP

Related Classes of com.vaadin.server.DeploymentConfiguration

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.