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.management.mbean;
018
019import org.apache.camel.CamelContext;
020import org.apache.camel.api.management.ManagedResource;
021import org.apache.camel.api.management.mbean.ManagedBeanIntrospectionMBean;
022import org.apache.camel.spi.BeanIntrospection;
023
024/**
025 *
026 */
027@ManagedResource(description = "Managed BeanIntrospection")
028public class ManagedBeanIntrospection extends ManagedService implements ManagedBeanIntrospectionMBean {
029
030    private final BeanIntrospection beanIntrospection;
031
032    public ManagedBeanIntrospection(CamelContext context, BeanIntrospection beanIntrospection) {
033        super(context, beanIntrospection);
034        this.beanIntrospection = beanIntrospection;
035    }
036
037    public BeanIntrospection getBeanIntrospection() {
038        return beanIntrospection;
039    }
040
041    @Override
042    public Long getInvokedCounter() {
043        return beanIntrospection.getInvokedCounter();
044    }
045
046    @Override
047    public Boolean isExtendedStatistics() {
048        return beanIntrospection.isExtendedStatistics();
049    }
050
051    @Override
052    public void setExtendedStatistics(Boolean extendedStatistics) {
053        beanIntrospection.setExtendedStatistics(extendedStatistics);
054    }
055
056    @Override
057    public void resetCounters() {
058        beanIntrospection.resetCounters();
059    }
060
061    @Override
062    public Long getCachedClasses() {
063        return beanIntrospection.getCachedClassesCounter();
064    }
065
066    @Override
067    public void clearCache() {
068        beanIntrospection.clearCache();
069    }
070}