Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

OSGiVaadinPortletService.java 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright 2000-2016 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.osgi.liferay;
  17. import com.vaadin.server.DeploymentConfiguration;
  18. import com.vaadin.server.ServiceException;
  19. import com.vaadin.server.VaadinPortlet;
  20. import com.vaadin.server.VaadinPortletService;
  21. import com.vaadin.server.VaadinPortletSession;
  22. import com.vaadin.server.VaadinRequest;
  23. import com.vaadin.server.VaadinSession;
  24. import com.vaadin.ui.UI;
  25. /**
  26. * {@link VaadinPortletService} class that uses the {@link OSGiUIProvider} to
  27. * configure the {@link UI} class for a {@link VaadinPortlet}.
  28. *
  29. * @author Sampsa Sohlman
  30. *
  31. * @since 8.1
  32. */
  33. @SuppressWarnings("serial")
  34. public class OSGiVaadinPortletService extends VaadinPortletService {
  35. private OSGiUIProvider osgiUIProvider;
  36. public OSGiVaadinPortletService(VaadinPortlet portlet,
  37. DeploymentConfiguration deploymentConfiguration,
  38. OSGiUIProvider osgiUIProvider) throws ServiceException {
  39. super(portlet, deploymentConfiguration);
  40. this.osgiUIProvider = osgiUIProvider;
  41. }
  42. @Override
  43. protected VaadinSession createVaadinSession(VaadinRequest request)
  44. throws ServiceException {
  45. VaadinSession vaadinSession = new VaadinPortletSession(this);
  46. vaadinSession.addUIProvider(osgiUIProvider);
  47. return vaadinSession;
  48. }
  49. }