by using the DefaultContainerFactory class. The advantage is that you can instantiate the container by name and thus your code can be generic which is nice if you plan to run the same code with different containers. For example, to instantiate a Resin 3.x installed local container: