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; 033 034/** 035 * Strategy for computing {@link ObjectName} names for the various beans that Camel register for management. 036 * 037 * @version 038 */ 039public 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 getObjectNameForDataFormat(CamelContext context, DataFormat endpoint) throws MalformedObjectNameException; 050 051 ObjectName getObjectNameForErrorHandler(RouteContext routeContext, Processor errorHandler, ErrorHandlerFactory builder) throws MalformedObjectNameException; 052 053 ObjectName getObjectNameForProcessor(CamelContext context, Processor processor, NamedNode definition) throws MalformedObjectNameException; 054 055 ObjectName getObjectNameForRoute(Route route) throws MalformedObjectNameException; 056 057 ObjectName getObjectNameForConsumer(CamelContext context, Consumer consumer) throws MalformedObjectNameException; 058 059 ObjectName getObjectNameForProducer(CamelContext context, Producer producer) throws MalformedObjectNameException; 060 061 ObjectName getObjectNameForTracer(CamelContext context, InterceptStrategy tracer) throws MalformedObjectNameException; 062 063 ObjectName getObjectNameForService(CamelContext context, Service service) throws MalformedObjectNameException; 064 065 ObjectName getObjectNameForThreadPool(CamelContext context, ThreadPoolExecutor threadPool, String id, String sourceId) throws MalformedObjectNameException; 066 067 ObjectName getObjectNameForEventNotifier(CamelContext context, EventNotifier eventNotifier) throws MalformedObjectNameException; 068}