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.GerEjbRefType;
19:
20: /**
21: * Represents an element of the ejb-refType in a Geronimo deployment plan.
22: * <p>
23: * Has 4 JavaBean Properties <br />
24: * - refName (type String) <br />
25: * - pattern (type Pattern) <br />
26: * - corbaNamingGroup (type ???) <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 EjbRef extends HasPattern {
32: public EjbRef() {
33: super (null);
34: }
35:
36: public EjbRef(GerEjbRefType xmlObject) {
37: super (xmlObject);
38: }
39:
40: public void setRefName(String name) {
41: String old = getEjbRef().getRefName();
42: getEjbRef().setRefName(name);
43: pcs.firePropertyChange("refName", old, name);
44: }
45:
46: public String getRefName() {
47: return getEjbRef().getRefName();
48: }
49:
50: public String getEjbLink() {
51: return getEjbRef().getEjbLink();
52: }
53:
54: public void setEjbLink(String link) {
55: GerEjbRefType ref = getEjbRef();
56: if (link != null) {
57: if (ref.isSetPattern()) {
58: clearPatternFromChoice();
59: }
60: // todo: clear CORBA property
61: }
62: String old = getEjbLink();
63: ref.setEjbLink(link);
64: pcs.firePropertyChange("ejbLink", old, link);
65: }
66:
67: protected void clearNonPatternFromChoice() {
68: GerEjbRefType ref = getEjbRef();
69: if (ref.isSetEjbLink()) {
70: String temp = ref.getEjbLink();
71: ref.unsetEjbLink();
72: pcs.firePropertyChange("ejbLink", temp, null);
73: }
74: // todo: clear CORBA property
75: }
76:
77: // todo: getter and setter for CORBA property
78:
79: protected GerEjbRefType getEjbRef() {
80: return (GerEjbRefType) getXmlObject();
81: }
82:
83: public void configure(GerEjbRefType xml) {
84: setXmlObject(xml);
85: }
86: }
|