001/**
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.camel.spi;
018
019import java.util.concurrent.ThreadPoolExecutor;
020import javax.management.MalformedObjectNameException;
021import javax.management.ObjectName;
022
023import org.apache.camel.CamelContext;
024import org.apache.camel.Component;
025import org.apache.camel.Consumer;
026import org.apache.camel.Endpoint;
027import org.apache.camel.ErrorHandlerFactory;
028import org.apache.camel.NamedNode;
029import org.apache.camel.Processor;
030import org.apache.camel.Producer;
031import org.apache.camel.Route;
032import org.apache.camel.Service;
033import org.apache.camel.cluster.CamelClusterService;
034
035/**
036 * Strategy for computing {@link ObjectName} names for the various beans that Camel register for management.
037 *
038 * @version 
039 */
040public interface ManagementNamingStrategy {
041
042    // TODO: Should be renamed to ManagementObjectNameStrategy
043
044    ObjectName getObjectNameForCamelContext(String managementName, String name) throws MalformedObjectNameException;
045
046    ObjectName getObjectNameForCamelHealth(CamelContext context) throws MalformedObjectNameException;
047
048    ObjectName getObjectNameForCamelContext(CamelContext context) throws MalformedObjectNameException;
049
050    ObjectName getObjectNameForRouteController(CamelContext context) throws MalformedObjectNameException;
051
052    ObjectName getObjectNameForComponent(Component component, String name) throws MalformedObjectNameException;
053
054    ObjectName getObjectNameForEndpoint(Endpoint endpoint) throws MalformedObjectNameException;
055
056    ObjectName getObjectNameForDataFormat(CamelContext context, DataFormat endpoint) throws MalformedObjectNameException;
057
058    ObjectName getObjectNameForErrorHandler(RouteContext routeContext, Processor errorHandler, ErrorHandlerFactory builder) throws MalformedObjectNameException;
059
060    ObjectName getObjectNameForProcessor(CamelContext context, Processor processor, NamedNode definition) throws MalformedObjectNameException;
061
062    ObjectName getObjectNameForRoute(Route route) throws MalformedObjectNameException;
063
064    ObjectName getObjectNameForConsumer(CamelContext context, Consumer consumer) throws MalformedObjectNameException;
065
066    ObjectName getObjectNameForProducer(CamelContext context, Producer producer) throws MalformedObjectNameException;
067
068    ObjectName getObjectNameForTracer(CamelContext context, InterceptStrategy tracer) throws MalformedObjectNameException;
069
070    ObjectName getObjectNameForService(CamelContext context, Service service) throws MalformedObjectNameException;
071
072    ObjectName getObjectNameForClusterService(CamelContext context, CamelClusterService service) throws MalformedObjectNameException;
073
074    ObjectName getObjectNameForThreadPool(CamelContext context, ThreadPoolExecutor threadPool, String id, String sourceId) throws MalformedObjectNameException;
075
076    ObjectName getObjectNameForEventNotifier(CamelContext context, EventNotifier eventNotifier) throws MalformedObjectNameException;
077}