package org.codehaus.xfire;

import java.io.InputStream;
import java.io.OutputStream;

import javax.xml.stream.XMLStreamReader;

import org.codehaus.xfire.service.ServiceRegistry;
import org.codehaus.xfire.transport.TransportManager;

/**
 * <p>Central processing point for XFire. This can be instantiated
 * programmatically by using one of the implementations (such as
 * <code>DefaultXFire</code> or can be managed by a container like
 * Pico or Plexus.
 * </p>
 * <p>
 * Central, however, does not mean that there can be only one. 
 * Implementations can be very lightweight, creating fast generic 
 * SOAP processors.
 * </p>
 * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
 * @since Feb 18, 2004
 */
public interface XFire
{
	final public static String ROLE = XFire.class.getName();

	/**
	 * Processes a new SOAP Message request.  If a fault
     * or exception occurs, it is written to the OutputStream
     * in the <code>MessageContext</code>.  However, 
     * <code>XFireRuntimeException</code>s may still be thrown if
     * something fatal goes wrong in the pipeline.
     * 
     * @param in An InputStream to the SOAP document.
     * @param context The MessageContext.
	 */
    void invoke( InputStream in,
                 MessageContext context );

	/**
	 * Processes a new SOAP Message request.  If a fault
     * or exception occurs, it is written to the OutputStream
     * in the <code>MessageContext</code>.  However, 
     * <code>XFireRuntimeException</code>s may still be thrown if
     * something fatal goes wrong in the pipeline.
     * 
     * @param in An InputStream to the SOAP document.
     * @param context The MessageContext.
	 */
    void invoke( XMLStreamReader reader,
                 MessageContext context );

    /**
     * Generate WSDL for a service.
     * 
     * @param service The name of the service.
     * @param out The OutputStream to write the WSDL to.
     */
    void generateWSDL(String service, OutputStream out);

    /**
     * Get the <code>ServiceRegistry</code>.
     */
    ServiceRegistry getServiceRegistry();
    
    /**
     * Get the <code>TransportManager</code>.
     */
    TransportManager getTransportManager();
}
@@ -855,142 +855,103 @@
 st. 
- If a fault%0A     * or exception occurs, it is written to the OutputStream%0A     * in the %3Ccode%3EM
+Faults are handled%0A     * according to the m
 essage
-Context%3C/code%3E.  However, 
+ contract of the particular service.
 %0A     *
+ A
  %3Cco
@@ -1182,17 +1182,16 @@
  invoke(
- 
 InputStr
@@ -1197,33 +1197,16 @@
 ream in,
-%0A                
  Message
@@ -1224,18 +1224,54 @@
 text
- 
 )
+%0A        throws XFireRuntimeException
 ;%0A%0A%09/**%0A
 %09 * 
@@ -1258,33 +1258,36 @@
 xception;%0A%0A%09/**%0A
-%09
+    
  * Processes a n
@@ -1315,142 +1315,103 @@
 st. 
- If a fault%0A     * or exception occurs, it is written to the OutputStream%0A     * in the %3Ccode%3EM
+Faults are handled%0A     * according to the m
 essage
-Context%3C/code%3E.  However, 
+ contract of the particular service.
 %0A     *
+ A
  %3Cco
@@ -1642,17 +1642,16 @@
  invoke(
- 
 XMLStrea
@@ -1669,25 +1669,8 @@
 der,
-%0A                
  Mes
@@ -1692,10 +1692,46 @@
 text
- 
 )
+%0A        throws XFireRuntimeException
 ;%0A%0A 
@@ -1802,16 +1802,34 @@
  service
+%0A     *           
  The nam
@@ -1863,16 +1863,34 @@
 aram out
+%0A     *           
  The Out

update javadocs