001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */package org.apache.geronimo.naming.deployment.jsr88;
017:
018: import org.apache.geronimo.xbeans.geronimo.naming.GerMessageDestinationType;
019:
020: /**
021: * Represents an element of the message-destinationType in a Geronimo deployment
022: * plan.
023: * <p>
024: * Has 4 JavaBean Properties <br />
025: * - messageDestinationName (type String) <br />
026: * - pattern (type Pattern) <br />
027: * - adminObjectModule (type String) <br />
028: * - adminObjectLink (type String) </p>
029: *
030: * @version $Rev: 565397 $ $Date: 2007-08-13 09:21:44 -0700 (Mon, 13 Aug 2007) $
031: */
032: public class MessageDestination extends HasPattern {
033: public MessageDestination() {
034: super (null);
035: }
036:
037: public MessageDestination(GerMessageDestinationType xmlObject) {
038: super (xmlObject);
039: }
040:
041: public void setMessageDestinationName(String name) {
042: String old = getMessageDestination()
043: .getMessageDestinationName();
044: getMessageDestination().setMessageDestinationName(name);
045: pcs.firePropertyChange("messageDestinationName", old, name);
046: }
047:
048: public String getMessageDestinationName() {
049: return getMessageDestination().getMessageDestinationName();
050: }
051:
052: public String getAdminObjectLink() {
053: return getMessageDestination().getAdminObjectLink();
054: }
055:
056: public void setAdminObjectLink(String link) {
057: GerMessageDestinationType ref = getMessageDestination();
058: if (link != null && ref.isSetPattern()) {
059: clearPatternFromChoice();
060: }
061: String old = getAdminObjectLink();
062: ref.setAdminObjectLink(link);
063: pcs.firePropertyChange("adminObjectLink", old, link);
064: }
065:
066: public String getAdminObjectModule() {
067: return getMessageDestination().getAdminObjectModule();
068: }
069:
070: public void setAdminObjectModule(String module) {
071: GerMessageDestinationType ref = getMessageDestination();
072: if (module != null && ref.isSetPattern()) {
073: clearPatternFromChoice();
074: }
075: String old = getAdminObjectModule();
076: ref.setAdminObjectModule(module);
077: pcs.firePropertyChange("adminObjectModule", old, module);
078: }
079:
080: protected void clearNonPatternFromChoice() {
081: GerMessageDestinationType ref = getMessageDestination();
082: if (ref.isSetAdminObjectLink()) {
083: String temp = ref.getAdminObjectLink();
084: ref.unsetAdminObjectLink();
085: pcs.firePropertyChange("adminObjectLink", temp, null);
086: }
087: if (ref.isSetAdminObjectModule()) {
088: String temp = ref.getAdminObjectModule();
089: ref.unsetAdminObjectModule();
090: pcs.firePropertyChange("adminObjectModule", temp, null);
091: }
092: }
093:
094: protected GerMessageDestinationType getMessageDestination() {
095: return (GerMessageDestinationType) getXmlObject();
096: }
097:
098: public void configure(GerMessageDestinationType xml) {
099: setXmlObject(xml);
100: }
101: }
|