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 */ 017 package javax.jbi.messaging; 018 019 import java.net.URI; 020 021 import javax.jbi.servicedesc.ServiceEndpoint; 022 023 import javax.xml.namespace.QName; 024 025 public interface MessageExchange { 026 String JTA_TRANSACTION_PROPERTY_NAME = "javax.jbi.transaction.jta"; 027 028 URI getPattern(); 029 030 String getExchangeId(); 031 032 ExchangeStatus getStatus(); 033 034 void setStatus(ExchangeStatus status) throws MessagingException; 035 036 void setError(Exception error); 037 038 Exception getError(); 039 040 Fault getFault(); 041 042 void setFault(Fault fault) throws MessagingException; 043 044 NormalizedMessage createMessage() throws MessagingException; 045 046 Fault createFault() throws MessagingException; 047 048 NormalizedMessage getMessage(String name); 049 050 void setMessage(NormalizedMessage msg, String name) throws MessagingException; 051 052 Object getProperty(String name); 053 054 void setProperty(String name, Object obj); 055 056 void setEndpoint(ServiceEndpoint endpoint); 057 058 void setService(QName service); 059 060 void setInterfaceName(QName interfaceName); 061 062 void setOperation(QName name); 063 064 ServiceEndpoint getEndpoint(); 065 066 QName getInterfaceName(); 067 068 QName getService(); 069 070 QName getOperation(); 071 072 boolean isTransacted(); 073 074 Role getRole(); 075 076 java.util.Set getPropertyNames(); 077 078 public static final class Role { 079 public static final Role PROVIDER = new Role(); 080 081 public static final Role CONSUMER = new Role(); 082 083 private Role() { 084 } 085 } 086 }