Package org.directwebremoting

Examples of org.directwebremoting.ScriptBuffer


     */
    public void close(int timetoNextPoll) throws IOException
    {
        try
        {
            ScriptBuffer script = EnginePrivate.getRemoteHandleCallbackScript(batchId, "0", timetoNextPoll);
            addScript(script);
        }
        catch (Exception ex)
        {
            ScriptBuffer script = EnginePrivate.getRemoteHandleExceptionScript(batchId, "0", ex);
            try
            {
                addScript(script);
            }
            catch (ConversionException ex1)
View Full Code Here


        if (method.getName().equals("toString") && (args == null || args.length == 0))
        {
            return toString();
        }

        ScriptBuffer script = EnginePrivate.getRemoteExecuteObjectScript(id, method.getName(), args);
        session.addScript(script);
        return null;
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.directwebremoting.io.JavascriptObject#execute(String, java.lang.Object[])
     */
    public void execute(String methodName, Object... params)
    {
        ScriptBuffer script = EnginePrivate.getRemoteExecuteObjectScript(id, methodName, params);
        session.addScript(script);
    }
View Full Code Here

     * Add a property to a JavaScript object. The type of the data must be
     * convertible by DWR.
     */
    public void set(String propertyName, Object data)
    {
        ScriptBuffer script = EnginePrivate.getRemoteSetObjectScript(id, propertyName, data);
        session.addScript(script);
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.directwebremoting.io.JavascriptFunction#close()
     */
    public void close()
    {
        ScriptBuffer script = EnginePrivate.getRemoteCloseFunctionScript(id);
        session.addScript(script);
    }
View Full Code Here

        /* (non-Javadoc)
         * @see org.directwebremoting.event.MessageListener#onMessage(org.directwebremoting.event.MessageEvent)
         */
        public void onMessage(MessageEvent message)
        {
            ScriptBuffer script = new ScriptBuffer();
            script.appendCall("dwr.hub._remotePublish", subscriptionId, message.getRawData());
            session.addScript(script);
        }
View Full Code Here

     * Call a named function with no parameters.
     * @param funcName The name of the function to call
     */
    public void addFunctionCall(String funcName)
    {
        ScriptBuffer script = new ScriptBuffer();
        script.appendScript(funcName)
              .appendScript("();");
        addScript(script);
    }
View Full Code Here

            {
                // The existence of a throwable indicates that something went wrong
                if (reply.getThrowable() != null)
                {
                    Throwable ex = reply.getThrowable();
                    ScriptBuffer script = EnginePrivate.getRemoteHandleExceptionScript(batchId, callId, ex);
                    conduit.addScript(script);
                    // TODO: Are there any reasons why we should be logging here (and in the ConversionException handler)
                    //log.warn("--Erroring: batchId[" + batchId + "] message[" + ex.toString() + ']'), ex;
                }
                else
                {
                    Object data = reply.getReply();
                    ScriptBuffer script = EnginePrivate.getRemoteHandleCallbackScript(batchId, callId, data);
                    conduit.addScript(script);
                }
            }
            catch (IOException ex)
            {
                // We're a bit stuck we died half way through writing so
                // we can't be sure the browser can react to the failure.
                // Since we can no longer do output we just log and end
                log.error("--Output Error: batchId[" + batchId + "] message[" + ex.toString() + ']', ex);
            }
            catch (ConversionException ex)
            {
                ScriptBuffer script = EnginePrivate.getRemoteHandleExceptionScript(batchId, callId, ex);
                addScriptHandleExceptions(conduit, script);
                log.warn("--ConversionException: batchId=" + batchId + " class=" + ex.getConversionType().getName(), ex);
            }
            catch (Exception ex)
            {
                // This is a bit of a "this can't happen" case so I am a bit
                // nervous about sending the exception to the client, but we
                // want to avoid silently dying so we need to do something.
                ScriptBuffer script = EnginePrivate.getRemoteHandleExceptionScript(batchId, callId, ex);
                addScriptHandleExceptions(conduit, script);
                log.error("--ConversionException: batchId=" + batchId + " message=" + ex.toString());
            }
        }
        sendOutboundScriptSuffix(out, replies.getCalls().getInstanceId(), replies.getCalls().getBatchId());
View Full Code Here

     * @param funcName The name of the function to call
     * @param param1 The first parameter to the above function
     */
    public void addFunctionCall(String funcName, Object param1)
    {
        ScriptBuffer script = new ScriptBuffer();
        script.appendScript(funcName)
              .appendScript("(")
              .appendData(param1)
              .appendScript(");");
        addScript(script);
    }
View Full Code Here

     * @param param1 The first parameter to the above function
     * @param param2 The second parameter to the above function
     */
    public void addFunctionCall(String funcName, Object param1, Object param2)
    {
        ScriptBuffer script = new ScriptBuffer();
        script.appendScript(funcName)
              .appendScript("(")
              .appendData(param1)
              .appendScript(",")
              .appendData(param2)
              .appendScript(");");
View Full Code Here

TOP

Related Classes of org.directwebremoting.ScriptBuffer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.