001: /*
002: * ChainBuilder ESB
003: * Visual Enterprise Integration
004: *
005: * Copyright (C) 2006 Bostech Corporation
006: *
007: * This program is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU General Public License as published by the
009: * Free Software Foundation; either version 2 of the License, or (at your option)
010: * any later version.
011: *
012: * This program is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
014: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
015: * for more details.
016: *
017: * You should have received a copy of the GNU General Public License along with
018: * this program; if not, write to the Free Software Foundation, Inc.,
019: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020: *
021: *
022: * $Id: CcslComponentContext.java 6624 2007-04-11 01:09:05Z zjin $
023: */
024: package com.bostechcorp.cbesb.runtime.ccsl.base;
025:
026: import java.util.MissingResourceException;
027:
028: import javax.jbi.JBIException;
029: import javax.jbi.component.ComponentContext;
030: import javax.jbi.management.MBeanNames;
031: import javax.jbi.messaging.DeliveryChannel;
032: import javax.jbi.messaging.MessagingException;
033: import javax.jbi.servicedesc.ServiceEndpoint;
034: import javax.management.MBeanServer;
035: import javax.naming.InitialContext;
036: import javax.xml.namespace.QName;
037:
038: import org.apache.commons.logging.Log;
039: import org.apache.commons.logging.LogFactory;
040: import org.w3c.dom.Document;
041: import org.w3c.dom.DocumentFragment;
042:
043: public class CcslComponentContext implements ComponentContext {
044: ComponentContext realComponentContext;
045: DeliveryChannel realDeliveryChannel;
046: DeliveryChannel ccslDeliveryChannel;
047: Log log;
048:
049: CcslComponentContext(CcslComponent comp, ComponentContext cc,
050: DeliveryChannel dc, Log logger) {
051: realComponentContext = cc;
052: realDeliveryChannel = dc;
053: log = LogFactory.getLog(this .getClass());
054: ccslDeliveryChannel = new CcslDeliveryChannel(comp,
055: realDeliveryChannel, log);
056: }
057:
058: public ServiceEndpoint activateEndpoint(QName arg0, String arg1)
059: throws JBIException {
060: return realComponentContext.activateEndpoint(arg0, arg1);
061: }
062:
063: public void deactivateEndpoint(ServiceEndpoint arg0)
064: throws JBIException {
065: realComponentContext.deactivateEndpoint(arg0);
066: }
067:
068: public void deregisterExternalEndpoint(ServiceEndpoint arg0)
069: throws JBIException {
070: realComponentContext.deregisterExternalEndpoint(arg0);
071: }
072:
073: public String getComponentName() {
074: return realComponentContext.getComponentName();
075: }
076:
077: public DeliveryChannel getDeliveryChannel()
078: throws MessagingException {
079: return ccslDeliveryChannel;
080: }
081:
082: public ServiceEndpoint getEndpoint(QName arg0, String arg1) {
083: return realComponentContext.getEndpoint(arg0, arg1);
084: }
085:
086: public Document getEndpointDescriptor(ServiceEndpoint arg0)
087: throws JBIException {
088: try {
089: return realComponentContext.getEndpointDescriptor(arg0);
090: } catch (NullPointerException e) {
091: log
092: .error("****CCSL RETURNING NULL FOR LINKED ENDPOINT getEndpointDescriptor() to avoid exception**** "
093: + e.getMessage());
094: if (log.isDebugEnabled()) {
095: log
096: .debug(
097: "****CCSL RETURNING NULL FOR LINKED ENDPOINT getEndpointDescriptor() to avoid exception****",
098: e);
099: }
100: return null;
101: }
102: }
103:
104: public ServiceEndpoint[] getEndpoints(QName arg0) {
105: return realComponentContext.getEndpoints(arg0);
106: }
107:
108: public ServiceEndpoint[] getEndpointsForService(QName arg0) {
109: return realComponentContext.getEndpointsForService(arg0);
110: }
111:
112: public ServiceEndpoint[] getExternalEndpoints(QName arg0) {
113: return realComponentContext.getExternalEndpoints(arg0);
114: }
115:
116: public ServiceEndpoint[] getExternalEndpointsForService(QName arg0) {
117: return realComponentContext
118: .getExternalEndpointsForService(arg0);
119: }
120:
121: public String getInstallRoot() {
122: return realComponentContext.getInstallRoot();
123: }
124:
125: public java.util.logging.Logger getLogger(String arg0, String arg1)
126: throws MissingResourceException, JBIException {
127: return realComponentContext.getLogger(arg0, arg1);
128: }
129:
130: public MBeanNames getMBeanNames() {
131: return realComponentContext.getMBeanNames();
132: }
133:
134: public MBeanServer getMBeanServer() {
135: return realComponentContext.getMBeanServer();
136: }
137:
138: public InitialContext getNamingContext() {
139: return realComponentContext.getNamingContext();
140: }
141:
142: public Object getTransactionManager() {
143: return realComponentContext.getTransactionManager();
144: }
145:
146: public String getWorkspaceRoot() {
147: return realComponentContext.getWorkspaceRoot();
148: }
149:
150: public void registerExternalEndpoint(ServiceEndpoint arg0)
151: throws JBIException {
152: realComponentContext.registerExternalEndpoint(arg0);
153: }
154:
155: public ServiceEndpoint resolveEndpointReference(
156: DocumentFragment arg0) {
157: return realComponentContext.resolveEndpointReference(arg0);
158: }
159:
160: }
|