KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > component > common > bc > JBIListener


1 /**
2  * PETALS - PETALS Services Platform.
3  * Copyright (c) 2006 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$
20  * -------------------------------------------------------------------------
21  */

22
23 package org.objectweb.petals.component.common.bc;
24
25 import org.objectweb.petals.component.common.HandlingException;
26 import org.objectweb.petals.component.common.util.MessageExchangeWrapper;
27 import org.objectweb.petals.tools.jbicommon.descriptor.Extensions;
28
29 /**
30  * This interface defines a method that forward internal JBI messages to
31  * external services.
32  *
33  * @author alouis, ofabre - EBM Websourcing
34  *
35  */

36 public interface JBIListener {
37
38     /**
39      * Called when a JBI message is received on the Component from the JBI
40      * environment. The goal of this method is to call an external service,
41      * related to this JBI message. The address associated with the requested
42      * endpoint is resolved by the abstract component.<br>
43      * <br>
44      * For instance, a ServiceUnit has been deployed on the component, defining
45      * a <code>provides</code> section.<br>
46      * This section defines a relation between the external address
47      * <em>"http://www.enterprise.com/webservices/myService"</em>, and an
48      * Endpoint <em>"myService/jbiMyServiceEndpoint"</em>.<br>
49      * A <em>"myService/jbiMyServiceEndpoint"</em> has been activated on the
50      * JBI environment.<br>
51      * <br>
52      * When a JBI consumer sends in the JBI environment a message to the
53      * <em>"myService/jbiMyServiceEndpoint"</em> endpoint, this component
54      * received the message, and calls the
55      * <code>onJBIMessage(address,endpoint)</code> method.<br>
56      * Then, the method has to send the message to
57      * <em>"http://www.enterprise.com/webservices/myService"</em>.
58      *
59      * @param address
60      * the external service address associated to the endpoint given
61      * in the incoming message exchange.
62      * @param exchange
63      * the message exchange to process, wrapped to add some util
64      * methods. Not null
65      * @param extensions
66      * JBI descriptor extensions. The message exchange targets a
67      * specific endpoint, this endpoint has been activated during the
68      * processing of a provides node of a service unit jbi
69      * descriptor. Theses extensions are the extensions of this
70      * provides node. Can be null
71      *
72      * @return boolean used in case of IN_OPTIONAL_OUT_PATTERN. Set to true if
73      * there's an out message to send, false otherwise. In all cases, a
74      * <em>DONE</em> status message is returned to the initiator of
75      * the exchange (except if <code>onJBIMessage()</code> set the
76      * exchange to <em>ERROR</em>)
77      * @throws HandlingException
78      * If an error occurs during processing. If the MEP allows it, a
79      * Fault is automatically returned on the MessageExchange.
80      */

81     boolean onJBIMessage(String JavaDoc address, MessageExchangeWrapper exchange,
82             Extensions extensions) throws HandlingException;
83
84 }
85
Popular Tags