예제 #1
0
 def __init__(self, **kwargs):
     config = _Config.from_dict(kwargs)
     self._config = config
     self._context = _ClientContext()
     client_id = HazelcastClient._CLIENT_ID.get_and_increment()
     self.name = self._create_client_name(client_id)
     self._reactor = AsyncoreReactor()
     self._serialization_service = SerializationServiceV1(config)
     self._near_cache_manager = NearCacheManager(
         config, self._serialization_service)
     self._internal_lifecycle_service = _InternalLifecycleService(config)
     self.lifecycle_service = LifecycleService(
         self._internal_lifecycle_service)
     self._invocation_service = InvocationService(self, config,
                                                  self._reactor)
     self._address_provider = self._create_address_provider()
     self._internal_partition_service = _InternalPartitionService(self)
     self.partition_service = PartitionService(
         self._internal_partition_service, self._serialization_service)
     self._internal_cluster_service = _InternalClusterService(self, config)
     self.cluster_service = ClusterService(self._internal_cluster_service)
     self._connection_manager = ConnectionManager(
         self,
         config,
         self._reactor,
         self._address_provider,
         self._internal_lifecycle_service,
         self._internal_partition_service,
         self._internal_cluster_service,
         self._invocation_service,
         self._near_cache_manager,
     )
     self._load_balancer = self._init_load_balancer(config)
     self._listener_service = ListenerService(self, config,
                                              self._connection_manager,
                                              self._invocation_service)
     self._proxy_manager = ProxyManager(self._context)
     self.cp_subsystem = CPSubsystem(self._context)
     self._proxy_session_manager = ProxySessionManager(self._context)
     self._transaction_manager = TransactionManager(self._context)
     self._lock_reference_id_generator = AtomicInteger(1)
     self._statistics = Statistics(
         self,
         config,
         self._reactor,
         self._connection_manager,
         self._invocation_service,
         self._near_cache_manager,
     )
     self._cluster_view_listener = ClusterViewListenerService(
         self,
         self._connection_manager,
         self._internal_partition_service,
         self._internal_cluster_service,
         self._invocation_service,
     )
     self._shutdown_lock = threading.RLock()
     self._init_context()
     self._start()
예제 #2
0
 def setUp(self):
     self.context = MagicMock()
     self.manager = ProxySessionManager(self.context)