KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > jbi > component > mock > MockComponentContext


1 /**
2  * PETALS - PETALS Services Platform.
3  * Copyright (c) 2005 EBM Websourcing, http://www.ebmwebsourcing.com/
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * -------------------------------------------------------------------------
19  * $Id: MockComponentContext.java 11:33:07 AM ddesjardins $
20  * -------------------------------------------------------------------------
21  */

22 package org.objectweb.petals.jbi.component.mock;
23
24 import java.util.MissingResourceException JavaDoc;
25 import java.util.logging.Logger JavaDoc;
26
27 import javax.jbi.JBIException;
28 import javax.jbi.component.ComponentContext;
29 import javax.jbi.management.MBeanNames;
30 import javax.jbi.messaging.DeliveryChannel;
31 import javax.jbi.messaging.MessagingException;
32 import javax.jbi.servicedesc.ServiceEndpoint;
33 import javax.management.MBeanServer JavaDoc;
34 import javax.naming.InitialContext JavaDoc;
35 import javax.xml.namespace.QName JavaDoc;
36
37 import org.w3c.dom.Document JavaDoc;
38 import org.w3c.dom.DocumentFragment JavaDoc;
39
40 /**
41  *
42  * @author ddesjardins - eBMWebsourcing
43  */

44 public class MockComponentContext implements ComponentContext {
45
46     private boolean getMBeanNames;
47
48     private boolean getMBeanServer;
49
50     private boolean getNamingContext;
51
52     private boolean getTransactionManager;
53
54     public ServiceEndpoint activateEndpoint(QName JavaDoc serviceName,
55         String JavaDoc endpointName) throws JBIException {
56         return null;
57     }
58
59     public void deactivateEndpoint(ServiceEndpoint endpoint)
60         throws JBIException {
61     }
62
63     public void deregisterExternalEndpoint(ServiceEndpoint externalEndpoint)
64         throws JBIException {
65     }
66
67     public String JavaDoc getComponentName() {
68         return null;
69     }
70
71     public DeliveryChannel getDeliveryChannel() throws MessagingException {
72         return null;
73     }
74
75     public ServiceEndpoint getEndpoint(QName JavaDoc service, String JavaDoc name) {
76         return null;
77     }
78
79     public Document JavaDoc getEndpointDescriptor(ServiceEndpoint endpoint)
80         throws JBIException {
81         return null;
82     }
83
84     public ServiceEndpoint[] getEndpoints(QName JavaDoc interfaceName) {
85         return null;
86     }
87
88     public ServiceEndpoint[] getEndpointsForService(QName JavaDoc serviceName) {
89         return null;
90     }
91
92     public ServiceEndpoint[] getExternalEndpoints(QName JavaDoc interfaceName) {
93         return null;
94     }
95
96     public ServiceEndpoint[] getExternalEndpointsForService(QName JavaDoc serviceName) {
97         return null;
98     }
99
100     public String JavaDoc getInstallRoot() {
101         return "root";
102     }
103
104     public Logger JavaDoc getLogger(String JavaDoc suffix, String JavaDoc resourceBundleName)
105         throws MissingResourceException JavaDoc, JBIException {
106         return null;
107     }
108
109     public MBeanNames getMBeanNames() {
110         getMBeanNames = true;
111         return null;
112     }
113
114     public MBeanServer JavaDoc getMBeanServer() {
115         getMBeanServer = true;
116         return null;
117     }
118
119     public InitialContext JavaDoc getNamingContext() {
120         getNamingContext = true;
121         return null;
122     }
123
124     public Object JavaDoc getTransactionManager() {
125         getTransactionManager = true;
126         return null;
127     }
128
129     public String JavaDoc getWorkspaceRoot() {
130         return null;
131     }
132
133     public boolean isGetMBeanNames() {
134         return getMBeanNames;
135     }
136
137     public boolean isGetMBeanServer() {
138         return getMBeanServer;
139     }
140
141     public boolean isGetNamingContext() {
142         return getNamingContext;
143     }
144
145     public boolean isGetTransactionManager() {
146         return getTransactionManager;
147     }
148
149     public void registerExternalEndpoint(ServiceEndpoint externalEndpoint)
150         throws JBIException {
151     }
152
153     public ServiceEndpoint resolveEndpointReference(DocumentFragment JavaDoc epr) {
154         return null;
155     }
156
157     public void setGetMBeanNames(boolean getMBeanNames) {
158         this.getMBeanNames = getMBeanNames;
159     }
160
161     public void setGetMBeanServer(boolean getMBeanServer) {
162         this.getMBeanServer = getMBeanServer;
163     }
164
165     public void setGetNamingContext(boolean getNamingContext) {
166         this.getNamingContext = getNamingContext;
167     }
168
169     public void setGetTransactionManager(boolean getTransactionManager) {
170         this.getTransactionManager = getTransactionManager;
171     }
172
173 }
174
Popular Tags