Esempio n. 1
0
 public PeriodicAnnouncerImpl(ICancellationTokenSource cancellationTokenSource, IPofSerializer courierSerializer, ReadableCourierEndpoint localEndpoint, NetworkBroadcaster networkBroadcaster)
 {
     this.cancellationTokenSource = cancellationTokenSource;
     this.courierSerializer       = courierSerializer;
     this.localEndpoint           = localEndpoint;
     this.networkBroadcaster      = networkBroadcaster;
 }
 public ModificationComponentFactory(IFileSystemProxy fileSystemProxy, IPofContext pofContext, SlotSourceFactory slotSourceFactory, IPofSerializer serializer)
 {
     this.fileSystemProxy   = fileSystemProxy;
     this.pofContext        = pofContext;
     this.slotSourceFactory = slotSourceFactory;
     this.serializer        = serializer;
 }
Esempio n. 3
0
 public CourierClientFactoryImpl(GuidProxy guidProxy, IThreadingProxy threadingProxy, INetworkingProxy networkingProxy, ObjectPoolFactory objectPoolFactory, IPofSerializer pofSerializer)
 {
     this.guidProxy         = guidProxy;
     this.threadingProxy    = threadingProxy;
     this.networkingProxy   = networkingProxy;
     this.objectPoolFactory = objectPoolFactory;
     this.pofSerializer     = pofSerializer;
 }
        public CourierEndpointImpl(IPofSerializer pofSerializer, Guid identifier, string name, IConcurrentDictionary <Guid, byte[]> properties)
        {
            this.pofSerializer = pofSerializer;
            this.identifier    = identifier;
            this.properties    = properties;

            SetProperty(CourierEndpointPropertyKeys.Name, name);
        }
 public MessageTransmitterImpl(GuidProxy guidProxy, IPofSerializer pofSerializer, NetworkBroadcaster networkBroadcaster, UnacknowledgedReliableMessageContainer unacknowledgedReliableMessageContainer, ObjectPool <CourierMessageV1> messageDtoPool)
 {
     this.guidProxy          = guidProxy;
     this.pofSerializer      = pofSerializer;
     this.networkBroadcaster = networkBroadcaster;
     this.unacknowledgedReliableMessageContainer = unacknowledgedReliableMessageContainer;
     this.messageDtoPool = messageDtoPool;
 }
Esempio n. 6
0
 public HostSessionFactoryImpl(IThreadingProxy threadingProxy, ICollectionFactory collectionFactory, IPofSerializer pofSerializer, PofStreamsFactory pofStreamsFactory, PortableObjectBoxConverter portableObjectBoxConverter)
 {
     this.threadingProxy             = threadingProxy;
     this.collectionFactory          = collectionFactory;
     this.pofSerializer              = pofSerializer;
     this.pofStreamsFactory          = pofStreamsFactory;
     this.portableObjectBoxConverter = portableObjectBoxConverter;
 }
Esempio n. 7
0
 public RemoteCourierEndpointImpl(Guid identifier, string name, RevisionCounter revisionCounter, IPofSerializer pofSerializer, IPAddress initialAddress)
 {
     this.identifier      = identifier;
     this.name            = name;
     this.revisionCounter = revisionCounter;
     this.pofSerializer   = pofSerializer;
     this.initialAddress  = initialAddress;
     this.lastAddress     = initialAddress;
 }
 public ServiceClientFactoryImpl(ProxyGenerator proxyGenerator, IStreamFactory streamFactory, ICollectionFactory collectionFactory, IThreadingProxy threadingProxy, INetworkingProxy networkingProxy, IPofSerializer pofSerializer, PofStreamsFactory pofStreamsFactory)
 {
     this.proxyGenerator    = proxyGenerator;
     this.streamFactory     = streamFactory;
     this.collectionFactory = collectionFactory;
     this.threadingProxy    = threadingProxy;
     this.networkingProxy   = networkingProxy;
     this.pofSerializer     = pofSerializer;
     this.pofStreamsFactory = pofStreamsFactory;
 }
 public NetworkReceiverImpl(ReadableCourierEndpoint localEndpoint, CourierNetworkContext networkContext, IPofSerializer pofSerializer, MessageRouter messageRouter, MessageAcknowledger messageAcknowledger, PeerRegistryImpl peerRegistry, ReceivedMessageFactory receivedMessageFactory)
 {
     this.localEndpoint          = localEndpoint;
     this.networkContext         = networkContext;
     this.pofSerializer          = pofSerializer;
     this.messageRouter          = messageRouter;
     this.messageAcknowledger    = messageAcknowledger;
     this.peerRegistry           = peerRegistry;
     this.receivedMessageFactory = receivedMessageFactory;
 }
 public ModificationListingSynchronizer(IPofSerializer pofSerializer, IFileSystemProxy fileSystemProxy, IClientConfiguration clientConfiguration, TemporaryFileService temporaryFileService, ExeggutorService exeggutorService, ModificationLoader modificationLoader, ObservableCollection<ModificationViewModel> modificationViewModels, LeagueBuildUtilities leagueBuildUtilities)
 {
     this.pofSerializer = pofSerializer;
      this.fileSystemProxy = fileSystemProxy;
      this.clientConfiguration = clientConfiguration;
      this.temporaryFileService = temporaryFileService;
      this.exeggutorService = exeggutorService;
      this.modificationLoader = modificationLoader;
      this.modificationViewModels = modificationViewModels;
      this.leagueBuildUtilities = leagueBuildUtilities;
 }
Esempio n. 11
0
 public ModificationListingSynchronizer(IPofSerializer pofSerializer, IFileSystemProxy fileSystemProxy, IClientConfiguration clientConfiguration, TemporaryFileService temporaryFileService, ExeggutorService exeggutorService, ModificationLoader modificationLoader, ObservableCollection <ModificationViewModel> modificationViewModels, LeagueBuildUtilities leagueBuildUtilities)
 {
     this.pofSerializer          = pofSerializer;
     this.fileSystemProxy        = fileSystemProxy;
     this.clientConfiguration    = clientConfiguration;
     this.temporaryFileService   = temporaryFileService;
     this.exeggutorService       = exeggutorService;
     this.modificationLoader     = modificationLoader;
     this.modificationViewModels = modificationViewModels;
     this.leagueBuildUtilities   = leagueBuildUtilities;
 }
 public ModificationPhaseFactory(IPofSerializer pofSerializer, IFileSystemProxy fileSystemProxy, TemporaryFileService temporaryFileService, ExeggutorService exeggutorService, ModificationPhaseManager phaseManager, ModificationLoader modificationLoader, ModificationViewModel viewModel, LeagueBuildUtilities leagueBuildUtilities, Modification modification)
 {
     this.pofSerializer = pofSerializer;
      this.fileSystemProxy = fileSystemProxy;
      this.temporaryFileService = temporaryFileService;
      this.exeggutorService = exeggutorService;
      this.phaseManager = phaseManager;
      this.modificationLoader = modificationLoader;
      this.viewModel = viewModel;
      this.leagueBuildUtilities = leagueBuildUtilities;
      this.modification = modification;
 }
Esempio n. 13
0
        public AsymmetricStreamIT()
        {
            streamFactory = new StreamFactory();
            IThreadingFactory       threadingFactory       = new ThreadingFactory();
            ISynchronizationFactory synchronizationFactory = new SynchronizationFactory();

            threadingProxy = new ThreadingProxy(threadingFactory, synchronizationFactory);

            serializer = new PofSerializer(new PofContext().With(x => {
                x.RegisterPortableObjectType(1, typeof(PofStreamsIT.TestClass));
            }));
        }
Esempio n. 14
0
 public ModificationPhaseFactory(IPofSerializer pofSerializer, IFileSystemProxy fileSystemProxy, TemporaryFileService temporaryFileService, ExeggutorService exeggutorService, ModificationPhaseManager phaseManager, ModificationLoader modificationLoader, ModificationViewModel viewModel, LeagueBuildUtilities leagueBuildUtilities, Modification modification)
 {
     this.pofSerializer        = pofSerializer;
     this.fileSystemProxy      = fileSystemProxy;
     this.temporaryFileService = temporaryFileService;
     this.exeggutorService     = exeggutorService;
     this.phaseManager         = phaseManager;
     this.modificationLoader   = modificationLoader;
     this.viewModel            = viewModel;
     this.leagueBuildUtilities = leagueBuildUtilities;
     this.modification         = modification;
 }
Esempio n. 15
0
 public PeriodicAnnouncerImpl(
     IThreadingProxy threadingProxy,
     IPofSerializer courierSerializer,
     ReadableCourierEndpoint localEndpoint,
     NetworkBroadcaster networkBroadcaster
     ) : this(
         threadingProxy.CreateCancellationTokenSource(),
         courierSerializer,
         localEndpoint,
         networkBroadcaster)
 {
 }
        /// <summary>
        /// Return an <see cref="IPofSerializer"/> that can be used to
        /// serialize and deserialize an object of the specified user type to
        /// and from a POF stream.
        /// </summary>
        /// <param name="typeId">
        /// The type identifier of the user type that can be serialized and
        /// deserialized using the returned <b>IPofSerializer</b>; must be
        /// non-negative.
        /// </param>
        /// <returns>
        /// An <b>IPofSerializer</b> for the specified user type.
        /// </returns>
        /// <exception cref="ArgumentException">
        /// If the specified user type is negative or unknown to this
        /// <b>IPofContext</b>.
        /// </exception>
        public virtual IPofSerializer GetPofSerializer(int typeId)
        {
            ValidateTypeId(typeId);

            IDictionary    serializerMap = m_serializerMap;
            IPofSerializer serializer    = serializerMap == null ? null : (IPofSerializer)serializerMap[typeId];

            if (serializer == null)
            {
                throw new ArgumentException("unknown user type: " + typeId);
            }
            return(serializer);
        }
 public ModificationImportController(IPofSerializer pofSerializer, string repositoriesDirectory, TemporaryFileService temporaryFileService, ExeggutorService exeggutorService, ModificationComponentFactory modificationComponentFactory, IFileSystemProxy fileSystemProxy, RiotSolutionLoader riotSolutionLoader, ModificationImportViewModelFactory modificationImportViewModelFactory, ObservableCollection<ModificationViewModel> modificationViewModels, ModificationLoader modificationLoader, LeagueBuildUtilities leagueBuildUtilities)
 {
     this.pofSerializer = pofSerializer;
      this.repositoriesDirectory = repositoriesDirectory;
      this.temporaryFileService = temporaryFileService;
      this.exeggutorService = exeggutorService;
      this.modificationComponentFactory = modificationComponentFactory;
      this.fileSystemProxy = fileSystemProxy;
      this.riotSolutionLoader = riotSolutionLoader;
      this.modificationImportViewModelFactory = modificationImportViewModelFactory;
      this.modificationViewModels = modificationViewModels;
      this.modificationLoader = modificationLoader;
      this.leagueBuildUtilities = leagueBuildUtilities;
 }
Esempio n. 18
0
 public ModificationImportController(IPofSerializer pofSerializer, string repositoriesDirectory, TemporaryFileService temporaryFileService, ExeggutorService exeggutorService, ModificationComponentFactory modificationComponentFactory, IFileSystemProxy fileSystemProxy, RiotSolutionLoader riotSolutionLoader, ModificationImportViewModelFactory modificationImportViewModelFactory, ObservableCollection <ModificationViewModel> modificationViewModels, ModificationLoader modificationLoader, LeagueBuildUtilities leagueBuildUtilities)
 {
     this.pofSerializer                      = pofSerializer;
     this.repositoriesDirectory              = repositoriesDirectory;
     this.temporaryFileService               = temporaryFileService;
     this.exeggutorService                   = exeggutorService;
     this.modificationComponentFactory       = modificationComponentFactory;
     this.fileSystemProxy                    = fileSystemProxy;
     this.riotSolutionLoader                 = riotSolutionLoader;
     this.modificationImportViewModelFactory = modificationImportViewModelFactory;
     this.modificationViewModels             = modificationViewModels;
     this.modificationLoader                 = modificationLoader;
     this.leagueBuildUtilities               = leagueBuildUtilities;
 }
Esempio n. 19
0
        public void TestDefaultConstructor()
        {
            ConfigurablePofContext ctx = new ConfigurablePofContext();
            IPofSerializer         ser = ctx.GetPofSerializer(14);

            Assert.AreEqual(typeof(PortableObjectSerializer), ser.GetType());

            ser = ctx.GetPofSerializer(0);
            Assert.AreEqual(typeof(ExceptionPofSerializer), ser.GetType());

            Type type = ctx.GetType(0);

            Assert.AreEqual(typeof(Exception), type);
            type = ctx.GetType(14);
            Assert.AreEqual(typeof(UUID), type);
            type = ctx.GetType(1201);
            Assert.AreEqual(typeof(Address), type);
        }
        /// <summary>
        /// Associate a user type with a type identifier and
        /// <see cref="IPofSerializer"/>.
        /// </summary>
        /// <param name="typeId">
        /// The type identifier of the specified user type; must be greater
        /// or equal to 0.
        /// </param>
        /// <param name="type">
        /// The user type to register with this PofContext; must not be
        /// <c>null</c>.
        /// </param>
        /// <param name="serializer">
        /// The <see cref="IPofSerializer"/> that will be used to serialize
        /// and deserialize objects of the specified type.
        /// </param>
        /// <exception cref="ArgumentException">
        /// On invalid type identifer, type, or <b>IPofSerializer</b>.
        /// </exception>
        public virtual void RegisterUserType(int typeId, Type type,
                                             IPofSerializer serializer)
        {
            ValidateTypeId(typeId);
            if (type == null)
            {
                throw new ArgumentNullException("Type cannot be null");
            }
            if (serializer == null)
            {
                throw new ArgumentNullException("POF serializer cannot be null");
            }

            IDictionary typeIdMap     = m_typeIdMap;
            IDictionary typeMap       = m_typeMap;
            IDictionary serializerMap = m_serializerMap;

            // add class-to-type identifier mapping
            if (typeIdMap == null)
            {
                m_typeIdMap = typeIdMap = new HashDictionary();
            }
            typeIdMap[type] = typeId;

            // add type identifier-to-class mapping
            if (typeMap == null)
            {
                m_typeMap = typeMap = new HashDictionary();
            }
            typeMap[typeId] = type;

            // add type identifier-to-serializer mapping
            if (serializerMap == null)
            {
                m_serializerMap = serializerMap = new HashDictionary();
            }
            serializerMap[typeId] = serializer;
        }
Esempio n. 21
0
 public PeerRegistryImpl(IPofSerializer courierSerializer, IConcurrentDictionary <Guid, RemoteCourierEndpoint> peerContextsById)
 {
     this.courierSerializer = courierSerializer;
     this.peerContextsById  = peerContextsById;
 }
 public NetworkBroadcasterImpl(ReadableCourierEndpoint localEndpoint, CourierNetworkContext networkContext, IPofSerializer pofSerializer)
 {
     this.localEndpoint  = localEndpoint;
     this.networkContext = networkContext;
     this.pofSerializer  = pofSerializer;
 }
Esempio n. 23
0
 public CourierMessageFactoryImpl(GuidProxy guidProxy, IPofSerializer pofSerializer)
 {
     this.guidProxy     = guidProxy;
     this.pofSerializer = pofSerializer;
 }
Esempio n. 24
0
 public PofStreamsFactoryImpl(IThreadingProxy threadingProxy, IStreamFactory streamFactory, IPofSerializer serializer)
 {
     this.threadingProxy = threadingProxy;
     this.streamFactory  = streamFactory;
     this.serializer     = serializer;
 }
Esempio n. 25
0
        public void TestConfigWithDefaultSerializer()
        {
            ConfigurablePofContext ctx = new ConfigurablePofContext("assembly://Coherence.Tests/Tangosol.Resources/s4hc-test-config-defaultserializer.xml");

            Assert.IsNotNull(ctx);

            IXmlElement config = ctx.Config;

            Assert.IsNotNull(config);

            // uses default serializer
            Address address         = new Address();
            string  addressTypeName = "Tangosol.Address";
            Type    addressType     = typeof(Address);

            int typeId = ctx.GetUserTypeIdentifier(addressType);

            Assert.AreEqual(typeId, 1201);
            string typeName = ctx.GetTypeName(typeId);

            Assert.AreEqual(typeName, addressTypeName);
            Type type = ctx.GetType(typeId);

            Assert.AreEqual(type, addressType);
            IPofSerializer serializer = ctx.GetPofSerializer(typeId);

            Assert.IsInstanceOf(typeof(DummyDefaultPofSerializer), serializer);
            Assert.IsTrue(ctx.IsUserType(address));

            // has its own serializer so default won't be used
            PortablePersonLite portablePersonLite         = new PortablePersonLite();
            string             portablePersonLiteTypeName = "Tangosol.PortablePersonLite";
            Type portablePersonLiteType = typeof(PortablePersonLite);

            typeId = ctx.GetUserTypeIdentifier(portablePersonLiteType);
            Assert.AreEqual(typeId, 1002);
            typeName = ctx.GetTypeName(typeId);
            Assert.AreEqual(typeName, portablePersonLiteTypeName);
            type = ctx.GetType(typeId);
            Assert.AreEqual(type, portablePersonLiteType);
            serializer = ctx.GetPofSerializer(typeId);
            Assert.IsInstanceOf(typeof(XmlPofSerializer), serializer);
            Assert.IsTrue(ctx.IsUserType(portablePersonLite));

            // is defined in included file with it's own default serializer
            // different from previous
            PortablePerson portablePerson         = new PortablePerson();
            string         portablePersonTypeName = "Tangosol.PortablePerson";
            Type           portablePersonType     = typeof(PortablePerson);

            typeId = ctx.GetUserTypeIdentifier(portablePersonType);
            Assert.AreEqual(typeId, 1005);
            typeName = ctx.GetTypeName(typeId);
            Assert.AreEqual(typeName, portablePersonTypeName);
            type = ctx.GetType(typeId);
            Assert.AreEqual(type, portablePersonType);
            serializer = ctx.GetPofSerializer(typeId);
            Assert.IsInstanceOf(typeof(BinaryPofSerializer), serializer);
            Assert.IsTrue(ctx.IsUserType(portablePerson));

            // does not have serializer defined and default is not specified
            // in the config, therefore will use PortableObjectSerializer
            serializer = ctx.GetPofSerializer(14); //UUID
            Assert.IsInstanceOf(typeof(PortableObjectSerializer), serializer);
        }
 public PofStreamWriterImpl(IPofSerializer serializer, IStream stream)
 {
     this.serializer = serializer;
     this.stream     = stream;
 }
Esempio n. 27
0
 public PeerRegistryImpl(IPofSerializer courierSerializer) : this(courierSerializer, new ConcurrentDictionary <Guid, RemoteCourierEndpoint>())
 {
 }
 public TrinketSpawnerImpl(IStreamFactory streamFactory, IPofSerializer pofSerializer, ExeggutorService exeggutorService)
 {
     this.streamFactory = streamFactory;
      this.pofSerializer = pofSerializer;
      this.exeggutorService = exeggutorService;
 }
 public CourierEndpointImpl(IPofSerializer pofSerializer, Guid identifier, string name)
     : this(pofSerializer, identifier, name, new ConcurrentDictionary <Guid, byte[]>())
 {
 }
 public TrinketSpawnerImpl(IStreamFactory streamFactory, IPofSerializer pofSerializer, ExeggutorService exeggutorService)
 {
     this.streamFactory    = streamFactory;
     this.pofSerializer    = pofSerializer;
     this.exeggutorService = exeggutorService;
 }
Esempio n. 31
0
 public PortableObjectBoxConverter(IStreamFactory streamFactory, IPofSerializer pofSerializer)
 {
     this.streamFactory = streamFactory;
     this.pofSerializer = pofSerializer;
 }
 public ReceivedMessageFactoryImpl(IPofSerializer pofSerializer)
 {
     this.pofSerializer = pofSerializer;
     this.receivedMessageFactoriesByPayloadType = new ConcurrentDictionary <Type, MethodInfo>();
 }