Examples of ESObject


Examples of FESI.Data.ESObject

        public Object execute(String method, Vector argvec) throws Exception
        {
            // convert arguments
            int l = argvec.size();

            ESObject callTarget = target;
            if (method.indexOf (".") > -1)
            {
                StringTokenizer st = new StringTokenizer(method, ".");
                int cnt = st.countTokens();
                for (int i = 1; i < cnt; i++)
                {
                    String next = st.nextToken();
                    try
                    {
                        callTarget = (ESObject) callTarget.getProperty(
                                next, next.hashCode());
                    }
                    catch (Exception x)
                    {
                        throw new EcmaScriptException("The property \"" + next
                                + "\" is not defined in the remote object.");
                    }
                }
                method = st.nextToken();
            }

            ESValue args[] = new ESValue[l];
            for (int i = 0; i < l; i++)
            {
                args[i] = FesiRpcUtil.convertJ2E(argvec.elementAt(i),
                        evaluator);
            }
            Object retval = FesiRpcUtil.convertE2J(
                    callTarget.doIndirectCall(evaluator, callTarget,
                    method, args));
            return retval;
        }
View Full Code Here

Examples of FESI.Data.ESObject

            return retval;
        }
        if (what instanceof Hashtable)
        {
            Hashtable t = (Hashtable) what;
            ESObject retval = new ObjectPrototype(
                    evaluator.getObjectPrototype(), evaluator);
            for (Enumeration e = t.keys(); e.hasMoreElements();)
            {
                String next = (String) e.nextElement();
                retval.putProperty(next, convertJ2E(t.get(next), evaluator),
                        next.hashCode());
            }
            return retval;
        }
View Full Code Here

Examples of FESI.Data.ESObject

         *
         */
        public ESObject doConstruct(ESObject thisObject, ESValue[] arguments)
                throws EcmaScriptException
        {
            ESObject remote = null;
            String url = null;
            String robj = null;
            if (arguments.length >= 1)
            {
                url = arguments[0].toString ();
View Full Code Here

Examples of FESI.Data.ESObject

         *
         */
        public ESObject doConstruct(ESObject thisObject, ESValue[] arguments)
                throws EcmaScriptException
        {
            ESObject remotesrv = null;
            String globalname = null;
            if (arguments.length < 1 || arguments.length > 2)
            {
                throw new EcmaScriptException("Wrong number of arguments for "
                        + "constructor RemoteServer");
View Full Code Here

Examples of FESI.Data.ESObject

                Object arg = FesiRpcUtil.convertE2J(arguments[i]);
                // System.out.println ("converted to J: "+arg.getClass ());
                v.addElement(arg);
            }
            // System.out.println ("spent "+(System.currentTimeMillis ()-now)+" millis in argument conversion");
            ESObject esretval = ObjectObject.createObject(evaluator);
            try
            {
                String method = remoteObject == null ? functionName
                        : remoteObject + "." + functionName;
                retval = client.execute(method, v);
                esretval.putProperty("error", ESNull.theNull,
                        "error".hashCode());
                esretval.putProperty("result", FesiRpcUtil.convertJ2E(retval,
                        this.evaluator), "result".hashCode());
            }
            catch (Exception x)
            {
                String msg = x.getMessage();
                if (msg == null || msg.length() == 0)
                {
                    msg = x.toString ();
                }
                esretval.putProperty("error", new ESString(msg),
                        "error".hashCode());
                esretval.putProperty("result", ESNull.theNull,
                        "result".hashCode());
            }
            return esretval;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.