summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/terminal/gwt/server/ApplicationPortlet2.java
blob: 7a46a07e6c0f17f6ab0931ed0766b9c99d08af7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* 
@VaadinApache2LicenseForJavaFiles@
 */

package com.vaadin.terminal.gwt.server;

import javax.portlet.PortletConfig;
import javax.portlet.PortletException;

import com.vaadin.Application;
import com.vaadin.terminal.gwt.server.ServletPortletHelper.ApplicationClassException;

/**
 * TODO Write documentation, fix JavaDoc tags.
 * 
 * @author peholmst
 */
public class ApplicationPortlet2 extends AbstractApplicationPortlet {

    private Class<? extends Application> applicationClass;

    @Override
    public void init(PortletConfig config) throws PortletException {
        super.init(config);
        try {
            applicationClass = ServletPortletHelper.getApplicationClass(
                    config.getInitParameter("application"),
                    config.getInitParameter(Application.ROOT_PARAMETER),
                    getClassLoader());
        } catch (ApplicationClassException e) {
            throw new PortletException(e);
        }
    }

    @Override
    protected Class<? extends Application> getApplicationClass() {
        return applicationClass;
    }

}