1 package org.apache.geronimo.naming.deployment.jsr88; 2 3 import org.apache.geronimo.xbeans.geronimo.naming.GerGbeanLocatorType; 4 5 /** 6 * Represents an element of the gbean-locatorType in a Geronimo 7 * deployment plan. 8 * <p> 9 * Has 2 JavaBean Properties <br /> 10 * - GBeanLink (type String) <br /> 11 * - pattern (type Pattern) </p> 12 * 13 * @version $Rev: 410741 $ $Date: 2006-05-31 21:35:48 -0700 (Wed, 31 May 2006) $ 14 */ 15 public class GBeanLocator extends HasPattern { 16 public GBeanLocator() { 17 super(null); 18 } 19 20 public GBeanLocator(GerGbeanLocatorType xmlObject) { 21 super(xmlObject); 22 } 23 24 protected GerGbeanLocatorType getGBeanLocator() { 25 return (GerGbeanLocatorType) getXmlObject(); 26 } 27 28 public void configure(GerGbeanLocatorType xml) { 29 setXmlObject(xml); 30 } 31 32 public String getGBeanLink() { 33 return getGBeanLocator().getGbeanLink(); 34 } 35 36 public void setGBeanLink(String link) { 37 GerGbeanLocatorType locator = getGBeanLocator(); 38 if(link != null && locator.isSetPattern()) { 39 clearPatternFromChoice(); 40 } 41 String old = getGBeanLink(); 42 locator.setGbeanLink(link); 43 pcs.firePropertyChange("GBeanLink", old, link); 44 } 45 46 47 protected void clearNonPatternFromChoice() { 48 GerGbeanLocatorType locator = getGBeanLocator(); 49 if(locator.isSetGbeanLink()) { 50 String temp = locator.getGbeanLink(); 51 locator.unsetGbeanLink(); 52 pcs.firePropertyChange("GBeanLink", temp, null); 53 } 54 } 55 }