001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)ManagementMessageHolder.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.management.system;
030:
031: import com.sun.jbi.management.ComponentMessageHolder;
032:
033: /**
034: * This provides necessary methods for various management
035: * services to pass the task result data to ManagemntMessageBuilder.
036: * ManagementMessageBuilder constructs an XML document
037: * based on this.
038: *
039: * @author JSR208 Expert Group
040: */
041:
042: public class ManagementMessageHolder extends ComponentMessageHolder {
043:
044: /* Framework locale */
045: String mFrameworkLocale = null;
046:
047: /* Exception cause */
048: boolean bIsCauseFramework = false;
049:
050: /**
051: * Creates a new instance of MessageContentHolder with a message type.
052: * @param msgType String describing the message type to build.
053: */
054: public ManagementMessageHolder(String msgType) {
055: super (msgType);
056: }
057:
058: /**
059: * Set the JBI Framework locale
060: *
061: * @param locale - JBI Framework Locale
062: *
063: */
064: public void setFrameworkLocale(String locale) {
065: mFrameworkLocale = locale;
066: }
067:
068: /**
069: * Set the value indicating if JBI Framework is cause of the exception
070: *
071: * @param isCauseFramework - set value indicating cause
072: *
073: */
074: public void setCauseFramework(boolean isCauseFramework) {
075: bIsCauseFramework = isCauseFramework;
076: }
077:
078: /**
079: * Get the type(status, exception) of message to be built
080: * for this component.
081: * @return Task Result
082: */
083: public String getManagementMessageType() {
084: return super .getComponentMessageType();
085: }
086:
087: /**
088: * Get the JBI Framework Locales
089: *
090: * @return JBI Framework locale
091: */
092: public String getFrameworkLocale() {
093: return mFrameworkLocale;
094: }
095:
096: /**
097: * Return the value indicating if the cause of this
098: * exception is JBI Framework
099: *
100: * @return value indicating exception cause
101: */
102: public String isCauseFramework() {
103: if (bIsCauseFramework) {
104: return "YES";
105: } else {
106: return "NO";
107: }
108:
109: }
110:
111: }
|