KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > jbi > routing > mock > MockEndpointService


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: MockEndpointService.java 4:08:23 PM ddesjardins $
20  * -------------------------------------------------------------------------
21  */

22 package org.objectweb.petals.jbi.routing.mock;
23
24 import javax.jbi.JBIException;
25 import javax.jbi.messaging.MessageExchange;
26 import javax.jbi.servicedesc.ServiceEndpoint;
27 import javax.xml.namespace.QName JavaDoc;
28
29 import org.objectweb.fractal.api.NoSuchInterfaceException;
30 import org.objectweb.fractal.api.control.IllegalBindingException;
31 import org.objectweb.fractal.api.control.IllegalLifeCycleException;
32 import org.objectweb.petals.jbi.management.service.EndpointService;
33 import org.objectweb.petals.jbi.registry.AbstractEndpoint;
34 import org.objectweb.petals.jbi.registry.ConsumerEndpoint;
35 import org.objectweb.petals.jbi.registry.InternalEndpoint;
36 import org.w3c.dom.Document JavaDoc;
37
38 /**
39  * Mock of the EndpointService
40  *
41  * @author ddesjardins - eBMWebsourcing
42  */

43 public class MockEndpointService implements EndpointService {
44
45     public QName JavaDoc[] getInterfacesForEndpoint(AbstractEndpoint endpoint) {
46         return null;
47     }
48
49     public InternalEndpoint activateEndpoint(QName JavaDoc serviceName,
50         String JavaDoc endpointName, ConsumerEndpoint address) throws JBIException {
51         return null;
52     }
53
54     public void deactivateEndpoint(ServiceEndpoint endpoint)
55         throws JBIException {
56     }
57
58     public void deregisterInternalEndpoint(ServiceEndpoint endpoint)
59         throws JBIException {
60     }
61
62     public void deregisterExternalEndpoint(ServiceEndpoint endpoint)
63         throws JBIException {
64     }
65
66     public ServiceEndpoint getEndpoint(QName JavaDoc service, String JavaDoc name) {
67         return new InternalEndpoint(service, name, "compo", "0", this);
68     }
69
70     public Document JavaDoc getEndpointDescriptorForEndpoint(ServiceEndpoint endpoint) {
71         return null;
72     }
73
74     public ServiceEndpoint[] getInternalEndpointsForInterface(
75         QName JavaDoc interfaceName) {
76         ServiceEndpoint[] endpoints = new ServiceEndpoint[] {new InternalEndpoint(
77             new QName JavaDoc("service"), "endpoint", "compo", "0", this)};
78         return endpoints;
79     }
80
81     public ServiceEndpoint[] getInternalEndpointsForService(QName JavaDoc serviceName) {
82         if (serviceName.equals(new QName JavaDoc("foo"))) {
83             return new ServiceEndpoint[0];
84         }
85         return new InternalEndpoint[] {
86             new InternalEndpoint(new QName JavaDoc("service"), "endpoint", "compo",
87                 "0", this),
88             new InternalEndpoint(new QName JavaDoc("servicename"), "endpoint1",
89                 "compo", "0", this)};
90     }
91
92     public ServiceEndpoint[] getExternalEndpointsForInterface(
93         QName JavaDoc interfaceName) {
94         return null;
95     }
96
97     public ServiceEndpoint[] getExternalEndpointsForService(QName JavaDoc serviceName) {
98         return null;
99     }
100
101     public void registerExternalEndpoint(ServiceEndpoint externalEndpoint)
102         throws JBIException {
103     }
104
105     public AbstractEndpoint getInternalEndpoint(QName JavaDoc service, String JavaDoc name) {
106         return new InternalEndpoint(service, name, "compo", "0", this);
107     }
108
109     public String JavaDoc getFcState() {
110         return null;
111     }
112
113     public void startFc() throws IllegalLifeCycleException {
114     }
115
116     public void stopFc() throws IllegalLifeCycleException {
117     }
118
119     public String JavaDoc[] listFc() {
120         return null;
121     }
122
123     public Object JavaDoc lookupFc(String JavaDoc arg0) throws NoSuchInterfaceException {
124         return null;
125     }
126
127     public void bindFc(String JavaDoc arg0, Object JavaDoc arg1)
128         throws NoSuchInterfaceException, IllegalBindingException,
129         IllegalLifeCycleException {
130     }
131
132     public void unbindFc(String JavaDoc arg0) throws NoSuchInterfaceException,
133         IllegalBindingException, IllegalLifeCycleException {
134     }
135
136     public void createConnection(QName JavaDoc consInterface, QName JavaDoc provService,
137         String JavaDoc provEndpoint) throws JBIException {
138     }
139
140     public void createConnection(QName JavaDoc consService, String JavaDoc consEndpoint,
141         QName JavaDoc provService, String JavaDoc provEndpoint) throws JBIException {
142     }
143
144     public void deleteConnection(QName JavaDoc consInterface, QName JavaDoc provService,
145         String JavaDoc provEndpoint) throws JBIException {
146     }
147
148     public void deleteConnection(QName JavaDoc consService, String JavaDoc consEndpoint,
149         QName JavaDoc provService, String JavaDoc provEndpoint) throws JBIException {
150     }
151
152     public boolean isExchangeWithConsumerOkayForComponent(
153         InternalEndpoint internalEndpoint, MessageExchange exchange) {
154         return true;
155     }
156
157     public boolean isExchangeWithProviderOkayForComponent(
158         InternalEndpoint internalEndpoint, MessageExchange exchange) {
159         return true;
160     }
161
162     public boolean isContainerStarted(AbstractEndpoint endpoint) {
163         return true;
164     }
165
166     public ServiceEndpoint getEndpoint(QName JavaDoc service, String JavaDoc name, boolean resolveLink) {
167         return new InternalEndpoint(service, name, "compo", "0", this);
168     }
169
170 }
171
Popular Tags