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 */ 017 package org.apache.camel.spi; 018 019 import java.util.concurrent.ThreadPoolExecutor; 020 import javax.management.MalformedObjectNameException; 021 import javax.management.ObjectName; 022 023 import org.apache.camel.CamelContext; 024 import org.apache.camel.Component; 025 import org.apache.camel.Consumer; 026 import org.apache.camel.Endpoint; 027 import org.apache.camel.ErrorHandlerFactory; 028 import org.apache.camel.NamedNode; 029 import org.apache.camel.Processor; 030 import org.apache.camel.Producer; 031 import org.apache.camel.Route; 032 import org.apache.camel.Service; 033 034 /** 035 * Strategy for computing {@link ObjectName} names for the various beans that Camel register for management. 036 * 037 * @version 038 */ 039 public interface ManagementNamingStrategy { 040 041 ObjectName getObjectNameForCamelContext(String managementName, String name) throws MalformedObjectNameException; 042 043 ObjectName getObjectNameForCamelContext(CamelContext context) throws MalformedObjectNameException; 044 045 ObjectName getObjectNameForComponent(Component component, String name) throws MalformedObjectNameException; 046 047 ObjectName getObjectNameForEndpoint(Endpoint endpoint) throws MalformedObjectNameException; 048 049 ObjectName getObjectNameForErrorHandler(RouteContext routeContext, Processor errorHandler, ErrorHandlerFactory builder) throws MalformedObjectNameException; 050 051 ObjectName getObjectNameForProcessor(CamelContext context, Processor processor, NamedNode definition) throws MalformedObjectNameException; 052 053 ObjectName getObjectNameForRoute(Route route) throws MalformedObjectNameException; 054 055 ObjectName getObjectNameForConsumer(CamelContext context, Consumer consumer) throws MalformedObjectNameException; 056 057 ObjectName getObjectNameForProducer(CamelContext context, Producer producer) throws MalformedObjectNameException; 058 059 ObjectName getObjectNameForTracer(CamelContext context, InterceptStrategy tracer) throws MalformedObjectNameException; 060 061 ObjectName getObjectNameForService(CamelContext context, Service service) throws MalformedObjectNameException; 062 063 ObjectName getObjectNameForThreadPool(CamelContext context, ThreadPoolExecutor threadPool, String id, String sourceId) throws MalformedObjectNameException; 064 065 ObjectName getObjectNameForEventNotifier(CamelContext context, EventNotifier eventNotifier) throws MalformedObjectNameException; 066 }