View Javadoc

1   package org.codehaus.xfire.loom;
2   
3   import org.apache.avalon.framework.service.ServiceException;
4   import org.apache.avalon.framework.service.ServiceManager;
5   import org.apache.avalon.framework.service.Serviceable;
6   import org.codehaus.xfire.DefaultXFire;
7   import org.codehaus.xfire.service.ServiceRegistry;
8   import org.codehaus.xfire.transport.TransportManager;
9   
10  /***
11   * An instance of XFire that is managed by Loom / Phoenix.
12   *
13   * @author <a href="mailto:peter.royal@pobox.com">Peter Royal</a>
14   */
15  public class LoomXFire
16          extends DefaultXFire
17          implements Serviceable
18  {
19      private ServiceRegistry m_serviceRegistry;
20      private TransportManager m_transportManager;
21  
22      public LoomXFire()
23      {
24          super(null, null); // Use this to prevent component instantiation in the superclass default cxtor
25      }
26  
27      public ServiceRegistry getServiceRegistry()
28      {
29          return m_serviceRegistry;
30      }
31  
32      public TransportManager getTransportManager()
33      {
34          return m_transportManager;
35      }
36  
37      public void service(final ServiceManager manager)
38              throws ServiceException
39      {
40          m_serviceRegistry = (ServiceRegistry) manager.lookup(ServiceRegistry.ROLE);
41          m_transportManager = (TransportManager) manager.lookup(TransportManager.ROLE);
42      }
43  }