  The gravitational field in a spatially finite region is described as a
microcanonical system. The density of states $\nu$ is expressed formally as a
functional integral over Lorentzian metrics and is a functional of the
geometrical boundary data that are fixed in the corresponding action. These
boundary data are the thermodynamical extensive variables, including the energy
and angular momentum of the system. When the boundary data are chosen such that
the system is described semiclassically by {\it any} real stationary
axisymmetric black hole, then in this same approximation $\ln\nu$ is shown to
equal 1/4 the area of the black hole event horizon. The canonical and grand
canonical partition functions are obtained by integral transforms of $\nu$ that
lead to "imaginary time" functional integrals. A general form of the first law
of thermodynamics for stationary black holes is derived. For the simpler case
of nonrelativistic mechanics, the density of states is expressed as a real-time
functional integral and then used to deduce Feynman's imaginary-time functional
integral for the canonical partition function.
