All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ehcache.management.ManagementRegistry Maven / Gradle / Ivy

There is a newer version: 3.10.8
Show newest version
/*
 * Copyright Terracotta, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.ehcache.management;

import org.ehcache.spi.service.Service;

import java.util.Collection;
import java.util.Map;

/**
 * Repository of objects exposing capabilities via the
 * management and monitoring facilities.
 *
 * @author Ludovic Orban
 */
public interface ManagementRegistry extends Service {

  /**
   * Register an object in the management registry.
   *
   * @param managedType the managed object's class.
   * @param managedObject  the managed object.
   * @param  the type.
   */
   void register(Class managedType, T managedObject);

  /**
   * Unregister an object from the management registry.
   *
   * @param managedType the managed object's class.
   * @param managedObject  the managed object.
   * @param  the type.
   */
   void unregister(Class managedType, T managedObject);

  /**
   * Get the management capabilities of the registered objects.
   *
   * @param  the capability type.
   * @return a collection of capabilities.
   */
   Collection capabilities();

  /**
   * Get the management contexts required to make use of the
   * registered objects' capabilities.
   *
   * @param  the context type.
   * @return a collection of contexts.
   */
   Collection contexts();

  /**
   * Collect statistics from a managed object's capability.
   *
   * @param context the capability's context.
   * @param capabilityName the capability name.
   * @param statisticNames the statistic names.
   * @param  the statistics' type.
   * @return a collection of statistics.
   */
   Collection collectStatistics(Map context, String capabilityName, String... statisticNames);

  /**
   * Call an action of a managed object's capability.
   *
   * @param context the capability's context.
   * @param capabilityName the capability name.
   * @param methodName the action's method name.
   * @param argClassNames the action method's argument class names.
   * @param args the action method's arguments.
   * @param  the returned type.
   * @return the action method's return value.
   */
   T callAction(Map context, String capabilityName, String methodName, String[] argClassNames, Object[] args);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy