示例#1
0
 public NetworkedServerFactory(LifeSupport life, ProtocolServerFactory protocolServerFactory, TimeoutStrategy timeoutStrategy, LogProvider logProvider, ObjectInputStreamFactory objectInputStreamFactory, ObjectOutputStreamFactory objectOutputStreamFactory, NetworkReceiver.Monitor networkReceiverMonitor, NetworkSender.Monitor networkSenderMonitor, NamedThreadFactory.Monitor namedThreadFactoryMonitor)
 {
     this._life = life;
     this._protocolServerFactory     = protocolServerFactory;
     this._timeoutStrategy           = timeoutStrategy;
     this._networkReceiverMonitor    = networkReceiverMonitor;
     this._networkSenderMonitor      = networkSenderMonitor;
     this._logProvider               = logProvider;
     this._objectInputStreamFactory  = objectInputStreamFactory;
     this._objectOutputStreamFactory = objectOutputStreamFactory;
     this._namedThreadFactoryMonitor = namedThreadFactoryMonitor;
 }
示例#2
0
        public override ProtocolServer NewProtocolServer(InstanceId me, TimeoutStrategy timeoutStrategy, MessageSource input, MessageSender output, AcceptorInstanceStore acceptorInstanceStore, ElectionCredentialsProvider electionCredentialsProvider, Executor stateMachineExecutor, ObjectInputStreamFactory objectInputStreamFactory, ObjectOutputStreamFactory objectOutputStreamFactory, Config config)
        {
            DelayedDirectExecutor executor = new DelayedDirectExecutor(_logging);

            // Create state machines
            Timeouts timeouts = new Timeouts(timeoutStrategy);

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.cluster.protocol.atomicbroadcast.multipaxos.context.MultiPaxosContext context = new org.neo4j.cluster.protocol.atomicbroadcast.multipaxos.context.MultiPaxosContext(me, org.neo4j.helpers.collection.Iterables.iterable(new org.neo4j.cluster.protocol.election.ElectionRole(org.neo4j.cluster.protocol.cluster.ClusterConfiguration.COORDINATOR)), new org.neo4j.cluster.protocol.cluster.ClusterConfiguration(initialConfig.getName(), logging, initialConfig.getMemberURIs()), executor, logging, objectInputStreamFactory, objectOutputStreamFactory, acceptorInstanceStore, timeouts, electionCredentialsProvider, config);
            MultiPaxosContext context = new MultiPaxosContext(me, Iterables.iterable(new ElectionRole(ClusterConfiguration.COORDINATOR)), new ClusterConfiguration(_initialConfig.Name, _logging, _initialConfig.MemberURIs), executor, _logging, objectInputStreamFactory, objectOutputStreamFactory, acceptorInstanceStore, timeouts, electionCredentialsProvider, config);

            SnapshotContext snapshotContext = new SnapshotContext(context.ClusterContext, context.LearnerContext);

            return(NewProtocolServer(me, input, output, stateMachineExecutor, executor, timeouts, context, snapshotContext));
        }