Esempio n. 1
0
        internal bool Serialize(IPortableStream stream)
        {
            ClusterGroupImpl prj = _ignite.ClusterGroup;

            PortableWriterImpl writer = prj.Marshaller.StartMarshal(stream);

            try
            {
                writer.Write(this);

                return(true);
            }
            catch (Exception e)
            {
                writer.WriteString("Failed to marshal job [job=" + _job + ", errType=" + e.GetType().Name +
                                   ", errMsg=" + e.Message + ']');

                return(false);
            }
            finally
            {
                // 4. Process metadata.
                prj.FinishMarshal(writer);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Execute job serializing result to the stream.
        /// </summary>
        /// <param name="cancel">Whether the job must be cancelled.</param>
        /// <param name="stream">Stream.</param>
        public void ExecuteRemote(PlatformMemoryStream stream, bool cancel)
        {
            // 1. Execute job.
            object res;
            bool   success;

            using (PeerAssemblyResolver.GetInstance(_ignite, Guid.Empty))
            {
                Execute0(cancel, out res, out success);
            }

            // 2. Try writing result to the stream.
            ClusterGroupImpl prj = _ignite.ClusterGroup;

            BinaryWriter writer = prj.Marshaller.StartMarshal(stream);

            try
            {
                // 3. Marshal results.
                BinaryUtils.WriteInvocationResult(writer, success, res);
            }
            finally
            {
                // 4. Process metadata.
                prj.FinishMarshal(writer);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Execute job serializing result to the stream.
        /// </summary>
        /// <param name="cancel">Whether the job must be cancelled.</param>
        /// <param name="stream">Stream.</param>
        public void ExecuteRemote(PlatformMemoryStream stream, bool cancel)
        {
            // 1. Execute job.
            object res;
            bool   success;

            Execute0(cancel, out res, out success);

            // 2. Try writing result to the stream.
            ClusterGroupImpl prj = _ignite.ClusterGroup;

            PortableWriterImpl writer = prj.Marshaller.StartMarshal(stream);

            try
            {
                // 3. Marshal results.
                PortableUtils.WriteWrappedInvocationResult(writer, success, res);
            }
            finally
            {
                // 4. Process metadata.
                prj.FinishMarshal(writer);
            }
        }