/** * Reconfigure gravity with the new supplied configuration (after reloading granite-config.xml). * <br><br> * Only these configuration options are taken into account when reconfiguring Gravity: * <ul> * <li>channelIdleTimeoutMillis</li> * <li>longPollingTimeout</li> * <li>retryOnError</li> * <li>maxMessagesQueuedPerChannel</li> * <li>corePoolSize</li> * <li>maximumPoolSize</li> * <li>keepAliveTimeMillis</li> * </ul> * * @param context the ServletContext where the gravity instance is registered. * @param gravityConfig the new (reloaded) GravityConfig. */ public static void reconfigure(ServletContext context, GravityConfig gravityConfig) { synchronized (context) { Gravity gravity = getGravity(context); gravity.reconfigure(gravityConfig, ServletGraniteConfig.getConfig(context)); } }
public static void unregisterMBeans(ServletContext context) { String appName = ServletGraniteConfig.getConfig(context).getMBeanContextName(); try { ObjectName name = new ObjectName("org.graniteds:type=GraniteDS,app=" + appName); log.info("Unregistering MBean: %s", name); MBeanServerLocator.getInstance().unregister(name); } catch (Exception e) { log.error(e, "Could not unregister GraniteDS MBean for context: %s", appName); } } }
public static void registerMBeans(ServletContext context, ServletGraniteConfig gConfig, ServletServicesConfig sConfig) { String appName = ServletGraniteConfig.getConfig(context).getMBeanContextName(); try { ObjectName name = new ObjectName("org.graniteds:type=GraniteDS,app=" + appName); log.info("Registering MBean: %s", name); OpenMBean mBean = OpenMBean.createMBean(gConfig); MBeanServerLocator.getInstance().register(mBean, name); } catch (Exception e) { log.error(e, "Could not register GraniteDS MBean for context: %s", appName); } }