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 javax.management.MalformedObjectNameException;
020    import javax.management.ObjectName;
021    
022    import org.apache.camel.CamelContext;
023    import org.apache.camel.Component;
024    import org.apache.camel.Consumer;
025    import org.apache.camel.Endpoint;
026    import org.apache.camel.Processor;
027    import org.apache.camel.Producer;
028    import org.apache.camel.Route;
029    import org.apache.camel.Service;
030    import org.apache.camel.builder.ErrorHandlerBuilder;
031    import org.apache.camel.model.ProcessorDefinition;
032    
033    /**
034     * Strategy for computing {@link ObjectName} names for the various beans that Camel register for management.
035     *
036     * @version $Revision: 835531 $
037     */
038    public interface ManagementNamingStrategy {
039    
040        ObjectName getObjectNameForCamelContext(CamelContext context) throws MalformedObjectNameException;
041    
042        ObjectName getObjectNameForComponent(Component component, String name) throws MalformedObjectNameException;
043    
044        ObjectName getObjectNameForEndpoint(Endpoint endpoint) throws MalformedObjectNameException;
045    
046        ObjectName getObjectNameForErrorHandler(RouteContext routeContext, Processor errorHandler, ErrorHandlerBuilder builder) throws MalformedObjectNameException;
047    
048        ObjectName getObjectNameForProcessor(CamelContext context, Processor processor, ProcessorDefinition<?> definition) throws MalformedObjectNameException;
049    
050        ObjectName getObjectNameForRoute(Route route) throws MalformedObjectNameException;
051    
052        ObjectName getObjectNameForConsumer(CamelContext context, Consumer consumer) throws MalformedObjectNameException;
053    
054        ObjectName getObjectNameForProducer(CamelContext context, Producer producer) throws MalformedObjectNameException;
055    
056        ObjectName getObjectNameForTracer(CamelContext context, InterceptStrategy tracer) throws MalformedObjectNameException;
057    
058        ObjectName getObjectNameForService(CamelContext context, Service service) throws MalformedObjectNameException;
059    }