private void sendNewChunkScripts() throws Exception { // Scripts while(true) { RealScriptSession.Script script = scriptSession.getScript(nextScriptIndex); if (script != null && script.getScript() instanceof String) { conduit.sendScript(EnginePrivate.getRemoteHandleReverseAjaxScript(script.getIndex(), (String) script.getScript())); nextScriptIndex = script.getIndex() + 1; } else { break; } } }
public OutboundVariable getReferenceVariable() { if (reference == null) { reference = new NonNestedOutboundVariable(getVariableName()); } referenced = true; return reference; }
private void sendPollReply() throws ConversionException, IOException { ScriptBuffer script = EnginePrivate.getRemoteHandleCallbackScript(batchId, "0", disconnectedTime); conduit.sendScript(ScriptBufferUtil.createOutput(script, converterManager, jsonOutput)); }
public String getDeclareCode() { if (isInline()) { return getChildDeclareCodes(); } else { return getChildDeclareCodes() + "var " + getVariableName() + "=[];"; } }
public Object convertInbound(Class<?> paramType, InboundVariable data) throws ConversionException { return new RealRawData(data, data.getContext()); }
/** * Internal method to allow us to get the Builder from which we * will get CallbackHelper objects. * Do NOT call this method from outside of DWR. */ public static CallbackHelper attach(Container container) { return factory.attach(container); }
/** * Parsing ctor * @param context How we lookup references * @param key The name of the variable that this was transfered as * @param type The type information from javascript * @param value The javascript variable converted to a string * @param has the data already been URL decoded? */ public InboundVariable(InboundContext context, String key, String type, String value, boolean urlDecoded) { this(context, key, type, new FormField(value), urlDecoded); }
@Override protected Property createTypeHintContext(InboundContext inctx, Property property) { return inctx.getCurrentProperty(); }
/** * Accessor for the current JsonParser. * @return The current JsonParser. */ public static JsonSerializer get() { return factory.get(); }
/** * If outline then we need a variable so we can be referred to */ protected String getVariableName() { if (varName == null) { varName = context.getNextVariableName(); } return varName; }
/** * @return Returns the value. */ public String getValue() { return formField.getString(); }
/** * Register ourselves with the ServerLoadMonitor so we can raise an * Alarm if we get shutdown * @param serverLoadMonitor */ public ShutdownAlarm(Sleeper sleeper, ServerLoadMonitor serverLoadMonitor) { this.sleeper = sleeper; this.serverLoadMonitor = serverLoadMonitor; this.serverLoadMonitor.threadWaitStarting(waitController); }
/** * Callbacks need a unique ID */ public String createUniqueId() { return idGenerator.generate(); }
/** * @param scope Set the scope. */ public void setScope(String scope) { checkScope(scope); this.scope = scope; }
/** * Make it easy for Factories to create a Factory instance. */ public static <T> Factory<T> create(Class<? extends Builder<T>> created) { return new Factory<T>(created); }
/** * Is there something (like JSON mode) that forces us to inline or maybe we * are referred to by multiple other things */ protected boolean isInline() { return context.isJsonMode() || !referenced; }
/** * Internal method to allow us to get the Builder from which we * will get TaskDispatcher objects. * Do NOT call this method from outside of DWR. */ public static TaskDispatcher attach(Container container) { return factory.attach(container); }
/** * Internal method to allow us to get the Builder from which we * will get JsonSerializer objects. * Do NOT call this method from outside of DWR. */ public static JsonSerializer attach(Container container) { return factory.attach(container); }