View Javadoc

1   /*
2    * Copyright (c) 2004 Peter Antman, Mogul  <peter.antman@mogul.com>
3    *
4    * $Id: RECProtocolHandler.java,v 1.1.1.1 2004/05/19 12:22:46 pra Exp $
5    *
6    * This library is free software; you can redistribute it and/or
7    * modify it under the terms of the GNU Lesser General Public
8    * License as published by the Free Software Foundation; either
9    * version 2 of the License, or (at your option) any later version
10   * 
11   * This library is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14   * Lesser General Public License for more details.
15   * 
16   * You should have received a copy of the GNU Lesser General Public
17   * License along with this library; if not, write to the Free Software
18   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19   */
20  package org.backsource.amsterdam.service.protocol;
21  
22  import org.backsource.amsterdam.service.ServiceMessage;
23  import org.backsource.amsterdam.service.ServiceException;
24  
25  /***
26     Minimum interface a RECProtocolHandler must support.
27     
28     The basic logic is that the ProtocolHandlerFactory is responsible for making
29     one or more RECProtocolHandlers available to the service calling into the amsterdam chain. This might be done be registering the handler in JNDI and letting the caller look it up and call, or by the factory sharing a service which holds a reference to the handler.
30     *
31     * @author <a href="mailto:pra@mogul.com">Peter Antman</a>
32     * @version $Revision: 1.1.1.1 $
33     */
34  
35  public interface RECProtocolHandler extends ProtocolHandler {
36     /***
37      * Send a service message down the chain.
38      *
39      * The object invoking this method has NO responisbility to treat stuff like the container invoker, InvokerWorker and Worker queues. It is up to the protocol handler in question to do this sort of things.
40      *
41      * A good behaving handler should set the context classloader to that of
42      * the service.
43      */
44     public void onMessage(ServiceMessage message) throws ServiceException;
45     
46     /***
47      * Each handler should have a unique name (much like an url for a getter).
48      */
49     public String getName();
50     
51  }// RECProtocolHandler