01: /**
02: *
03: * Licensed to the Apache Software Foundation (ASF) under one or more
04: * contributor license agreements. See the NOTICE file distributed with
05: * this work for additional information regarding copyright ownership.
06: * The ASF licenses this file to You under the Apache License, Version 2.0
07: * (the "License"); you may not use this file except in compliance with
08: * the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */package org.apache.servicemix.common;
18:
19: import org.apache.commons.logging.Log;
20: import org.apache.servicemix.executors.Executor;
21:
22: import javax.jbi.component.Component;
23: import javax.jbi.component.ComponentContext;
24: import javax.jbi.messaging.MessageExchange;
25: import javax.jbi.messaging.MessagingException;
26: import javax.xml.namespace.QName;
27:
28: /**
29: * Represents an extended JBI Component implementation which exposes some extra features
30: *
31: * @version $Revision: 513653 $
32: */
33: public interface ServiceMixComponent extends Component {
34:
35: /**
36: * @return Returns the logger.
37: */
38: public Log getLogger();
39:
40: /**
41: * @return Returns the registry.
42: */
43: public Registry getRegistry();
44:
45: /**
46: * @return Returns the executor for this component
47: */
48: public Executor getExecutor();
49:
50: /**
51: * @return Returns the components context
52: */
53: public ComponentContext getComponentContext();
54:
55: /**
56: * @return Returns the name of the component
57: */
58: public String getComponentName();
59:
60: /**
61: * Prepare a consumer exchange from the given endpoint.
62: * The caller need to send / sendSync the exchange.
63: *
64: * @param exchange the exchange to send
65: * @param endpoint the endpoint sending the exchange
66: * @throws MessagingException
67: */
68: public void prepareConsumerExchange(MessageExchange exchange,
69: Endpoint endpoint) throws MessagingException;
70:
71: /**
72: * Sends a consumer exchange from the given endpoint.
73: *
74: * @param exchange the exchange to send
75: * @param endpoint the endpoint sending the exchange
76: * @throws MessagingException
77: * @deprecated use prepareConsumerExchange
78: */
79: public void sendConsumerExchange(MessageExchange exchange,
80: Endpoint endpoint) throws MessagingException;
81:
82: /**
83: * @return the QName of the element used in EPR
84: */
85: public QName getEPRElementName();
86: }
|