예제 #1
0
 /** Create instance of class */
 public PeerImpl(
     MutablePeerTableImpl mgr,
     int rating,
     URI remotePeer,
     String ip,
     String portRange,
     IMetaData metaData,
     Configuration config,
     Configuration peerConfig,
     ISessionFactory sessionFactory,
     IFsmFactory fsmFactory,
     ITransportLayerFactory trFactory,
     IMessageParser parser,
     INetwork nWork,
     IOverloadManager oManager,
     boolean attCnn,
     IConnection connection)
     throws InternalException, TransportException {
   super(
       mgr,
       rating,
       remotePeer,
       ip,
       portRange,
       metaData,
       config,
       peerConfig,
       fsmFactory,
       trFactory,
       parser,
       connection);
   // Create specific action context
   manager = mgr;
   isDuplicateProtection = manager.isDuplicateProtection();
   factory = sessionFactory;
   isAttemptConnection = attCnn;
   incConnections = manager.getIncConnections();
   predefinedPeerTable = manager.getPredefinedPeerTable();
   network = nWork;
   ovrManager = oManager;
   // Append fsm statistic
   if (fsm instanceof IStateMachine)
     statistic.appendCounter(((IStateMachine) fsm).getStatistic().getRecords());
 }
예제 #2
0
 protected void preProcessRequest(IMessage message) {
   if (isDuplicateProtection && message.isRequest())
     manager.saveToDuplicate(message.getDuplicationKey(), message);
 }