001    /**
002     *
003     * Licensed to the Apache Software Foundation (ASF) under one or more
004     * contributor license agreements.  See the NOTICE file distributed with
005     * this work for additional information regarding copyright ownership.
006     * The ASF licenses this file to You under the Apache License, Version 2.0
007     * (the "License"); you may not use this file except in compliance with
008     * the License.  You may obtain a copy of the License at
009     *
010     * http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing, software
013     * distributed under the License is distributed on an "AS IS" BASIS,
014     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015     * See the License for the specific language governing permissions and
016     * limitations under the License.
017     */
018    package org.apache.servicemix.common;
019    
020    import org.apache.commons.logging.Log;
021    import org.apache.servicemix.executors.Executor;
022    
023    import javax.jbi.component.Component;
024    import javax.jbi.component.ComponentContext;
025    import javax.jbi.messaging.MessageExchange;
026    import javax.jbi.messaging.MessagingException;
027    import javax.xml.namespace.QName;
028    
029    /**
030     * Represents an extended JBI Component implementation which exposes some extra features
031     *
032     * @version $Revision: 513653 $
033     */
034    public interface ServiceMixComponent extends Component {
035    
036        /**
037         * @return Returns the logger.
038         */
039        public Log getLogger();
040    
041        /**
042         * @return Returns the registry.
043         */
044        public Registry getRegistry();
045    
046        /**
047         * @return Returns the executor for this component
048         */
049        public Executor getExecutor();
050    
051        /**
052         * @return Returns the components context
053         */
054        public ComponentContext getComponentContext();
055    
056        /**
057         * @return Returns the name of the component
058         */
059        public String getComponentName();
060        
061        /**
062         * Prepare a consumer exchange from the given endpoint.
063         * The caller need to send / sendSync the exchange. 
064         * 
065         * @param exchange the exchange to send
066         * @param endpoint the endpoint sending the exchange
067         * @throws MessagingException
068         */
069        public void prepareConsumerExchange(MessageExchange exchange, Endpoint endpoint) throws MessagingException;
070    
071        /**
072         * Sends a consumer exchange from the given endpoint. 
073         * 
074         * @param exchange the exchange to send
075         * @param endpoint the endpoint sending the exchange
076         * @throws MessagingException
077         * @deprecated use prepareConsumerExchange
078         */
079        public void sendConsumerExchange(MessageExchange exchange, Endpoint endpoint) throws MessagingException;
080    
081        /**
082         * @return the QName of the element used in EPR
083         */
084        public QName getEPRElementName();
085    }