01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: */package org.apache.geronimo.connector.deployment.jsr88;
17:
18: import org.apache.geronimo.xbeans.geronimo.GerAdminobjectInstanceType;
19: import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
20: import org.apache.xmlbeans.SchemaTypeLoader;
21: import javax.enterprise.deploy.model.DDBean;
22:
23: /**
24: * Represents /connector/adminobject/adminobject-instance in the
25: * Geronimo Connector deployment plan.
26: *
27: * @version $Rev: 476049 $ $Date: 2006-11-16 20:35:17 -0800 (Thu, 16 Nov 2006) $
28: */
29: public class AdminObjectInstance extends ConfigHolder {
30: private DDBean adminObject;
31:
32: public AdminObjectInstance() {
33: }
34:
35: public AdminObjectInstance(DDBean adminObject,
36: 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 adminObject,
49: GerAdminobjectInstanceType definition) {
50: this .adminObject = adminObject;
51: super .configure(adminObject, definition);
52: }
53:
54: protected GerConfigPropertySettingType createConfigProperty() {
55: return getAdminInstance().addNewConfigPropertySetting();
56: }
57:
58: protected GerConfigPropertySettingType[] getConfigProperties() {
59: return getAdminInstance().getConfigPropertySettingArray();
60: }
61:
62: protected void removeConfigProperty(int index) {
63: getAdminInstance().removeConfigPropertySetting(index);
64: }
65:
66: // ----------------------- JavaBean Properties for /adminobject-instance ----------------------
67:
68: public String getMessageDestinationName() {
69: return getAdminInstance().getMessageDestinationName();
70: }
71:
72: public void setMessageDestinationName(String name) {
73: String old = getMessageDestinationName();
74: getAdminInstance().setMessageDestinationName(name);
75: pcs.firePropertyChange("messageDestinationName", old, name);
76: }
77:
78: // ----------------------- End of JavaBean Properties ----------------------
79:
80: protected SchemaTypeLoader getSchemaTypeLoader() {
81: return Connector15DCBRoot.SCHEMA_TYPE_LOADER;
82: }
83: }
|