In many statistical mechanics books, notably Landau and Lifschitz' volume in the course on theoretical physics, the quantities central to statistical mechanics such as entropy are defined in terms of phase space densities. This is because (classically) particles in the real world can be described in terms of $n$ coordinates and their corresponding momenta. Also, in order to derive the Gibbs distribution, L&L argue that a mechanical system has only seven independent additive conserved quantities.
However, many statistical mechanics models (such as spin models) are not formulated in terms of phase space and Hamiltonian mechanics at all. One still wants to be able to talk about entropy, probability distributions, etc. when discussing these models. Can the phase space formulation be generalized to systems that are not 'particles in a box' but can have arbitrary configurations and energies?