public static BundleServerPluginContainer getPluginContainer() {
BundleServerPluginContainer pc;
try {
ServerPluginServiceMBean mbean = LookupUtil.getServerPluginService();
if (!mbean.isMasterPluginContainerStarted()) {
throw new IllegalStateException("The master plugin container is not started!");
}
MasterServerPluginContainer master = mbean.getMasterPluginContainer();
pc = master.getPluginContainerByClass(BundleServerPluginContainer.class);
} catch (IllegalStateException ise) {
throw ise;
} catch (Exception e) {
throw new IllegalStateException("Cannot obtain the Bundle plugin container!", e);