KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > naming > deployment > jsr88 > GBeanLocator


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.naming.deployment.jsr88;
18
19 import org.apache.geronimo.xbeans.geronimo.naming.GerGbeanLocatorType;
20
21 /**
22  * Represents an element of the gbean-locatorType in a Geronimo
23  * deployment plan.
24  * <p>
25  * Has 2 JavaBean Properties <br />
26  * - GBeanLink (type String) <br />
27  * - pattern (type Pattern) </p>
28  *
29  * @version $Rev: 484989 $ $Date: 2006-12-09 09:54:26 -0500 (Sat, 09 Dec 2006) $
30  */

31 public class GBeanLocator extends HasPattern {
32     public GBeanLocator() {
33         super(null);
34     }
35
36     public GBeanLocator(GerGbeanLocatorType xmlObject) {
37         super(xmlObject);
38     }
39
40     protected GerGbeanLocatorType getGBeanLocator() {
41         return (GerGbeanLocatorType) getXmlObject();
42     }
43
44     public void configure(GerGbeanLocatorType xml) {
45         setXmlObject(xml);
46     }
47
48     public String JavaDoc getGBeanLink() {
49         return getGBeanLocator().getGbeanLink();
50     }
51
52     public void setGBeanLink(String JavaDoc link) {
53         GerGbeanLocatorType locator = getGBeanLocator();
54         if(link != null && locator.isSetPattern()) {
55             clearPatternFromChoice();
56         }
57         String JavaDoc old = getGBeanLink();
58         locator.setGbeanLink(link);
59         pcs.firePropertyChange("GBeanLink", old, link);
60     }
61
62
63     protected void clearNonPatternFromChoice() {
64         GerGbeanLocatorType locator = getGBeanLocator();
65         if(locator.isSetGbeanLink()) {
66             String JavaDoc temp = locator.getGbeanLink();
67             locator.unsetGbeanLink();
68             pcs.firePropertyChange("GBeanLink", temp, null);
69         }
70     }
71 }
72
Popular Tags