KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > connector > deployment > jsr88 > AdminObjectInstance


1 /**
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.geronimo.connector.deployment.jsr88;
18
19 import org.apache.geronimo.xbeans.geronimo.GerAdminobjectInstanceType;
20 import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
21 import org.apache.xmlbeans.SchemaTypeLoader;
22 import javax.enterprise.deploy.model.DDBean JavaDoc;
23
24 /**
25  * Represents /connector/adminobject/adminobject-instance in the
26  * Geronimo Connector deployment plan.
27  *
28  * @version $Rev: 476049 $ $Date: 2006-11-16 23:35:17 -0500 (Thu, 16 Nov 2006) $
29  */

30 public class AdminObjectInstance extends ConfigHolder {
31     private DDBean JavaDoc adminObject;
32
33     public AdminObjectInstance() {
34     }
35
36     public AdminObjectInstance(DDBean JavaDoc adminObject, GerAdminobjectInstanceType instance) {
37         configure(adminObject, instance);
38     }
39
40     protected GerAdminobjectInstanceType getAdminInstance() {
41         return (GerAdminobjectInstanceType) getXmlObject();
42     }
43
44     public void reconfigure() {
45         configure(adminObject, getAdminInstance());
46     }
47
48     void configure(DDBean JavaDoc adminObject, GerAdminobjectInstanceType definition) {
49         this.adminObject = adminObject;
50         super.configure(adminObject, definition);
51     }
52
53     protected GerConfigPropertySettingType createConfigProperty() {
54         return getAdminInstance().addNewConfigPropertySetting();
55     }
56
57     protected GerConfigPropertySettingType[] getConfigProperties() {
58         return getAdminInstance().getConfigPropertySettingArray();
59     }
60
61     protected void removeConfigProperty(int index) {
62         getAdminInstance().removeConfigPropertySetting(index);
63     }
64
65     // ----------------------- JavaBean Properties for /adminobject-instance ----------------------
66

67     public String JavaDoc getMessageDestinationName() {
68         return getAdminInstance().getMessageDestinationName();
69     }
70
71     public void setMessageDestinationName(String JavaDoc name) {
72         String JavaDoc old = getMessageDestinationName();
73         getAdminInstance().setMessageDestinationName(name);
74         pcs.firePropertyChange("messageDestinationName", old, name);
75     }
76
77     // ----------------------- End of JavaBean Properties ----------------------
78

79     protected SchemaTypeLoader getSchemaTypeLoader() {
80         return Connector15DCBRoot.SCHEMA_TYPE_LOADER;
81     }
82 }
83
Popular Tags