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 org.apache.servicemix.bean.beans;
018:
019: import javax.jbi.messaging.MessageExchange;
020:
021: import org.apache.commons.logging.Log;
022: import org.apache.commons.logging.LogFactory;
023: import org.apache.servicemix.bean.Content;
024: import org.apache.servicemix.bean.Property;
025: import org.apache.servicemix.bean.XPath;
026:
027: /**
028: * A simple POJO which uses no annotations
029: *
030: * @version $Revision: $
031: */
032: public class PlainBean {
033:
034: private static final Log LOG = LogFactory.getLog(PlainBean.class);
035:
036: private MessageExchange foo;
037: private MessageExchange bar;
038: private String propertyParameter;
039: private String xpathParameter;
040: private Object body;
041:
042: public void foo(MessageExchange messageExchange) {
043: this .foo = messageExchange;
044: LOG.info("foo() called with exchange: " + messageExchange);
045: }
046:
047: public void bar(MessageExchange messageExchange) {
048: this .bar = messageExchange;
049: LOG.info("bar() called with exchange: " + messageExchange);
050: }
051:
052: public void methodWithPropertyParameter(@Property(name="person")
053: String name) {
054: this .propertyParameter = name;
055: LOG
056: .info("methodWithPropertyParameter() called with parameter: "
057: + name);
058: }
059:
060: public void methodWithPropertyParameterAndXPath(
061: @Property(name="person")
062: String name, @XPath(xpath="/hello/@address")
063: String address) {
064: this .propertyParameter = name;
065: this .xpathParameter = address;
066: LOG
067: .info("methodWithPropertyParameterAndXPath() called with parameter: "
068: + address);
069: }
070:
071: public void methodWithPropertyParameterAndContent(
072: @Property(name="person")
073: String name, @Content
074: Object content) {
075: this .propertyParameter = name;
076: this .body = content;
077: LOG
078: .info("methodWithPropertyParameterAndContent() called with body: "
079: + content);
080: }
081:
082: public MessageExchange getFoo() {
083: return foo;
084: }
085:
086: public void setFoo(MessageExchange foo) {
087: this .foo = foo;
088: }
089:
090: public MessageExchange getBar() {
091: return bar;
092: }
093:
094: public void setBar(MessageExchange bar) {
095: this .bar = bar;
096: }
097:
098: public String getPropertyParameter() {
099: return propertyParameter;
100: }
101:
102: public void setPropertyParameter(String propertyParameter) {
103: this .propertyParameter = propertyParameter;
104: }
105:
106: public String getXpathParameter() {
107: return xpathParameter;
108: }
109:
110: public void setXpathParameter(String xpathParameter) {
111: this .xpathParameter = xpathParameter;
112: }
113:
114: public Object getBody() {
115: return body;
116: }
117:
118: public void setBody(Object body) {
119: this.body = body;
120: }
121: }
|