Package org.eclipse.jgit.transport

## Class PreReceiveHookChain

- java.lang.Object
- - org.eclipse.jgit.transport.PreReceiveHookChain

All Implemented Interfaces:
  `PreReceiveHook`

    public class PreReceiveHookChain
    extends Object
    implements PreReceiveHook

`PreReceiveHook` that delegates to a list of other hooks.

Hooks are run in the order passed to the constructor.

### Field Summary

### Fields inherited from interface org.eclipse.jgit.transport.PreReceiveHook

`NULL`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static PreReceiveHook` `newChain​(List<? extends PreReceiveHook> hooks)` Create a new hook chaining the given hooks together.
`void` `onPreReceive​(ReceivePack rp, Collection<ReceiveCommand> commands)` Invoked just before commands are executed.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### newChain

    public static PreReceiveHook newChain​(List<? extends PreReceiveHook> hooks)

Create a new hook chaining the given hooks together.

Parameters:
  `hooks` - hooks to execute, in order.
Returns:
  a new hook chain of the given hooks.

#### onPreReceive

    public void onPreReceive​(ReceivePack rp,
                             Collection<ReceiveCommand> commands)

Description copied from interface: `PreReceiveHook`
Invoked just before commands are executed.

See the class description for how this method can impact execution.

Specified by:
  `onPreReceive` in interface `PreReceiveHook`
Parameters:
  `rp` - the process handling the current receive. Hooks may obtain details about the destination repository through this handle.
  `commands` - unmodifiable set of valid commands still pending execution. May be the empty set.