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.commons.modeler.modules; 018 019 import java.util.List; 020 021 022 /** 023 * This mbean will load an extended mlet file ( similar in syntax with jboss ). 024 * It'll keep track of all attribute changes and update the file when attributes 025 * change. 026 */ 027 public interface MbeansSourceMBean 028 { 029 /** Set the source to be used to load the mbeans 030 * 031 * @param source File or URL 032 */ 033 public void setSource( Object source ); 034 035 public Object getSource(); 036 037 /** Return the list of loaded mbeans names 038 * 039 * @return List of ObjectName 040 */ 041 public List getMBeans(); 042 043 /** Load the mbeans from the source. Called automatically on init() 044 * 045 * @throws Exception 046 */ 047 public void load() throws Exception; 048 049 /** Call the init method on all mbeans. Will call load if not done already 050 * 051 * @throws Exception 052 */ 053 public void init() throws Exception; 054 055 /** Save the file. 056 */ 057 public void save(); 058 }