KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > servicemix > jsr181 > EndpointComponentContext


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.servicemix.jsr181;
18
19 import java.util.MissingResourceException JavaDoc;
20 import java.util.logging.Logger JavaDoc;
21
22 import javax.jbi.JBIException;
23 import javax.jbi.component.ComponentContext;
24 import javax.jbi.management.MBeanNames;
25 import javax.jbi.messaging.DeliveryChannel;
26 import javax.jbi.messaging.MessagingException;
27 import javax.jbi.servicedesc.ServiceEndpoint;
28 import javax.management.MBeanServer JavaDoc;
29 import javax.naming.InitialContext JavaDoc;
30 import javax.xml.namespace.QName JavaDoc;
31
32 import org.w3c.dom.Document JavaDoc;
33 import org.w3c.dom.DocumentFragment JavaDoc;
34
35 public class EndpointComponentContext implements ComponentContext {
36
37     private ComponentContext context;
38     private DeliveryChannel channel;
39     
40     public EndpointComponentContext(ComponentContext context) {
41         this.context = context;
42     }
43
44     public ServiceEndpoint activateEndpoint(QName JavaDoc serviceName, String JavaDoc endpointName) throws JBIException {
45         throw new UnsupportedOperationException JavaDoc();
46     }
47
48     public void deactivateEndpoint(ServiceEndpoint endpoint) throws JBIException {
49         throw new UnsupportedOperationException JavaDoc();
50     }
51
52     public void deregisterExternalEndpoint(ServiceEndpoint externalEndpoint) throws JBIException {
53         throw new UnsupportedOperationException JavaDoc();
54     }
55
56     public String JavaDoc getComponentName() {
57         return context.getComponentName();
58     }
59
60     public DeliveryChannel getDeliveryChannel() throws MessagingException {
61         if (this.channel == null) {
62             this.channel = new EndpointDeliveryChannel(context.getDeliveryChannel());
63         }
64         return this.channel;
65     }
66
67     public ServiceEndpoint getEndpoint(QName JavaDoc service, String JavaDoc name) {
68         return context.getEndpoint(service, name);
69     }
70
71     public Document JavaDoc getEndpointDescriptor(ServiceEndpoint endpoint) throws JBIException {
72         return context.getEndpointDescriptor(endpoint);
73     }
74
75     public ServiceEndpoint[] getEndpoints(QName JavaDoc interfaceName) {
76         return context.getEndpoints(interfaceName);
77     }
78
79     public ServiceEndpoint[] getEndpointsForService(QName JavaDoc serviceName) {
80         return context.getEndpointsForService(serviceName);
81     }
82
83     public ServiceEndpoint[] getExternalEndpoints(QName JavaDoc interfaceName) {
84         return context.getExternalEndpoints(interfaceName);
85     }
86
87     public ServiceEndpoint[] getExternalEndpointsForService(QName JavaDoc serviceName) {
88         return context.getExternalEndpointsForService(serviceName);
89     }
90
91     public String JavaDoc getInstallRoot() {
92         return context.getInstallRoot();
93     }
94
95     public Logger JavaDoc getLogger(String JavaDoc suffix, String JavaDoc resourceBundleName) throws MissingResourceException JavaDoc, JBIException {
96         return context.getLogger(suffix, resourceBundleName);
97     }
98
99     public MBeanNames getMBeanNames() {
100         return context.getMBeanNames();
101     }
102
103     public MBeanServer JavaDoc getMBeanServer() {
104         return context.getMBeanServer();
105     }
106
107     public InitialContext JavaDoc getNamingContext() {
108         return context.getNamingContext();
109     }
110
111     public Object JavaDoc getTransactionManager() {
112         return context.getTransactionManager();
113     }
114
115     public String JavaDoc getWorkspaceRoot() {
116         return context.getWorkspaceRoot();
117     }
118
119     public void registerExternalEndpoint(ServiceEndpoint externalEndpoint) throws JBIException {
120         throw new UnsupportedOperationException JavaDoc();
121     }
122
123     public ServiceEndpoint resolveEndpointReference(DocumentFragment JavaDoc epr) {
124         return context.resolveEndpointReference(epr);
125     }
126     
127 }
128
Popular Tags