IArtifactBuilder.java
01 /*
02  *
03  * Licensed to the Apache Software Foundation (ASF) under one
04  * or more contributor license agreements.  See the NOTICE file
05  * distributed with this work for additional information
06  * regarding copyright ownership.  The ASF licenses this file
07  * to you under the Apache License, Version 2.0 (the
08  * "License"); you may not use this file except in compliance
09  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  */
21 package org.apache.qpid.management.wsdm.capabilities;
22 
23 import javax.management.MBeanAttributeInfo;
24 import javax.management.MBeanOperationInfo;
25 import javax.management.ObjectName;
26 
27 import org.apache.muse.core.Environment;
28 
29 /**
30  * Defines behaviour needed by WS-DM artifact builders.
31  * Each concrete implementor must provide its own parser 
32  * implementation of the given JMX data.
33  * 
34  * @author Andrea Gazzarini
35  */
36 public interface IArtifactBuilder 
37 {  
38   /**
39    * The build process begin and the given parameter is the
40    * object name of the corresponding JMX entity.
41    * 
42    * @throws BuilderException when the initialization fails.
43    */
44   void begin(ObjectName objectName) throws BuilderException;
45   
46   /**
47    * Processes an attribute (its metadata) of the current MBean.
48    *  
49    * @param attributeMetadata the attribute metadata.
50    * @throws BuilderException when the builder cannot parse the given metadata.
51    */
52   void onAttribute(MBeanAttributeInfo attributeMetadata) throws BuilderException;
53   
54   /**
55    * Processes an operation (its metadata) of the current MBean.
56    *  
57    * @param operationMetadata the operation metadata.
58    * @throws BuilderException when the builder cannot parse the given metadata.
59    */
60   void onOperation(MBeanOperationInfo operationMetadata) throws BuilderException;
61   
62   /**
63    * Ends of the attributes section.
64    * 
65    * @throws BuilderException when the builder encounter a problem during this phase..
66    */
67   void endAttributes() throws BuilderException;
68 
69   /**
70    * Ends of the operations section.
71    * 
72    * @throws BuilderException when the builder encounter a problem during this phase..
73    */
74   void endOperations() throws BuilderException;
75   
76   /**
77    * Injects the adapter enviroment on this builder.
78    * 
79    * @param environment the adapter environment.
80    */
81   void setEnvironment(Environment environment);
82 }