Пример #1
0
 /** Remove MBeans */
 public void destroy() {
   try {
     localDispatcher.destroy();
   } catch (JMException e) {
     error("Cannot unregister MBean: " + e, e);
   }
 }
Пример #2
0
  // Initialize this object;
  private void init(Configuration pConfig) {
    // Central objects
    converters = new Converters();
    initLimits(pConfig);

    // Create and remember request dispatchers
    localDispatcher = new LocalRequestDispatcher(converters, restrictor, pConfig, logHandler);
    ServerHandle serverHandle = localDispatcher.getServerInfo();
    requestDispatchers =
        createRequestDispatchers(
            pConfig.get(DISPATCHER_CLASSES), converters, serverHandle, restrictor);
    requestDispatchers.add(localDispatcher);

    // Backendstore for remembering agent state
    initStores(pConfig);
  }
Пример #3
0
  // init various application wide stores for handling history and debug output.
  private void initStores(Configuration pConfig) {
    int maxEntries = pConfig.getAsInt(HISTORY_MAX_ENTRIES);
    int maxDebugEntries = pConfig.getAsInt(DEBUG_MAX_ENTRIES);

    historyStore = new HistoryStore(maxEntries);
    debugStore = new DebugStore(maxDebugEntries, pConfig.getAsBoolean(DEBUG));

    try {
      localDispatcher.initMBeans(historyStore, debugStore);
    } catch (NotCompliantMBeanException e) {
      intError("Error registering config MBean: " + e, e);
    } catch (MBeanRegistrationException e) {
      intError("Cannot register MBean: " + e, e);
    } catch (MalformedObjectNameException e) {
      intError("Invalid name for config MBean: " + e, e);
    }
  }