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.naming.deployment.jsr88;
17:
18: import org.apache.geronimo.xbeans.geronimo.naming.GerEjbLocalRefType;
19:
20: /**
21: * Represents an element of the ejb-local-refType in a Geronimo deployment
22: * plan.
23: * <p>
24: * Has 3 JavaBean Properties <br />
25: * - refName (type String) <br />
26: * - pattern (type Pattern) <br />
27: * - ejbLink (type String) </p>
28: *
29: * @version $Rev: 476049 $ $Date: 2006-11-16 20:35:17 -0800 (Thu, 16 Nov 2006) $
30: */
31: public class EjbLocalRef extends HasPattern {
32: public EjbLocalRef() {
33: super (null);
34: }
35:
36: public EjbLocalRef(GerEjbLocalRefType xmlObject) {
37: super (xmlObject);
38: }
39:
40: public void setRefName(String name) {
41: String old = getEjbLocalRef().getRefName();
42: getEjbLocalRef().setRefName(name);
43: pcs.firePropertyChange("refName", old, name);
44: }
45:
46: public String getRefName() {
47: return getEjbLocalRef().getRefName();
48: }
49:
50: public String getEjbLink() {
51: return getEjbLocalRef().getEjbLink();
52: }
53:
54: public void setEjbLink(String link) {
55: GerEjbLocalRefType ref = getEjbLocalRef();
56: if (link != null && ref.isSetPattern()) {
57: clearPatternFromChoice();
58: }
59: String old = getEjbLink();
60: ref.setEjbLink(link);
61: pcs.firePropertyChange("ejbLink", old, link);
62: }
63:
64: protected void clearNonPatternFromChoice() {
65: GerEjbLocalRefType ref = getEjbLocalRef();
66: if (ref.isSetEjbLink()) {
67: String temp = ref.getEjbLink();
68: ref.unsetEjbLink();
69: pcs.firePropertyChange("ejbLink", temp, null);
70: }
71: // todo: clear CORBA property
72: }
73:
74: // todo: getter and setter for CORBA property
75:
76: protected GerEjbLocalRefType getEjbLocalRef() {
77: return (GerEjbLocalRefType) getXmlObject();
78: }
79:
80: public void configure(GerEjbLocalRefType xml) {
81: setXmlObject(xml);
82: }
83: }
|