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: * @(#)MessageHandler.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.binding.jms.handler;
030:
031: import com.sun.jbi.binding.jms.EndpointBean;
032:
033: import com.sun.jbi.binding.jms.framework.Command;
034:
035: import javax.jbi.messaging.MessageExchange;
036:
037: import javax.jms.Message;
038:
039: /**
040: * Message Handler interface.
041: *
042: * @author Sun Microsystems Inc.
043: */
044: public interface MessageHandler extends Command {
045: /**
046: * Sets bean.
047: *
048: * @param eb endpoint bean.
049: */
050: void setBean(EndpointBean eb);
051:
052: /**
053: * Gets bean.
054: *
055: * @return endpoint bean.
056: */
057: EndpointBean getBean();
058:
059: /**
060: * Sets error.
061: *
062: * @param err error string.
063: */
064: void setError(String err);
065:
066: /**
067: * Gets error.
068: *
069: * @return error string.
070: */
071: String getError();
072:
073: /**
074: * Sets exception.
075: *
076: * @param ex exception.
077: */
078: void setException(Exception ex);
079:
080: /**
081: * Returns the exception.
082: *
083: * @return exception.
084: */
085: Exception getException();
086:
087: /**
088: * Set JMS message.
089: *
090: * @param msg JMS message.
091: */
092: void setJMSMessage(Message msg);
093:
094: /**
095: * Gets the JMS message.
096: *
097: * @return JMS message.
098: */
099: Message getJMSMessage();
100:
101: /**
102: * Sets NMR exchange.
103: *
104: * @param exch NMR exchange.
105: */
106: void setNMSMessage(MessageExchange exch);
107:
108: /**
109: * Gets the NMR exchange.
110: *
111: * @return NMR exchange.
112: */
113: MessageExchange getNMSMessage();
114:
115: /**
116: * Clear.
117: */
118: void clear();
119:
120: /**
121: * Sends the NMR exchange.
122: *
123: * @param exch NMR exhcange.
124: *
125: * @return true if sent.
126: */
127: boolean send(MessageExchange exch);
128:
129: /**
130: * Send the JMS message.
131: *
132: * @return true if sent.
133: */
134: boolean sendJMSMessage();
135:
136: /**
137: * Send NMR message.
138: *
139: * @return true if sent.
140: */
141: boolean sendNMSMessage();
142: }
|