You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Push.java 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright 2000-2014 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.annotations;
  17. import java.lang.annotation.ElementType;
  18. import java.lang.annotation.Retention;
  19. import java.lang.annotation.RetentionPolicy;
  20. import java.lang.annotation.Target;
  21. import com.vaadin.shared.communication.PushMode;
  22. import com.vaadin.shared.ui.ui.Transport;
  23. import com.vaadin.ui.UI;
  24. /**
  25. * Configures server push for a {@link UI}. Adding <code>@Push</code> to a UI
  26. * class configures the UI for automatic push. If some other push mode is
  27. * desired, it can be passed as a parameter, e.g.
  28. * <code>@Push(PushMode.MANUAL)</code>.
  29. *
  30. * @see PushMode
  31. *
  32. * @author Vaadin Ltd.
  33. * @since 7.1
  34. */
  35. @Retention(RetentionPolicy.RUNTIME)
  36. @Target(ElementType.TYPE)
  37. public @interface Push {
  38. /**
  39. * Returns the {@link PushMode} to use for the annotated UI. The default
  40. * push mode when this annotation is present is {@link PushMode#AUTOMATIC}.
  41. *
  42. * @return the push mode to use
  43. */
  44. public PushMode value() default PushMode.AUTOMATIC;
  45. /**
  46. * Returns the transport type used for the push for the annotated UI. The
  47. * default transport type when this annotation is present is
  48. * {@link Transport#WEBSOCKET}.
  49. *
  50. * @return the transport type to use
  51. */
  52. public Transport transport() default Transport.WEBSOCKET;
  53. }