1 17 package org.apache.servicemix.jsr181; 18 19 import java.util.MissingResourceException ; 20 import java.util.logging.Logger ; 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 ; 29 import javax.naming.InitialContext ; 30 import javax.xml.namespace.QName ; 31 32 import org.w3c.dom.Document ; 33 import org.w3c.dom.DocumentFragment ; 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 serviceName, String endpointName) throws JBIException { 45 throw new UnsupportedOperationException (); 46 } 47 48 public void deactivateEndpoint(ServiceEndpoint endpoint) throws JBIException { 49 throw new UnsupportedOperationException (); 50 } 51 52 public void deregisterExternalEndpoint(ServiceEndpoint externalEndpoint) throws JBIException { 53 throw new UnsupportedOperationException (); 54 } 55 56 public String 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 service, String name) { 68 return context.getEndpoint(service, name); 69 } 70 71 public Document getEndpointDescriptor(ServiceEndpoint endpoint) throws JBIException { 72 return context.getEndpointDescriptor(endpoint); 73 } 74 75 public ServiceEndpoint[] getEndpoints(QName interfaceName) { 76 return context.getEndpoints(interfaceName); 77 } 78 79 public ServiceEndpoint[] getEndpointsForService(QName serviceName) { 80 return context.getEndpointsForService(serviceName); 81 } 82 83 public ServiceEndpoint[] getExternalEndpoints(QName interfaceName) { 84 return context.getExternalEndpoints(interfaceName); 85 } 86 87 public ServiceEndpoint[] getExternalEndpointsForService(QName serviceName) { 88 return context.getExternalEndpointsForService(serviceName); 89 } 90 91 public String getInstallRoot() { 92 return context.getInstallRoot(); 93 } 94 95 public Logger getLogger(String suffix, String resourceBundleName) throws MissingResourceException , JBIException { 96 return context.getLogger(suffix, resourceBundleName); 97 } 98 99 public MBeanNames getMBeanNames() { 100 return context.getMBeanNames(); 101 } 102 103 public MBeanServer getMBeanServer() { 104 return context.getMBeanServer(); 105 } 106 107 public InitialContext getNamingContext() { 108 return context.getNamingContext(); 109 } 110 111 public Object getTransactionManager() { 112 return context.getTransactionManager(); 113 } 114 115 public String getWorkspaceRoot() { 116 return context.getWorkspaceRoot(); 117 } 118 119 public void registerExternalEndpoint(ServiceEndpoint externalEndpoint) throws JBIException { 120 throw new UnsupportedOperationException (); 121 } 122 123 public ServiceEndpoint resolveEndpointReference(DocumentFragment epr) { 124 return context.resolveEndpointReference(epr); 125 } 126 127 } 128 | Popular Tags |