You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by js...@apache.org on 2007/03/20 16:17:03 UTC
svn commit: r520424 -
/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Message.java
Author: jstrachan
Date: Tue Mar 20 08:17:02 2007
New Revision: 520424
URL: http://svn.apache.org/viewvc?view=rev&rev=520424
Log:
added an experimental interface for Messages
Added:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Message.java (with props)
Added: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Message.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Message.java?view=auto&rev=520424
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Message.java (added)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Message.java Tue Mar 20 08:17:02 2007
@@ -0,0 +1,76 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel;
+
+import java.util.Map;
+
+/**
+ * Represents an inbound or outbound message as part of an {@link Exchange}
+ *
+ * @version $Revision$
+ */
+public interface Message {
+
+ /**
+ * Returns the body of the message as a POJO
+ *
+ * @returns the body of the message
+ */
+ public Object getBody();
+
+ /**
+ * Returns the body as the specified type
+ *
+ * @param type the type that the body i
+ * @return the body of the message as the specified type
+ */
+ public <T> T getBody(Class<T> type);
+
+ /**
+ * Sets the body of the message
+ */
+ public void setBody(Object body);
+
+ /**
+ * Sets the body of the message as a specific type
+ */
+ public <T> void setBody(Object body, Class<T> type);
+
+ /**
+ * Accesses a specific header
+ *
+ * @param name
+ * @return object header associated with the name
+ */
+ Object getHeader(String name);
+
+ /**
+ * Sets a header on the exchange
+ *
+ * @param name of the header
+ * @param value to associate with the name
+ */
+ void setHeader(String name, Object value);
+
+ /**
+ * Returns all of the headers associated with the request
+ *
+ * @return all the headers in a Map
+ */
+ Map<String, Object> getHeaders();
+}
Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Message.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Message.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Message.java
------------------------------------------------------------------------------
svn:mime-type = text/plain