View Javadoc

1   /*
2    * Copyright (c) 2004 Peter Antman, Mogul  <peter.antman@mogul.com>
3    *
4    * $Id: RECProtocolHandlerSupport.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  import org.backsource.amsterdam.service.ServiceMessage;
22  import org.backsource.amsterdam.service.InvokerWorker;
23  import org.backsource.amsterdam.service.Mission;
24  import org.backsource.amsterdam.service.MissionSupport;
25  import org.backsource.amsterdam.service.ServiceException;
26  import org.backsource.amsterdam.service.workerqueue.WorkerQueue;
27  /***
28   * RECProtocolHandlerSupport.java
29   *
30   *
31   * Created: Tue Mar 23 18:24:19 2004
32   *
33   * @author <a href="mailto:pra@mogul.com">Peter Antman</a>
34   * @version $Revision: 1.1.1.1 $
35   */
36  
37  public class RECProtocolHandlerSupport extends ProtocolHandlerSupport implements RECProtocolHandler{
38      String name;
39     public RECProtocolHandlerSupport (){
40        
41     }
42     public String getName() {
43  	return name;
44      }
45  
46      public void setName(String name) {
47  	this.name = name;
48      }
49      public void onMessage(ServiceMessage message) throws ServiceException {
50  	InvokerWorker w = getServiceInvoker().getWorker();
51  	WorkerQueue q = getServiceInvoker().getWorkerQueue();
52  	Mission m = new MissionSupport(Mission.REC_MISSION);
53  	m.setMission(message);
54  	w.setMission(m);
55  	q.execute(w);
56      }
57      
58      public void close() {}
59  }// RECProtocolHandlerSupport