View Javadoc

1   package org.codehaus.xfire;
2   
3   
4   /***
5    * <p>
6    * The XFireFactory class allows you to embed XFire within your
7    * apps easily.
8    * </p>
9    * <p>
10   * This class assumes one XFire instance per JVM. To create many 
11   * XFire instances you must use your own configuration and instantiation
12   * mechanism.
13   * </p>
14   * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
15   */
16  public class XFireFactory
17  {
18      private static XFireFactory standalone;
19      
20      private XFire xfire;
21      
22      private XFireFactory() 
23          throws Exception
24      {
25          xfire = new DefaultXFire();
26      }
27  
28  	public static XFireFactory newInstance() 
29          throws Exception
30      {
31          if (standalone == null)
32  		{
33  			synchronized (XFireFactory.class)
34  			{
35  				standalone = new XFireFactory();
36  			}
37  		}
38  		return standalone;
39      }    
40     
41      public XFire getXFire() throws Exception
42      {
43          return xfire;
44      }
45  }