Package freenet.client.events

Examples of freenet.client.events.SimpleEventProducer


public class FetchContextTest extends TestCase {
   
    public void testPersistence() throws IOException, StorageFormatException {
        FetchContext context =
            HighLevelSimpleClientImpl.makeDefaultFetchContext(Long.MAX_VALUE, Long.MAX_VALUE,
                    new ArrayBucketFactory(), new SimpleEventProducer());
        ArrayBucket bucket = new ArrayBucket();
        DataOutputStream dos = new DataOutputStream(bucket.getOutputStream());
        context.writeTo(dos);
        dos.close();
        assert(bucket.size() != 0);
View Full Code Here


       
    archiveManager = new ArchiveManager(MAX_ARCHIVE_HANDLERS, MAX_CACHED_ARCHIVE_DATA, MAX_ARCHIVED_FILE_SIZE, MAX_CACHED_ELEMENTS, tempBucketFactory);

    healingQueue = new SimpleHealingQueue(
        new InsertContext(
            0, 2, 0, 0, new SimpleEventProducer(),
            false, Node.FORK_ON_CACHEABLE_DEFAULT, false, Compressor.DEFAULT_COMPRESSORDESCRIPTOR, 0, 0, InsertContext.CompatibilityMode.COMPAT_DEFAULT), RequestStarter.PREFETCH_PRIORITY_CLASS, 512 /* FIXME make configurable */);

    PooledFileRandomAccessBufferFactory raff =
        new PooledFileRandomAccessBufferFactory(persistentFilenameGenerator, node.fastWeakRandom);
    persistentDiskChecker =
View Full Code Here

    public FetchContext getDefaultPersistentFetchContext() {
        return new FetchContext(defaultPersistentFetchContext, FetchContext.IDENTICAL_MASK);
    }
   
    public InsertContext getDefaultPersistentInsertContext() {
        return new InsertContext(defaultPersistentInsertContext, new SimpleEventProducer());
    }
View Full Code Here

   */
  public FetchContext(FetchContext ctx, int maskID, boolean keepProducer, BlockSet blocks) {
    if(keepProducer)
      this.eventProducer = ctx.eventProducer;
    else
      this.eventProducer = new SimpleEventProducer();
    hasOwnEventProducer = !keepProducer;
    this.ignoreTooManyPathComponents = ctx.ignoreTooManyPathComponents;
    if(blocks != null)
      this.blocks = blocks;
    else
View Full Code Here

            overrideMIME = s;
        cooldownRetries = dis.readInt();
        cooldownTime = dis.readLong();
        ignoreUSKDatehints = dis.readBoolean();
        hasOwnEventProducer = true;
        eventProducer = new SimpleEventProducer();
        blocks = null;
    }
View Full Code Here

    this.core = node;
    this.priorityClass = priorityClass;
    bucketFactory = bf;
    this.persistentFileTracker = node.persistentTempBucketFactory;
    random = r;
    this.eventProducer = new SimpleEventProducer();
    eventProducer.addEventListener(new EventLogger(LogLevel.MINOR, false));
    curMaxLength = Long.MAX_VALUE;
    curMaxTempLength = Long.MAX_VALUE;
    curMaxMetadataLength = 1024 * 1024;
    this.persistentBucketFactory = node.persistentTempBucketFactory;
View Full Code Here

    this.persistentBucketFactory = node.persistentTempBucketFactory;
    this.realTimeFlag = realTimeFlag;
  }

  public HighLevelSimpleClientImpl(HighLevelSimpleClientImpl hlsc) {
    this.eventProducer = new SimpleEventProducer();
    this.priorityClass = hlsc.priorityClass;
    this.bucketFactory = hlsc.bucketFactory;
    this.persistentBucketFactory = hlsc.persistentBucketFactory;
    this.persistentFileTracker = hlsc.persistentFileTracker;
    this.core = hlsc.core;
View Full Code Here

        fg = new FilenameGenerator(r, true, dir, "freenet-test");
        persistentFileTracker = new TrivialPersistentFileTracker(dir, fg);
        bigRAFFactory = new PooledFileRandomAccessBufferFactory(fg, r);
        smallBucketFactory = new ArrayBucketFactory();
        bigBucketFactory = new TempBucketFactory(executor, fg, 0, 0, r, false, 0, null);
        baseContext = HighLevelSimpleClientImpl.makeDefaultInsertContext(bigBucketFactory, new SimpleEventProducer());
        cryptoKey = new byte[32];
        r.nextBytes(cryptoKey);
        checker = new CRCChecksumChecker();
        memoryLimitedJobRunner = new MemoryLimitedJobRunner(9*1024*1024L, 20, executor);
        jobRunner = new DummyJobRunner(executor, null);
View Full Code Here

        Bucket copyBucket = m1.toBucket(smallBucketFactory);
        assertTrue(BucketTools.equalBuckets(metaBucket, copyBucket));
       
        MyFetchCallback fcb = new MyFetchCallback();
       
        FetchContext fctx = HighLevelSimpleClientImpl.makeDefaultFetchContext(size*2, size*2, smallBucketFactory, new SimpleEventProducer());
       
        SplitFileFetcherStorage fetcherStorage = new SplitFileFetcherStorage(m1, fcb, new ArrayList<COMPRESSOR_TYPE>(),
                new ClientMetadata(), false, cmode.code, fctx, false, salt, URI, URI, true, new byte[0],
                r, smallBucketFactory, smallRAFFactory, jobRunner, ticker, memoryLimitedJobRunner,
                checker, false, null, null, keys);
View Full Code Here

        Bucket copyBucket = m1.toBucket(smallBucketFactory);
        assertTrue(BucketTools.equalBuckets(metaBucket, copyBucket));
       
        MyFetchCallback fcb = new MyFetchCallback();
       
        FetchContext fctx = HighLevelSimpleClientImpl.makeDefaultFetchContext(size*2, size*2, smallBucketFactory, new SimpleEventProducer());
       
        short cmode = (short) context.getCompatibilityMode().ordinal();
       
        SplitFileFetcherStorage fetcherStorage = new SplitFileFetcherStorage(m1, fcb, new ArrayList<COMPRESSOR_TYPE>(),
                new ClientMetadata(), false, cmode, fctx, false, salt, URI, URI, true, new byte[0],
View Full Code Here

TOP

Related Classes of freenet.client.events.SimpleEventProducer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.