/*
 * Copyright (C) 2012, Google Inc. and others
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Distribution License v. 1.0 which is available at
 * https://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

package org.eclipse.jgit.internal.storage.dfs;

import org.eclipse.jgit.events.RepositoryEvent;

Describes the DfsPackFile just before its index is loaded. Currently, DfsPackFile directly dispatches the event on Repository.getGlobalListenerList. Which means the call to RepositoryEvent<BeforeDfsPackIndexLoadedListener>.getRepository will always return null.
/** * Describes the {@link org.eclipse.jgit.internal.storage.dfs.DfsPackFile} just * before its index is loaded. Currently, DfsPackFile directly dispatches the * event on {@link org.eclipse.jgit.lib.Repository#getGlobalListenerList}. Which * means the call to {@link #getRepository} will always return null. */
public class BeforeDfsPackIndexLoadedEvent extends RepositoryEvent<BeforeDfsPackIndexLoadedListener> { private final DfsPackFile pack;
A new event triggered before a PackFile index is loaded.
Params:
  • pack – the pack
/** * A new event triggered before a PackFile index is loaded. * * @param pack * the pack */
public BeforeDfsPackIndexLoadedEvent(DfsPackFile pack) { this.pack = pack; }
Get the PackFile containing the index that will be loaded.
Returns:the PackFile containing the index that will be loaded.
/** * Get the PackFile containing the index that will be loaded. * * @return the PackFile containing the index that will be loaded. */
public DfsPackFile getPackFile() { return pack; }
{@inheritDoc}
/** {@inheritDoc} */
@Override public Class<BeforeDfsPackIndexLoadedListener> getListenerType() { return BeforeDfsPackIndexLoadedListener.class; }
{@inheritDoc}
/** {@inheritDoc} */
@Override public void dispatch(BeforeDfsPackIndexLoadedListener listener) { listener.onBeforeDfsPackIndexLoaded(this); } }