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;
020
021import javax.management.MalformedObjectNameException;
022import javax.management.ObjectName;
023
024import org.apache.camel.CamelContext;
025import org.apache.camel.Component;
026import org.apache.camel.Consumer;
027import org.apache.camel.Endpoint;
028import org.apache.camel.ErrorHandlerFactory;
029import org.apache.camel.NamedNode;
030import org.apache.camel.Processor;
031import org.apache.camel.Producer;
032import org.apache.camel.Route;
033import org.apache.camel.Service;
034import org.apache.camel.cluster.CamelClusterService;
035
036/**
037 * Strategy for computing {@link ObjectName} names for the various beans that Camel register for management.
038 */
039public interface ManagementObjectNameStrategy {
040
041    ObjectName getObjectName(Object managedObject) throws MalformedObjectNameException;
042
043    ObjectName getObjectNameForCamelContext(String managementName, String name) throws MalformedObjectNameException;
044
045    ObjectName getObjectNameForCamelHealth(CamelContext context) throws MalformedObjectNameException;
046
047    ObjectName getObjectNameForCamelContext(CamelContext context) throws MalformedObjectNameException;
048
049    ObjectName getObjectNameForRouteController(CamelContext context) throws MalformedObjectNameException;
050
051    ObjectName getObjectNameForComponent(Component component, String name) throws MalformedObjectNameException;
052
053    ObjectName getObjectNameForEndpoint(Endpoint endpoint) throws MalformedObjectNameException;
054
055    ObjectName getObjectNameForDataFormat(CamelContext context, DataFormat endpoint) throws MalformedObjectNameException;
056
057    ObjectName getObjectNameForErrorHandler(RouteContext routeContext, Processor errorHandler, ErrorHandlerFactory builder) throws MalformedObjectNameException;
058
059    ObjectName getObjectNameForProcessor(CamelContext context, Processor processor, NamedNode definition) throws MalformedObjectNameException;
060
061    ObjectName getObjectNameForStep(CamelContext context, Processor processor, NamedNode definition) throws MalformedObjectNameException;
062
063    ObjectName getObjectNameForRoute(Route route) throws MalformedObjectNameException;
064
065    ObjectName getObjectNameForConsumer(CamelContext context, Consumer consumer) throws MalformedObjectNameException;
066
067    ObjectName getObjectNameForProducer(CamelContext context, Producer producer) throws MalformedObjectNameException;
068
069    ObjectName getObjectNameForTracer(CamelContext context, Service tracer) throws MalformedObjectNameException;
070
071    ObjectName getObjectNameForService(CamelContext context, Service service) throws MalformedObjectNameException;
072
073    ObjectName getObjectNameForClusterService(CamelContext context, CamelClusterService service) throws MalformedObjectNameException;
074
075    ObjectName getObjectNameForThreadPool(CamelContext context, ThreadPoolExecutor threadPool, String id, String sourceId) throws MalformedObjectNameException;
076
077    ObjectName getObjectNameForEventNotifier(CamelContext context, EventNotifier eventNotifier) throws MalformedObjectNameException;
078}