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.cxfse;
018    
019    import java.util.MissingResourceException;
020    import java.util.logging.Logger;
021    
022    import javax.jbi.JBIException;
023    import javax.jbi.component.ComponentContext;
024    import javax.jbi.management.MBeanNames;
025    import javax.jbi.messaging.DeliveryChannel;
026    import javax.jbi.messaging.MessagingException;
027    import javax.jbi.servicedesc.ServiceEndpoint;
028    import javax.management.MBeanServer;
029    import javax.naming.InitialContext;
030    import javax.xml.namespace.QName;
031    
032    import org.w3c.dom.Document;
033    import org.w3c.dom.DocumentFragment;
034    
035    public class CxfSeEndpointComponentContext implements ComponentContext {
036        private ComponentContext context;
037        private DeliveryChannel channel;
038        
039        public CxfSeEndpointComponentContext() {
040            
041        }
042        
043        public CxfSeEndpointComponentContext(ComponentContext context) {
044            this.context = context;
045        }
046    
047        public ServiceEndpoint activateEndpoint(QName serviceName, String endpointName) throws JBIException {
048            throw new UnsupportedOperationException();
049        }
050    
051        public void deactivateEndpoint(ServiceEndpoint endpoint) throws JBIException {
052            throw new UnsupportedOperationException();
053        }
054    
055        public void deregisterExternalEndpoint(ServiceEndpoint externalEndpoint) throws JBIException {
056            throw new UnsupportedOperationException();
057        }
058    
059        public String getComponentName() {
060            return context.getComponentName();
061        }
062    
063        public DeliveryChannel getDeliveryChannel() throws MessagingException {
064            if (this.channel == null) {
065                this.channel = context.getDeliveryChannel();
066            }
067            return this.channel;
068        }
069    
070        public ServiceEndpoint getEndpoint(QName service, String name) {
071            return context.getEndpoint(service, name);
072        }
073    
074        public Document getEndpointDescriptor(ServiceEndpoint endpoint) throws JBIException {
075            return context.getEndpointDescriptor(endpoint);
076        }
077    
078        public ServiceEndpoint[] getEndpoints(QName interfaceName) {
079            return context.getEndpoints(interfaceName);
080        }
081    
082        public ServiceEndpoint[] getEndpointsForService(QName serviceName) {
083            return context.getEndpointsForService(serviceName);
084        }
085    
086        public ServiceEndpoint[] getExternalEndpoints(QName interfaceName) {
087            return context.getExternalEndpoints(interfaceName);
088        }
089    
090        public ServiceEndpoint[] getExternalEndpointsForService(QName serviceName) {
091            return context.getExternalEndpointsForService(serviceName);
092        }
093    
094        public String getInstallRoot() {
095            return context.getInstallRoot();
096        }
097    
098        public Logger getLogger(String suffix, String resourceBundleName) throws MissingResourceException, JBIException {
099            return context.getLogger(suffix, resourceBundleName);
100        }
101    
102        public MBeanNames getMBeanNames() {
103            return context.getMBeanNames();
104        }
105    
106        public MBeanServer getMBeanServer() {
107            return context.getMBeanServer();
108        }
109    
110        public InitialContext getNamingContext() {
111            return context.getNamingContext();
112        }
113    
114        public Object getTransactionManager() {
115            return context.getTransactionManager();
116        }
117    
118        public String getWorkspaceRoot() {
119            return context.getWorkspaceRoot();
120        }
121    
122        public void registerExternalEndpoint(ServiceEndpoint externalEndpoint) throws JBIException {
123            throw new UnsupportedOperationException();
124        }
125    
126        public ServiceEndpoint resolveEndpointReference(DocumentFragment epr) {
127            return context.resolveEndpointReference(epr);
128        }
129    
130    }