The Cocoon Bean provides a Java programmatic interface for embedding Cocoon into other applications.
At present, the bean is mainly used for offline page generation. However, there is no reason why it should only be used in offline applications.
An example of an application that uses the bean is the Cocoon Command Line Interface (CLI). To find more about using the bean, look at the code for the CLI, which can be found in the Cocoon codebase in src/java, in the class org.apache.cocoon.Main.