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.

Delayed.java 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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.shared.annotations;
  17. import java.lang.annotation.Documented;
  18. import java.lang.annotation.ElementType;
  19. import java.lang.annotation.Target;
  20. import com.vaadin.shared.communication.ServerRpc;
  21. /**
  22. * Invoking a method in a {@link ServerRpc} interface marked with this
  23. * annotation will only add the invocation to a queue of outgoing RPC
  24. * invocations, but it will not cause the queue to be purged and sent to the
  25. * server. The queue will instead be sent when any RPC method not marked
  26. * as @Delayed has been invoked.
  27. *
  28. * @author Vaadin Ltd
  29. * @since 7.0.0
  30. */
  31. @Target(ElementType.METHOD)
  32. @Documented
  33. public @interface Delayed {
  34. /**
  35. * By setting lastOnly to <code>true</code>, any previous invocations of the
  36. * same method will be removed from the queue when a new invocation is
  37. * added. This can be used in cases where only the last value is of
  38. * interest.
  39. * <p>
  40. * The default value is <code>false</code> which means that invoking the
  41. * method multiple times will cause multiple invocations to be enqueued and
  42. * eventually sent to the server.
  43. *
  44. * @return <code>true</code> if only the last invocation of the annotated
  45. * method should be sent to the server, <code>false</code> if all
  46. * enqueued invocations should be sent.
  47. */
  48. public boolean lastOnly() default false;
  49. }