public void BeforeClass() {
     ConfigurationBuilder conf = new ConfigurationBuilder();
     conf.AddServer().Host("127.0.0.1").Port(11222);
     conf.ConnectionTimeout(90000).SocketTimeout(6000);
     marshaller = new JBasicMarshaller();
     conf.Marshaller(marshaller);
     remoteManager = new RemoteCacheManager(conf.Build(), true);
 }
Beispiel #2
0
        public MessageProcessorTests()
        {
            var serializer = new MessageSerializer();
            var validator = new MessageValidator();
            _marshaller = new Marshaller(serializer, validator);

            _overseer = new ComponentOverseer(5, 1);
            _workManager = new WorkManager(_overseer);

            _processor = new MessageProcessor(_overseer, _workManager);
        }
Beispiel #3
0
        /// <summary>
        /// Creates MessageProcessor instance.
        /// </summary>
        /// <param name="componentOverseer">Component overseer module.</param>
        /// <param name="workManager">Work manager to get work from.</param>
        public MessageProcessor(IComponentOverseer componentOverseer, IWorkManager workManager)
        {
            if (componentOverseer == null)
                throw new ArgumentNullException("IComponentOverseer dependancy is null.");
            if (workManager == null)
                throw new ArgumentNullException("IWorkManager dependancy is null.");

            _inputDataQueue = new RawDataQueue();

            var serializer = new MessageSerializer();
            var validator = new MessageValidator();
            _marshaller = new Marshaller(serializer, validator);

            _componentOverseer = componentOverseer;
            _workManager = workManager;

            _processingLock = new AutoResetEvent(false);
        }
Beispiel #4
0
 /// <summary>
 /// Sets the <see cref="IMarshaller"/> to use.
 /// </summary>
 public WebhooksHelperBuilder WithMarshaller(IMarshaller marshaller)
 {
     this.Marshaller = marshaller;
     return(this);
 }
 public void TestAdminSuccess(IRemoteCache <String, String> hotrodCache, IRemoteCache <String, String> scriptCache, IMarshaller marshaller)
 {
     TestCommonSupervisorAdminOps(hotrodCache, scriptCache, marshaller);
     TestStats(hotrodCache);
     TestAddRemoveListener(hotrodCache);
     TestPutKeySet(hotrodCache);
 }
 public void TestWriterPerformsSupervisorOps(IRemoteCache <String, String> hotrodCache, IRemoteCache <String, String> scriptCache, IMarshaller marshaller)
 {
     AssertError(hotrodCache, cache => TestPutClear(cache));
     AssertError(hotrodCache, cache => TestPutContains(cache));
     AssertError(hotrodCache, cache => TestPutGetBulk(cache));
     AssertError(hotrodCache, cache => TestPutGetVersioned(cache));
     AssertError(hotrodCache, cache => TestPutGetWithMetadata(cache));
     AssertError(hotrodCache, cache => TestPutAll(cache));
     AssertError(hotrodCache, cache => TestPutIfAbsent(cache));
     AssertError(hotrodCache, cache => TestPutRemoveContains(cache));
     AssertError(hotrodCache, cache => TestPutRemoveWithVersion(cache));
     AssertError(hotrodCache, cache => TestPutReplaceWithFlag(cache));
     AssertError(hotrodCache, cache => TestPutReplaceWithVersion(cache));
     AssertError(hotrodCache, cache => TestPutSize(cache));
     AssertError(hotrodCache, cache => TestRemoteTaskExec(cache, scriptCache, marshaller));
 }
 public ConfigurationBuilder Marshaller(IMarshaller marshaller)
 {
     this.marshaller = marshaller;
     return this;
 }
Beispiel #8
0
        /// <summary>Creates a new instance of GMC.  
        /// Typically GMC will function as a singleton for each client, 
        /// however, there are cases where the designer may wish to have a variety of GMCS.</summary>
        /// <param name="subMrshlr">the submarshaller to use for marshalling objects to bytes.</param>
        public GMCMarshaller(IMarshaller subMrshlr)
        {
            log = LogManager.GetLogger(GetType());

            subMarshaller = subMrshlr;
            compressor = new GeneralMessageCompressor();
            decompressors = new Dictionary<int, GeneralMessageCompressor>();
        }
 private void ResolveMarshallersFromSchema(CqlMetadata cqlMetadata)
 {
     _KeyMarshaller = new Marshal.BytesType();
     _ColumnNameMarshaller = TypeResolver.GetMarshalledTypeForName(cqlMetadata.Default_name_type);
     _ColumnValueMarshaller = TypeResolver.GetMarshalledTypeForName(cqlMetadata.Default_value_type);
 }
Beispiel #10
0
 private static string GetName(IMarshaller marshaller, string ogName, int iteration) =>
 $"{ogName}_{marshaller?.GetType().Name ?? "Terminator"}_{iteration}";
 private void UseMarshaller(
     IDefinition definition,
     IMarshaller marshaller)
 {
     Marshallers[definition.SystemName] = marshaller;
 }
Beispiel #12
0
        public void TestModifyChatMessageServiceCreateUpdateDelete()
        {
            IMarshaller marshaller = _erector.Container.Resolve <IMarshaller>();

            IModifyChatMessageService modifyChatMessageService = _erector.Container.Resolve <IModifyChatMessageService>();

            IMessageBus <string>           messageBus           = _erector.Container.Resolve <IMessageBus <string> >();
            IMessageBusReaderBank <string> messageBusReaderBank = _erector.Container.Resolve <IMessageBusReaderBank <string> >();

            messageBusReaderBank.SpecifyTheMessageBus(messageBus);
            IMessageBusWriter <string> messageBusWriter = _erector.Container.Resolve <IMessageBusWriter <string> >();

            messageBusWriter.SpecifyTheMessageBus(messageBus);

            IMessageBusBank <string> messageBusBank = _erector.Container.Resolve <IMessageBusBank <string> >();

            messageBusBank.RegisterMessageBus(modifyChatMessageService.ServiceGUID, messageBus);

            modifyChatMessageService.MessageBusBank       = messageBusBank;
            modifyChatMessageService.MessageBusReaderBank = messageBusReaderBank;
            modifyChatMessageService.MessageBusReaderBank.AddAnotherReader(modifyChatMessageService.ProcessMessage);
            modifyChatMessageService.MessageBusWiter = messageBusWriter;

            IChatMessageEnvelope requestEnvelope = _erector.Container.Resolve <IChatMessageEnvelope>();

            requestEnvelope.ChatMessageID = 123;

            //Test ITack cannot be null
            string tackCannotBeNull;

            try
            {
                tackCannotBeNull = modifyChatMessageService.Post(requestEnvelope);
                Assert.Fail();
            }
            catch (InvalidOperationException ex)
            {
                string message = ex.Message;
                Assert.AreEqual(message, modifyChatMessageService.ExceptionMessage_ITackCannotBeNull);
            }
            try
            {
                tackCannotBeNull = modifyChatMessageService.Put(requestEnvelope);
                Assert.Fail();
            }
            catch (InvalidOperationException ex)
            {
                string message = ex.Message;
                Assert.AreEqual(message, modifyChatMessageService.ExceptionMessage_ITackCannotBeNull);
            }
            try
            {
                tackCannotBeNull = modifyChatMessageService.Delete(requestEnvelope);
                Assert.Fail();
            }
            catch (InvalidOperationException ex)
            {
                string message = ex.Message;
                Assert.AreEqual(message, modifyChatMessageService.ExceptionMessage_ITackCannotBeNull);
            }

            modifyChatMessageService.Tack = GetMockedITack();
            requestEnvelope = _erector.Container.Resolve <IChatMessageEnvelope>();
            IChatMessageEnvelope responseEnvelope;

            //Create
            string created = modifyChatMessageService.Post(requestEnvelope);

            Assert.IsFalse(String.IsNullOrEmpty(created));
            responseEnvelope = marshaller.UnMarshall <IChatMessageEnvelope>(created);
            Assert.AreEqual(responseEnvelope.ChatMessageID, requestEnvelope.ChatMessageID);
            Assert.IsTrue(DateTime.Compare(responseEnvelope.CreatedDateTime, DateTime.MinValue) > 0);
            requestEnvelope = _erector.Container.Resolve <IChatMessageEnvelope>();
            requestEnvelope.ChatMessageID = 123;


            //Update
            string updated = modifyChatMessageService.Put(requestEnvelope);

            Assert.IsFalse(String.IsNullOrEmpty(updated));
            responseEnvelope = marshaller.UnMarshall <IChatMessageEnvelope>(updated);
            Assert.AreEqual(responseEnvelope.ChatMessageID, requestEnvelope.ChatMessageID);
            Assert.IsTrue(DateTime.Compare(responseEnvelope.ModifiedDateTime, requestEnvelope.ModifiedDateTime) > 0);
            requestEnvelope = _erector.Container.Resolve <IChatMessageEnvelope>();
            requestEnvelope.ChatMessageID = 123;


            //Delete
            string deleted = modifyChatMessageService.Delete(requestEnvelope);

            Assert.IsFalse(String.IsNullOrEmpty(deleted));
            responseEnvelope = marshaller.UnMarshall <IChatMessageEnvelope>(deleted);
            Assert.AreEqual(responseEnvelope.ChatMessageID, requestEnvelope.ChatMessageID);
            Assert.IsTrue(DateTime.Compare(responseEnvelope.ModifiedDateTime, requestEnvelope.ModifiedDateTime) > 0);
        }
 internal Configuration(Infinispan.HotRod.SWIG.Configuration config, IMarshaller marshaller)
 {
     this.config = config;
     this.marshaller = marshaller;
 }
Beispiel #14
0
 public void CheckMarshaller(IMarshaller m)
 {
     Message[] messages = new Message[] {
         new BinaryMessage(0, RandomBytes(0)),
         new BinaryMessage(0, RandomBytes(10)),
         new BinaryMessage(0, RandomBytes(100)),
         new ObjectMessage(33, new List<object>()),
         new ObjectMessage(5, new List<int>()),
         new ObjectMessage(2, new Dictionary<byte,object>()),
         new StringMessage(156, "this is a test of faith"),
         new StringMessage(53, "เ, แ, โ, ใ, ไ"),
         new StringMessage(24, "\u005C\uFF5E\u301C"),
         new SystemMessage(SystemMessageType.IdentityRequest),
         new SystemPingMessage(SystemMessageType.PingRequest, 0, 0),
         new SystemIdentityResponseMessage(0),
         new TupleMessage(0, 9834, 0),
         new TupleMessage(0, 9834, 0, 1),
         new TupleMessage(0, 9834, 0, 1, 2),
         new TupleMessage(0, 9834, (byte)255, (sbyte)(127), (ushort)5),
         new TupleMessage(0, 9834, "test", (sbyte)(-128), new DateTime()),
     };
     foreach (Message original in messages)
     {
         bool seen = false;
         IMarshalledResult mr = m.Marshal(0, original, new NullTransport());
         while (mr.HasPackets)
         {
             TransportPacket tp = mr.RemovePacket();
             m.Unmarshal(tp, new NullTransport(),
                 (sender, mea) => {
                     seen = true;
                     AssertAreEquivalent(original, mea.Message);
                 });
             tp.Dispose();
         }
         Assert.IsTrue(seen, "Marshaller has not reported a message available");
         mr.Dispose();
     }
 }
Beispiel #15
0
 public cPeerBase(IMarshaller marshaller, string serverAddress)
 {
     Marshaller    = marshaller;
     IsError       = false;
     ServerAddress = serverAddress;
 }
Beispiel #16
0
        protected System.Threading.Tasks.Task <TResponse> InvokeAsync <TRequest, TResponse>(TRequest request,
                                                                                            IMarshaller <IRequest, AmazonWebServiceRequest> marshaller, ResponseUnmarshaller unmarshaller,
                                                                                            System.Threading.CancellationToken cancellationToken)
            where TRequest : AmazonWebServiceRequest
            where TResponse : AmazonWebServiceResponse, new()
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = marshaller;
            options.ResponseUnmarshaller = unmarshaller;
            return(InvokeAsync <TResponse>(request, options, cancellationToken));
        }
        public LargeObjectMarshaller(IMarshaller submarshaller, uint windowSize)
        {
            log = LogManager.GetLogger(GetType());

            this.subMarshaller = submarshaller;
            subMarshallerIsLwmcf11 = submarshaller.Descriptor.Equals(LWMCFv11.Descriptor)
                || submarshaller.Descriptor.StartsWith(LWMCFv11.DescriptorAsPrefix);

            InvalidStateException.Assert(windowSize >= 2 && windowSize <= MaxWindowSize,
                String.Format("Invalid window size: must be on [2,{0}]",  MaxWindowSize), this);
            this.windowSize = windowSize;
        }
Beispiel #18
0
 /// <summary>
 ///   Retrieves a named cache from the remote server. If the cache has been previously created with the same
 ///   name, the running cache instance is returned.  Otherwise, this method attempts to create the cache first.
 /// </summary>
 ///
 /// <param name="cacheName">the name of the cache</param>
 /// <param name="forceReturnValue">indicates if the force return value flag should be enabled or not</param>
 /// <param name="m">the marshaller policy for this cache</param>
 ///
 /// <returns>a remote cache instance which can be used to send requests to the named cache</returns>
 public IRemoteCache <K, V> GetCache <K, V>(String cacheName, bool forceReturnValue, IMarshaller m = null)
 {
     if (Infinispan.HotRod.SWIG.Util.Use64())
     {
         return(new RemoteCacheSWIGGenImpl <K, V>(manager, manager.GetByteArrayCache(cacheName, forceReturnValue), (m != null) ? m : marshaller, argMarshaller, configuration));
     }
     else
     {
         return(new RemoteCacheSWIGGenImpl <K, V>(manager, manager.GetByteArrayCache(cacheName, forceReturnValue), (m != null) ? m : marshaller, argMarshaller, configuration));
     }
 }
Beispiel #19
0
 public void registerMarshaller(Type target, IMarshaller marshaller)
 {
     marshallerMap.Add(target, marshaller);
 }
Beispiel #20
0
 public void Initialize()
 {
     marshaller = new JsonMarshaller();
 }
Beispiel #21
0
 /// <summary>
 /// Sets the object marshaller for this client.
 /// </summary>
 /// <param name="marshaller">The object marshaller implementing the <see cref="IMarshaller"/> interface.</param>
 /// <returns>The current <see cref="Client"/> instance.</returns>
 public Client SetMarshaller(IMarshaller marshaller)
 {
     Marshaller = marshaller;
     return this;
 }
Beispiel #22
0
 /// <summary>
 /// Initializes a new instance of the Nuxeo <see cref="Client"/>.
 /// </summary>
 /// <param name="serverURL">The URL of the Nuxeo server.</param>
 /// <param name="authorization">The authorization credentials.</param>
 /// <param name="automationPath">The Automation API path.</param>
 /// <param name="restPath">The REST API path.</param>
 /// <param name="schemas">The default schemas to be used in the requests.</param>
 /// <param name="timeout">The default request timeout.</param>
 public Client(string serverURL = "http://localhost:8080/nuxeo/",
               Authorization authorization = null,
               string automationPath = "api/v1/automation/",
               string restPath = "api/v1/",
               string[] schemas = null,
               int timeout = 30)
 {
     http = new HttpClient(new HttpClientHandler()
     {
         AutomaticDecompression = System.Net.DecompressionMethods.None,
         AllowAutoRedirect = false
     });
     SetTimemout(timeout);
     SetServerURL(serverURL);
     SetAuthorization(authorization);
     SetAuthomationPath(automationPath);
     SetRestPath(restPath);
     SetAuthorization(authorization);
     http.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(ContentType.ALL));
     Marshaller = new Marshaller(this).RegisterEntity("workflow", typeof(Workflow))
                                      .RegisterEntity("worflows", typeof(Workflows))
                                      .RegisterEntity("task", typeof(NuxeoClient.Wrappers.Task))
                                      .RegisterEntity("tasks", typeof(Tasks));
 }
Beispiel #23
0
 protected WrapperMarshallerBase(Ioc ioc, IMarshaller implementation) : base(ioc)
 {
     this.implementation = implementation ?? throw new ArgumentNullException(nameof(implementation));
 }
Beispiel #24
0
        /* (non-Javadoc)
         * @see com.richhickey.foil.IBaseMarshaller#marshallAtom(java.lang.Object, java.io.Writer, int, int)
         */
        public void marshallAtom(Object o, TextWriter w, int flags, int depth)
        {
            w.Write(' ');
            if (o == null)
            {
                w.Write("nil");
                return;
            }

            Type c = o.GetType();

            if (c.IsPrimitive)
            {
                if (o is Boolean)
                {
                    Boolean b = (Boolean)o;
                    if (b)
                    {
                        w.Write('t');
                    }
                    else
                    {
                        w.Write("nil");
                    }
                }
                else if (o is System.Char)
                {
                    w.Write("#\\");
                    w.Write("{0}", Convert.ToInt32((Char)o));
                }
                else
                {
                    w.Write(o.ToString());
                }
            }
            else if (o is String)
            {
                w.Write('"');
                w.Write(((String)o).Replace("\\\\", "\\\\\\\\").Replace("\"", "\\\\\""));
                w.Write('"');
            }
            else             //write a reference
            {
                if ((flags & IBaseMarshallerFlags.MARSHALL_ID) != 0)
                {
                    w.Write("#{:ref ");

                    ObjectID oid = referenceManager.getIdForObject(o);
                    //++oid.rev;
                    w.Write("{0} {1}", oid.id, oid.rev);

                    if ((flags & IBaseMarshallerFlags.MARSHALL_HASH) != 0)
                    {
                        w.Write(" :hash {0}", o.GetHashCode());
                    }

                    if ((flags & IBaseMarshallerFlags.MARSHALL_TYPE) != 0)
                    {
                        w.Write(" :type ");
                        marshallAtom(c, w, IBaseMarshallerFlags.MARSHALL_ID, 1);
                    }

                    if (depth > 0)
                    {
                        IMarshaller m = findMarshallerFor(c);
                        if (m != null)
                        {
                            w.Write(" :val");
                            m.marshall(o, w, this, flags, depth - 1);
                        }
                    }

                    w.Write('}');
                }
                else if (depth > 0)                     //effectively, MARSHALL_NO_REFS, write just the value of a reference type, since id was not requested
                {
                    IMarshaller m = findMarshallerFor(c);
                    if (m != null)
                    {
                        m.marshall(o, w, this, flags, depth - 1);
                    }
                    else
                    {
                        w.Write("nil");
                    }
                }
                else
                {
                    w.Write("nil");
                }
            }
        }
Beispiel #25
0
 public static IRequest RunMockRequest(AmazonWebServiceRequest request, IMarshaller <IRequest, AmazonWebServiceRequest> marshaller, AmazonEventBridgeConfig config)
 {
     return(TestUtils.RunMockRequest(new AmazonEventBridgePostMarshallHandler(), request, marshaller, config, new EventBridgeSigner()));
 }
 public void registerMarshaller(Type	target,IMarshaller marshaller)
 {
     marshallerMap.Add(target,marshaller);
 }
Beispiel #27
0
 public StructFactory(IMarshaller marshaller)
 {
     this.marshaller = marshaller ?? throw new ArgumentNullException(nameof(marshaller));
 }
        public void TestRemoteTaskExec(IRemoteCache <string, string> cache, IRemoteCache <string, string> scriptCache, IMarshaller marshaller)
        {
            string scriptName = "script.js";
            string script     = "//mode=local,language=javascript\n "
                                + "var cache = cacheManager.getCache(\"default\");\n "
                                + "cache.put(\"k1\", value);\n"
                                + "cache.get(\"k1\");\n";
            DataFormat df = new DataFormat();

            df.KeyMediaType   = "application/x-jboss-marshalling";
            df.ValueMediaType = "application/x-jboss-marshalling";
            IRemoteCache <String, String> dfScriptCache = scriptCache.WithDataFormat(df);

            dfScriptCache.Put(scriptName, script);
            IRemoteCache <String, String> dfCache    = cache.WithDataFormat(df);
            Dictionary <string, object>   scriptArgs = new Dictionary <string, object>();

            scriptArgs.Add("value", "v1");
            string ret1 = (string)dfCache.Execute(scriptName, scriptArgs);

            Assert.AreEqual("v1", ret1);
        }
Beispiel #29
0
 internal Configuration(Infinispan.HotRod.SWIG.Configuration config, IMarshaller marshaller, AuthenticationConfiguration authConfig)
 {
     this.config     = config;
     this.marshaller = marshaller;
     this.authConfig = authConfig;
 }
 public void TestSupervisorSuccess(IRemoteCache <String, String> hotrodCache, IRemoteCache <String, String> scriptCache, IMarshaller marshaller)
 {
     TestCommonSupervisorAdminOps(hotrodCache, scriptCache, marshaller);
 }
 /// <summary>
 /// Sets the object marshaller for this client.
 /// </summary>
 /// <param name="marshaller">The object marshaller implementing the <see cref="IMarshaller"/> interface.</param>
 /// <returns>The current <see cref="Client"/> instance.</returns>
 public Client SetMarshaller(IMarshaller marshaller)
 {
     Marshaller = marshaller;
     return(this);
 }
 protected void TestCommonSupervisorAdminOps(IRemoteCache <String, String> hotrodCache, IRemoteCache <String, String> scriptCache, IMarshaller marshaller)
 {
     TestPutClear(hotrodCache);
     TestPutClearAsync(hotrodCache);
     TestPutContains(hotrodCache);
     TestPutGet(hotrodCache);
     TestPutGetAsync(hotrodCache);
     TestPutGetBulk(hotrodCache);
     TestPutGetVersioned(hotrodCache);
     TestPutGetWithMetadata(hotrodCache);
     TestPutAll(hotrodCache);
     TestPutAllAsync(hotrodCache);
     TestPutIfAbsent(hotrodCache); //requires both READ and WRITE permissions
     TestPutIfAbsentAsync(hotrodCache);
     TestPutRemoveContains(hotrodCache);
     TestPutRemoveAsyncContains(hotrodCache);
     TestPutRemoveWithVersion(hotrodCache);
     TestPutRemoveWithVersionAsync(hotrodCache);
     TestPutReplaceWithFlag(hotrodCache);
     TestPutReplaceWithVersion(hotrodCache);
     TestPutReplaceWithVersionAsync(hotrodCache);
     TestPutSize(hotrodCache);
     TestRemoteTaskExec(hotrodCache, scriptCache, marshaller);
     //see ISPN-8059 - test this only for Admin user
     //TestPutKeySet(cache);
 }
        protected void Invoke <T, R>(R request, AmazonServiceCallback callback, object state, IMarshaller <T, R> marshaller, ResponseUnmarshaller unmarshaller, AbstractAWSSigner signer)
            where T : IRequest
            where R : AmazonWebServiceRequest
        {
            AsyncResult result = null;

            try
            {
                ProcessPreRequestHandlers(request);

                IRequest irequest = marshaller.Marshall(request);
                result = new AsyncResult(irequest, request, callback, state, signer, unmarshaller);
                Invoke(result);
            }
            catch (Exception e)
            {
                AmazonLogging.LogError(AmazonLogging.AmazonLoggingLevel.Errors, "Runtime", e.Message);
                result.HandleException(e);
                result.IsCompleted = true;
            }
            //return result;
        }
        protected System.Threading.Tasks.Task <TResponse> InvokeAsync <TRequest, TResponse>(TRequest request,
                                                                                            IMarshaller <IRequest, AmazonWebServiceRequest> marshaller, ResponseUnmarshaller unmarshaller,
                                                                                            System.Threading.CancellationToken cancellationToken)
            where TRequest : AmazonWebServiceRequest
            where TResponse : AmazonWebServiceResponse, new()
        {
            ThrowIfDisposed();

            var executionContext = new ExecutionContext(
                new RequestContext(this.Config.LogMetrics, Signer)
            {
                ClientConfig      = this.Config,
                Marshaller        = marshaller,
                OriginalRequest   = request,
                Unmarshaller      = unmarshaller,
                IsAsync           = true,
                CancellationToken = cancellationToken,
                ServiceMetaData   = this.ServiceMetadata
            },
                new ResponseContext()
                );

            SetupCSMHandler(executionContext.RequestContext);
            return(this.RuntimePipeline.InvokeAsync <TResponse>(executionContext));
        }
Beispiel #35
0
 public RoutingService(IMarshaller marshaller)
 {
     _isDisposed = false;
     _thisLock   = new object();
     _marshaller = marshaller;
 }
Beispiel #36
0
 public WebhooksHelper(IMarshaller marshaller, ISecretKeyStore secretKeyStore)
 {
     _marshaller     = marshaller ?? throw new ArgumentNullException("marshaller is required");
     _secretKeyStore = secretKeyStore ?? throw new ArgumentNullException("secretKeyStore is required");
 }
Beispiel #37
0
 public InternalClientEventListenerCallback(ClientListener <K, V> cl, IMarshaller marshaller)
 {
     this.cl         = cl;
     this.marshaller = marshaller;
 }
Beispiel #38
0
        /// <summary>
        /// Construct an instance with specific configuration and serializer.
        /// </summary>
        /// <param name="configuration"></param>
        /// <param name="marshaller"></param>
        /// <param name="argMarshaller"></param>
        /// <param name="start"></param>
        public RemoteCacheManager(Configuration configuration, IMarshaller marshaller, bool start = true, IMarshaller argMarshaller = null)
        {
            this.marshaller    = marshaller;
            this.argMarshaller = argMarshaller;
            this.configuration = configuration;

            if (Infinispan.HotRod.SWIG.Util.Use64())
            {
                manager = new Infinispan.HotRod.SWIGGen.RemoteCacheManager((Infinispan.HotRod.SWIGGen.Configuration)configuration.Config(), start);
            }
            else
            {
                manager = new Infinispan.HotRod.SWIGGen.RemoteCacheManager((Infinispan.HotRod.SWIGGen.Configuration)configuration.Config(), start);
            }
        }
Beispiel #39
0
 public EnumParameterWrapperMarshaller(Ioc ioc, IMarshaller implementation) : base(ioc, implementation)
 {
 }
Beispiel #40
0
        protected IAsyncResult Invoke <T, R>(R request, AsyncCallback callback, object state, bool synchronized, IMarshaller <T, R> marshaller, ResponseUnmarshaller unmarshaller, AbstractAWSSigner signer)
            where T : IRequest
            where R : AmazonWebServiceRequest
        {
            ProcessPreRequestHandlers(request);

            IRequest    irequest = marshaller.Marshall(request);
            AsyncResult result   = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);

            Invoke(result);
            return(result);
        }
Beispiel #41
0
 public Communicator(Session session, IMarshaller marshaller)
 {
     Session    = session ?? throw new ArgumentException("session is required");
     Marshaller = marshaller ?? throw new ArgumentException("marshaller is required");
 }
 public LargeObjectMarshaller(IMarshaller submarshaller)
     : this(submarshaller, DefaultWindowSize)
 {
 }
 public cPeer(AspNetWebSocketContext context, IMarshaller marshaller)
 {
     Context    = context;
     Marshaller = marshaller;
 }
Beispiel #44
0
 public override void Start()
 {
     if (Active) { return; }
     timer.Start();
     acceptors = configuration.CreateAcceptors();
     foreach (IAcceptor acc in acceptors)
     {
         acc.NewTransportAccepted += NewTransport;
         acc.ValidateTransport += ValidateIncomingTransport;
         acc.Start();
     }
     marshaller = configuration.CreateMarshaller();
     base.Start();
     running = true;
     log.Trace(this + ": started");
 }
 public void Initialize()
 {
     marshaller = new JsonMarshaller();
 }