Ejemplo n.º 1
0
    public static IPool<DrainedTableData> makeDrainedTableDataPool(
        final PoolOptions poolOptions, final int maxSize) {
      IObjectDefinition<DrainedTableData> defn =
          new IObjectDefinition<DrainedTableData>() {
            @Override
            public Class<DrainedTableData> objectClass() {
              return DrainedTableData.class;
            }

            @Override
            public DrainedTableData createBlank() {
              return new DrainedTableData(maxSize);
            }

            @Override
            public void clean(DrainedTableData oldObject) {
              oldObject.clean();
            }

            @Override
            public String toString() {
              return "[ObjectDefn/DrainedTableData]";
            }
          };
      IPool<DrainedTableData> result =
          new Pool<DrainedTableData>(IPool.Utils.findThinInterface(poolOptions, defn));
      result.prepopulate();
      return result;
    }
Ejemplo n.º 2
0
    public static IPool<DrainedLine> makeDrainedLinePool(PoolOptions poolOptions) {
      IObjectDefinition<DrainedLine> defn =
          new IObjectDefinition<DrainedLine>() {
            @Override
            public Class<DrainedLine> objectClass() {
              return DrainedLine.class;
            }

            @Override
            public DrainedLine createBlank() {
              return new DrainedLine();
            }

            @Override
            public void clean(DrainedLine oldObject) {
              oldObject.clean();
            }

            @Override
            public String toString() {
              return "[ObjectDefn/DrainedLine]";
            }
          };
      IPool<DrainedLine> result =
          new Pool<DrainedLine>(IPool.Utils.findThinInterface(poolOptions, defn));
      result.prepopulate();
      return result;
    }