w.print(escape(method.getName()));
w.println("\");");
- if (annotation.lastonly()) {
- w.print("store.setLastonly(");
+ if (annotation.lastOnly()) {
+ w.print("store.setLastOnly(");
writeClassLiteral(w, type);
w.print(", \"");
w.print(escape(method.getName()));
* The pending method invocations that will be send to the server by
* {@link #sendPendingCommand}. The key is defined differently based on
* whether the method invocation is enqueued with lastonly. With lastonly
- * enabled, the method signature ( {@link MethodInvocation#getLastonlyTag()}
+ * enabled, the method signature ( {@link MethodInvocation#getLastOnlyTag()}
* ) is used as the key to make enable removing a previously enqueued
* invocation. Without lastonly, an incremental id based on
* {@link #lastInvocationTag} is used to get unique values.
* request), <code>true</code> to let the framework delay sending
* of RPC calls and variable changes until the next non-delayed
* change
- * @param lastonly
+ * @param lastOnly
* <code>true</code> to remove all previously delayed invocations
* of the same method that were also enqueued with lastonly set
* to <code>true</code>. <code>false</code> to add invocation to
* invocations.
*/
public void addMethodInvocationToQueue(MethodInvocation invocation,
- boolean delayed, boolean lastonly) {
+ boolean delayed, boolean lastOnly) {
String tag;
- if (lastonly) {
- tag = invocation.getLastonlyTag();
- assert !tag.matches("\\d+") : "getLastonlyTag value must have at least one non-digit character";
+ if (lastOnly) {
+ tag = invocation.getLastOnlyTag();
+ assert !tag.matches("\\d+") : "getLastOnlyTag value must have at least one non-digit character";
pendingInvocations.remove(tag);
} else {
tag = Integer.toString(lastInvocationTag++);
connector.getConnectorId(), rpcInterface.getName(),
method.getName(), params);
connector.getConnection().addMethodInvocationToQueue(invocation,
- method.isDelayed(), method.isLastonly());
+ method.isDelayed(), method.isLastOnly());
// No RPC iface should have a return value
return null;
}
return TypeDataStore.isDelayed(this);
}
- public boolean isLastonly() {
- return TypeDataStore.isLastonly(this);
+ public boolean isLastOnly() {
+ return TypeDataStore.isLastOnly(this);
}
}
private final Map<Type, Collection<Property>> properties = new HashMap<Type, Collection<Property>>();
private final Set<Method> delayedMethods = new HashSet<Method>();
- private final Set<Method> lastonlyMethods = new HashSet<Method>();
+ private final Set<Method> lastOnlyMethods = new HashSet<Method>();
private final Map<Method, Type> returnTypes = new HashMap<Method, Type>();
private final Map<Method, Invoker> invokers = new HashMap<Method, Invoker>();
delayedMethods.add(getType(type).getMethod(methodName));
}
- public static boolean isLastonly(Method method) {
- return get().lastonlyMethods.contains(method);
+ public static boolean isLastOnly(Method method) {
+ return get().lastOnlyMethods.contains(method);
}
- public void setLastonly(Class<?> clazz, String methodName) {
- lastonlyMethods.add(getType(clazz).getMethod(methodName));
+ public void setLastOnly(Class<?> clazz, String methodName) {
+ lastOnlyMethods.add(getType(clazz).getMethod(methodName));
}
public static Collection<Property> getProperties(Type type)
@Documented
public @interface Delayed {
/**
- * By setting lastonly to <code>true</code>, any previous invocations of the
+ * By setting lastOnly to <code>true</code>, any previous invocations of the
* same method will be removed from the queue when a new invocation is
* added. This can be used in cases where only the last value is of
* interest.
* method should be sent to the server, <code>false</code> if all
* enqueued invocations should be sent.
*/
- public boolean lastonly() default false;
+ public boolean lastOnly() default false;
}
}
@Override
- public String getLastonlyTag() {
+ public String getLastOnlyTag() {
assert variableChanges.size() == 1;
- return super.getLastonlyTag()
+ return super.getLastOnlyTag()
+ variableChanges.keySet().iterator().next();
}
/**
* Gets a String tag that is used to uniquely identify previous method
* invocations that should be purged from the queue if
- * <code>{@literal @}Delay(lastonly = true)</code> is used.
+ * <code>{@literal @}Delay(lastOnly = true)</code> is used.
* <p>
* The returned string should contain at least one non-number char to ensure
- * it doesn't collide with the keys used for invocations without lastonly.
+ * it doesn't collide with the keys used for invocations without lastOnly.
*
* @return a string identifying this method invocation
*/
- public String getLastonlyTag() {
+ public String getLastOnlyTag() {
return connectorId + "-" + getInterfaceName() + "-" + getMethodName();
}
import com.vaadin.shared.ui.ClickRpc;
public interface UIServerRpc extends ClickRpc, ServerRpc {
- @Delayed(lastonly = true)
+ @Delayed(lastOnly = true)
public void resize(int viewWidth, int viewHeight, int windowWidth,
int windowHeight);
}
\ No newline at end of file
import com.vaadin.shared.communication.ServerRpc;
public interface CapsLockWarningRpc extends ServerRpc {
- @Delayed(lastonly = true)
+ @Delayed(lastOnly = true)
public void isCapsLockEnabled(boolean isCapsLockEnabled);
}