cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r560509 - in /incubator/cxf/trunk: rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/ rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/ rt/transports/http-jetty/src/main/resources/sc...
Date Sat, 28 Jul 2007 07:26:45 GMT
Author: ningjiang
Date: Sat Jul 28 00:26:42 2007
New Revision: 560509

URL: http://svn.apache.org/viewvc?view=rev&rev=560509
Log:
[CXF-795] Added the spring configuration of Jetty Engine

Now CXF support to configure the Jetty Engine's connector and handlers by using the spring beans syntax 

Also updated the systest SessionServer to open the sessionSupport flage (which default value is false) by loading configuration file

NOTE:
Please take the http-jetty unit test file beans.xml as an example



Added:
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JAXBHelper.java   (with props)
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHttpServerEngineBeanDefinitionParser.java   (with props)
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/invalide-engines.xml   (with props)
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/server-engine-factory.xml
      - copied unchanged from r560488, incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/server-engine-factory.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/SessionServer.xml   (with props)
Removed:
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryConfig.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/server-engine-factory.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/client1.xml
Modified:
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/NamespaceHandler.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactoryTest.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/serverenginefactory.xml
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/SessionServer.java

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java?view=diff&rev=560509&r1=560508&r2=560509
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java Sat Jul 28 00:26:42 2007
@@ -100,11 +100,8 @@
         engine = 
             serverEngineFactory.retrieveJettyHTTPServerEngine(nurl.getPort());
         if (engine == null) {
-            engine = "https".equals(nurl.getProtocol())
-                // https
-                ? serverEngineFactory.createJettyHTTPSServerEngine(nurl.getPort())
-                // http
-                : serverEngineFactory.createJettyHTTPServerEngine(nurl.getPort());
+            engine = serverEngineFactory.
+                createJettyHTTPServerEngine(nurl.getPort(), nurl.getProtocol());
         }
         
         assert engine != null;

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java?view=diff&rev=560509&r1=560508&r2=560509
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java Sat Jul 28 00:26:42 2007
@@ -22,20 +22,27 @@
 import java.io.IOException;
 import java.net.URL;
 import java.security.GeneralSecurityException;
+import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+
 import org.apache.cxf.Bus;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.configuration.jsse.TLSServerParameters;
 import org.apache.cxf.transport.HttpUriMapper;
 import org.apache.cxf.transport.https_jetty.JettySslConnectorFactory;
 import org.mortbay.jetty.AbstractConnector;
+import org.mortbay.jetty.Connector;
 import org.mortbay.jetty.Handler;
 import org.mortbay.jetty.Server;
 import org.mortbay.jetty.handler.ContextHandler;
 import org.mortbay.jetty.handler.ContextHandlerCollection;
+import org.mortbay.jetty.handler.HandlerList;
 import org.mortbay.jetty.nio.SelectChannelConnector;
+import org.mortbay.jetty.security.SslSocketConnector;
 import org.mortbay.jetty.servlet.HashSessionIdManager;
 import org.mortbay.jetty.servlet.HashSessionManager;
 import org.mortbay.jetty.servlet.SessionHandler;
@@ -58,31 +65,31 @@
     /**
      * The bus.
      */
-    private final Bus bus;
+    private Bus bus;
     
     /**
      * This is the Jetty HTTP Server Engine Factory. This factory caches some 
      * engines based on port numbers.
      */
-    private final JettyHTTPServerEngineFactory factory;
+    private JettyHTTPServerEngineFactory factory;
     
     
     /**
      * This is the network port for which this engine is allocated.
      */
-    private final int port;
+    private int port;
     
     /**
      * This field holds the protocol for which this engine is 
      * enabled, i.e. "http" or "https".
      */
-    private String protocol;
-    
+    private String protocol = "http";    
     
-    private Boolean isSessionSupport = true;
+    private Boolean isSessionSupport = false;
     private int servantCount;
     private Server server;
-    private AbstractConnector connector;
+    private Connector connector;
+    private List<Handler> handlers;
     private JettyConnectorFactory connectorFactory;
     private ContextHandlerCollection contexts;
     
@@ -91,7 +98,7 @@
      * configured. The tlsServerParamers (due to JAXB) holds the struct
      * placed by SpringConfig.
      */
-    private TLSServerParameters tlsProgrammaticServerParameters;
+    private TLSServerParameters tlsServerParameters;
     
     /**
      * This field hold the threading parameters for this particular engine.
@@ -105,7 +112,7 @@
     private boolean configFinalized;
     
     /**
-     * This constructor is solely called by the JettyHTTPServerEngineFactory.
+     * This constructor is called by the JettyHTTPServerEngineFactory.
      */
     JettyHTTPServerEngine(
         JettyHTTPServerEngineFactory fac, 
@@ -116,13 +123,26 @@
         this.port    = port;
     }
     
+    public JettyHTTPServerEngine() {
+        
+    }
+     
+    public void setJettyHTTPServerEngineFactory(JettyHTTPServerEngineFactory fac) {
+        factory = fac;
+    }
+    
+    public void setPort(int p) {
+        port = p;
+    }
     /**
      * The bus.
      */
-    public Bus getBus() {
-        return bus;
+    @Resource(name = "bus")
+    public void setBus(Bus b) {
+        bus = b;
     }
     
+    
     /**
      * Returns the protocol "http" or "https" for which this engine
      * was configured.
@@ -139,6 +159,7 @@
         return port;
     }
     
+    
     /**
      * This method will shut down the server engine and
      * remove it from the factory's cache. 
@@ -164,6 +185,39 @@
     }
     
     /**
+     * set the jetty server's connector
+     * @param c
+     */
+    public void setConnector(Connector c) {
+        connector = c;
+    }
+    
+    /**
+     * set the jetty server's handlers
+     * @param h
+     */
+    
+    public void setHandlers(List<Handler> h) {
+        handlers = h;
+    }
+    
+    public void setSessionSupport(boolean support) {
+        isSessionSupport = support;
+    }
+    
+    public boolean isSessionSupport() {
+        return isSessionSupport;
+    }
+    
+    public List<Handler> getHandlers() {
+        return handlers;
+    }
+    
+    public Connector getConnector() {
+        return connector;
+    }
+    
+    /**
      * Register a servant.
      * 
      * @param url the URL associated with the servant
@@ -173,17 +227,25 @@
         if (server == null) {
             // create a new jetty server instance if there is no server there            
             server = new Server();
-            
-            connector = connectorFactory.createConnector(port);
-            
-            server.addConnector(connector);
+            if (connector == null) {
+                connector = connectorFactory.createConnector(port);
+            } 
+            server.addConnector(connector);            
+            if (handlers != null && handlers.size() > 0) {
+                HandlerList handlerList = new HandlerList();
+                for (Handler h : handlers) {
+                    handlerList.addHandler(h);
+                }
+                server.addHandler(handlerList);
+            }
             contexts = new ContextHandlerCollection();
-            server.addHandler(contexts);
+            server.addHandler(contexts);            
             try {
                 server.start();
-                if (connector.getThreadPool() instanceof BoundedThreadPool
+                AbstractConnector aconn = (AbstractConnector) connector;
+                if (aconn.getThreadPool() instanceof BoundedThreadPool
                     && isSetThreadingParameters()) {
-                    BoundedThreadPool pool = (BoundedThreadPool)connector.getThreadPool();
+                    BoundedThreadPool pool = (BoundedThreadPool)aconn.getThreadPool();
                     if (getThreadingParameters().isSetMinThreads()) {
                         pool.setMinThreads(getThreadingParameters().getMinThreads());
                     }
@@ -209,9 +271,7 @@
         
         // bind the jetty http hanler with the context handler        
         context.setHandler(handler);
-        if (isSessionSupport) {
-            // just add the session manager here by code
-            // TODO adding the configuration support for session manager
+        if (isSessionSupport) {            
             HashSessionManager sessionManager = new HashSessionManager();
             SessionHandler sessionHandler = new SessionHandler(sessionManager);
             HashSessionIdManager idManager = new HashSessionIdManager();
@@ -335,12 +395,21 @@
     }
 
     protected void retrieveListenerFactory() {
-        if (tlsProgrammaticServerParameters != null) {
+        if (tlsServerParameters != null) {
             connectorFactory = 
-                getHTTPSConnectorFactory(tlsProgrammaticServerParameters);
+                getHTTPSConnectorFactory(tlsServerParameters);            
+            if (null != connector && !(connector instanceof SslSocketConnector)) {                         
+                throw new RuntimeException("JettyServerEngine Port " 
+                        + port + " has not configured for ssl connector :" + connector);                
+            }
             protocol = "https";
+            
         } else {
-            connectorFactory = getHTTPConnectorFactory();
+            connectorFactory = getHTTPConnectorFactory();            
+            if (connector instanceof SslSocketConnector) {
+                throw new RuntimeException("JettyServerEngine Port " 
+                      + port + " has configured for ssl connector :" + connector);
+            }
             protocol = "http";
         }
         LOG.fine("Configured port " + port + " for \"" + protocol + "\".");
@@ -379,13 +448,29 @@
     /**
      * This method is called after configure on this object.
      */
+    @PostConstruct
     protected void finalizeConfig() 
         throws GeneralSecurityException,
                IOException {
+        retrieveEngineFactory();
         retrieveListenerFactory();
+        checkConnectorPort();
         this.configFinalized = true;
     }
     
+    private void retrieveEngineFactory() {
+        if (null != bus && null == factory) {
+            factory = bus.getExtension(JettyHTTPServerEngineFactory.class);
+        }        
+    }
+
+    private void checkConnectorPort() throws IOException {
+        if (null != connector && port != connector.getPort()) {
+            throw new IOException("The connector's port is not match"
+                        + " with the server engine port!");
+        }
+    }
+    
     /**
      * This method is called by the ServerEngine Factory to destroy the 
      * listener.
@@ -403,9 +488,11 @@
     /**
      * This method is used to programmatically set the TLSServerParameters.
      * This method may only be called by the factory.
+     * @throws IOException 
      */
-    protected void setProgrammaticTlsServerParameters(TLSServerParameters params) {
-        tlsProgrammaticServerParameters = params;
+    public void setTlsServerParameters(TLSServerParameters params) throws IOException {
+        
+        tlsServerParameters = params;
         if (this.configFinalized) {
             this.retrieveListenerFactory();
         }
@@ -417,8 +504,8 @@
      * in SpringConfiguration.
      * @return
      */
-    protected TLSServerParameters getProgrammaticTlsServerParameters() {
-        return tlsProgrammaticServerParameters;
+    public TLSServerParameters getTlsServerParameters() {
+        return tlsServerParameters;
     } 
 
     /**
@@ -426,7 +513,7 @@
      * server engine.
      * This method may only be called by the factory.
      */
-    public void setThreadingParameters(ThreadingParameters params) {
+    public void setThreadingParameters(ThreadingParameters params) {        
         threadingParameters = params;
     }
     

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java?view=diff&rev=560509&r1=560508&r2=560509
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java Sat Jul 28 00:26:42 2007
@@ -21,6 +21,7 @@
 import java.io.IOException;
 import java.security.GeneralSecurityException;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
 import java.util.logging.Logger;
@@ -31,7 +32,9 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.configuration.jsse.TLSServerParameters;
-import org.apache.cxf.transport.http_jetty.spring.JettyHTTPServerEngineFactoryConfig;
+
+
+
 
 /**
  * This Bus Extension handles the configuration of network port
@@ -41,10 +44,8 @@
  */
 public class JettyHTTPServerEngineFactory {
     private static final Logger LOG =
-        LogUtils.getL7dLogger(JettyHTTPServerEngineFactory.class);
+        LogUtils.getL7dLogger(JettyHTTPServerEngineFactory.class);    
     
-    private static final int FALLBACK_THREADING_PARAMS_KEY = 0;
-
     /**
      * This map holds references for allocated ports.
      */
@@ -68,25 +69,24 @@
     
     /**
      * This map holds the threading parameters that are to be applied
-     * to new Engines when bound to a specified port.
+     * to new Engines when bound to the reference id.
      */
-    private Map<Integer, ThreadingParameters> threadingParametersMap =
-        new TreeMap<Integer, ThreadingParameters>();
+    private Map<String, ThreadingParameters> threadingParametersMap =
+        new TreeMap<String, ThreadingParameters>();
     
     /**
      * This map holds TLS Server Parameters that are to be used to
      * configure a subsequently created JettyHTTPServerEngine.
      */
-    private Map<Integer, TLSServerParameters> tlsParametersMap =
-        new TreeMap<Integer, TLSServerParameters>();
+    private Map<String, TLSServerParameters> tlsParametersMap =
+        new TreeMap<String, TLSServerParameters>();
+    
     
     /**
      * The bus.
      */
     private Bus bus;
     
-    private JettyHTTPServerEngineFactoryConfig factorySpringConfig;
-    
     public JettyHTTPServerEngineFactory() {
         // Empty
     }
@@ -101,76 +101,48 @@
         this.bus = bus;
     }
     
-    @Resource
-    public void setConfig(JettyHTTPServerEngineFactoryConfig config) {
-        factorySpringConfig = config;
-    }
     
     @PostConstruct
     public void registerWithBus() {
         bus.setExtension(this, JettyHTTPServerEngineFactory.class);
     }
     
-    @PostConstruct
-    public void configureSpring() {
-        if (factorySpringConfig != null) {
-            factorySpringConfig.configureServerEngineFactory(this);
-        }
-    }
     
     /**
-     * This call sets TLSServerParameters for a JettyHTTPServerEngine
-     * that will be subsequently created. It will not alter an engine
-     * that has already been created for that network port.
-     * @param port       The network port number to bind to the engine.
-     * @param tlsParams  The tls server parameters. Cannot be null.
-     */
-    public void setTLSServerParametersForPort(
-        int port, 
-        TLSServerParameters tlsParams) {
-        if (tlsParams == null) {
-            throw new IllegalArgumentException("tlsParams cannot be null");
-        }
-        tlsParametersMap.put(port, tlsParams);
-    }
-
-    /**
-     * This call removes any TLSParameters that have been placed
-     * on the port arguments. This call will not affect a server engine
-     * already in existence for that port. 
-     * @param port
+     * This call sets TLSParametersMap for a JettyHTTPServerEngine
+     * 
      */
-    public void removeTLSServerParametersForPort(int port) {
-        tlsParametersMap.remove(port);
+    public void setTlsServerParametersMap(
+        Map<String, TLSServerParameters>  tlsParamsMap) {
+        
+        tlsParametersMap = tlsParamsMap;
     }
     
-    /**
-     * This call sets the ThreadingParameters for a JettyHTTPServerEngine
-     * that will be subsequently created. It will not alter an
-     * engine that has already ben creatd for that network port.
-     * @param port            The network port number to bind to the engine.
-     * @param threadingParams The threading parameters. Cannot be null.
-     */
-    public void setThreadingParametersForPort(
-        int port,
-        ThreadingParameters threadingParams) {
-        if (threadingParams == null) {
-            throw new IllegalArgumentException(
-                    "threadingParameters cannot be null");
-        }
-        threadingParametersMap.put(port, threadingParams);
+    public Map<String, TLSServerParameters> getTlsServerParametersMap() {
+        return tlsParametersMap;
+    }
+    
+    public void setEnginesList(List<JettyHTTPServerEngine> enginesList) {
+        for (JettyHTTPServerEngine engine : enginesList) { 
+            portMap.put(engine.getPort(), engine);
+        }    
     }
     
     /**
-     * This call removes any ThreadingParameters that have been placed
-     * on the port arguments. This call will not affect a server engine
-     * already in existence for that port. 
-     * @param port
+     * This call sets the ThreadingParameters for a JettyHTTPServerEngine
+     * 
      */
-    public void removeThreadingParametersForPort(int port) {
-        threadingParametersMap.remove(port);
+    public void setThreadingParametersMap(
+        Map<String, ThreadingParameters> threadingParamsMap) {
+        
+        threadingParametersMap = threadingParamsMap;
     }
     
+    public Map<String, ThreadingParameters> getThreadingParamtersMap() {
+        return threadingParametersMap;
+    }
+            
+    
     /**
      * This call retrieves a previously configured JettyHTTPServerEngine for the
      * given port. If none exists, this call returns null.
@@ -189,82 +161,25 @@
      * engine is being Spring configured for TLS a GeneralSecurityException
      * may be thrown.
      */
-    protected synchronized JettyHTTPServerEngine createJettyHTTPServerEngine(int port)
-        throws GeneralSecurityException, IOException {
-        
-        TLSServerParameters tlsParams = tlsParametersMap.get(port);
-
-        if (tlsParams != null) {
-            throw new RuntimeException("Port " 
-                    + port + " is configured for TLS");
-        }
-        
-        JettyHTTPServerEngine ref = 
-            new JettyHTTPServerEngine(this, bus, port);
-
-        ref.setProgrammaticTlsServerParameters(tlsParams);
-        
-        applyThreadingParameters(ref, port);
-        
-        ref.finalizeConfig();
-        portMap.put(port, ref);
-        return ref;
-    }
-
-    /**
-     * This call creates a new JettyHTTPServerEngine initialized for "https"
-     * on the given port. The configuration for "https"
-     * will depend on configuration of the engine's bean name, then default,
-     * then parameter map.
-     * 
-     * If an JettyHTTPEngine already exists, or the port
-     * is already in use, a BindIOException will be thrown. If the 
-     * engine is being Spring configured for TLS a GeneralSecurityException
-     * may be thrown.
-     */
-    protected synchronized JettyHTTPServerEngine createJettyHTTPSServerEngine(int port)
+    protected synchronized JettyHTTPServerEngine createJettyHTTPServerEngine(int port, String protocol)
         throws GeneralSecurityException, IOException {
-
-        LOG.fine("Creating Jetty HTTP Server Engine for port " + port + ".");
-        
-        JettyHTTPServerEngine ref = 
-            new JettyHTTPServerEngine(this, bus, port);
-        
-        // Configuration of the Factory 
-        TLSServerParameters tlsParams = tlsParametersMap.get(port);
-        if (tlsParams != null) {
-            ref.setProgrammaticTlsServerParameters(tlsParams);
-        } else {
-            throw new RuntimeException("Port " 
-                    + port + " is not configured for TLS");
+        LOG.fine("Creating Jetty HTTP Server Engine for port " + port + ".");        
+        JettyHTTPServerEngine ref = retrieveJettyHTTPServerEngine(port);
+        if (null == ref) {
+            ref = new JettyHTTPServerEngine(this, bus, port);            
+            portMap.put(port, ref);
+            ref.finalizeConfig();
+        } 
+        // checking the protocol    
+        if (!protocol.equals(ref.getProtocol())) {
+            throw new IOException("setting a wrong protocol, "
+                        + "engine's protocol is " + ref.getProtocol()
+                        + "the url protocol is " + protocol);
         }
-        
-        applyThreadingParameters(ref, port);
-        
-        ref.finalizeConfig();
-        portMap.put(port, ref);
+                
         return ref;
     }
 
-    /**
-     * Apply the thread paramaters to the newly created engine,
-     * falling back to non-port specific values if necessary.
-     * 
-     * @param engine the new created engine
-     * @param port the listen port
-     */
-    protected void applyThreadingParameters(JettyHTTPServerEngine engine, int port) {
-        ThreadingParameters params = threadingParametersMap.get(port);
-        if (params != null) {
-            engine.setThreadingParameters(params);
-        } else {
-            ThreadingParameters fallback =
-                threadingParametersMap.get(FALLBACK_THREADING_PARAMS_KEY);
-            if (fallback != null) {
-                engine.setThreadingParameters(fallback);
-            }
-        }
-    }
     
     /**
      * This method removes the Server Engine from the port map and stops it.

Added: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JAXBHelper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JAXBHelper.java?view=auto&rev=560509
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JAXBHelper.java (added)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JAXBHelper.java Sat Jul 28 00:26:42 2007
@@ -0,0 +1,126 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.transport.http_jetty.spring;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.namespace.QName;
+
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+
+public final class JAXBHelper {
+    private JAXBHelper() {
+        
+    }
+    
+    @SuppressWarnings("unchecked")
+    public static <V> List<V> parseListElement(Element parent, 
+                                           BeanDefinitionBuilder bean, 
+                                           QName name, 
+                                           Class<?> c) throws JAXBException {                                
+        List<V> list = new ArrayList<V>();
+        NodeList nl = parent.getChildNodes();
+        Node data = null;
+           
+        JAXBContext context = null;
+        String pkg = "";
+        if (null != c) {
+            pkg = c.getPackage().getName();
+            context = JAXBContext.newInstance(pkg, c.getClassLoader());
+        } else {
+            context = JAXBContext.newInstance(pkg);
+        }
+           
+           
+        for (int i = 0; i < nl.getLength(); i++) {
+            Node n = nl.item(i);
+            if (n.getNodeType() == Node.ELEMENT_NODE && name.getLocalPart().equals(n.getLocalName())
+                && name.getNamespaceURI().equals(n.getNamespaceURI())) {
+                data = n;
+                Object obj = unmarshal(context, data, c);                
+                if (obj != null) {                    
+                    list.add((V) obj);
+                }
+            }
+        }
+        return list;
+    }
+    
+    
+    public static <T> T parseElement(Element element, 
+                               BeanDefinitionBuilder bean, 
+                               Class<T> c) throws JAXBException {
+        if (null == element) {
+            return null;
+        }
+        JAXBContext context = null;
+        String pkg = "";
+        if (null != c) {
+            pkg = c.getPackage().getName();
+            context = JAXBContext.newInstance(pkg, c.getClassLoader());
+        } else {
+            context = JAXBContext.newInstance(pkg);
+        }
+        Object obj = unmarshal(context, element, c);
+        
+        return c.cast(obj);
+    }
+    
+    
+    private static Object unmarshal(JAXBContext context,
+                                     Node data, Class<?> c) {
+        if (context == null) {
+            return null;
+        }
+        
+        Object obj = null;
+        
+        try {
+            
+            Unmarshaller u = context.createUnmarshaller();
+            if (c != null) {
+                obj = u.unmarshal(data, c);
+            } else {
+                obj = u.unmarshal(data);
+            }
+
+            if (obj instanceof JAXBElement<?>) {
+                JAXBElement<?> el = (JAXBElement<?>)obj;
+                obj = el.getValue();
+            }
+           
+        } catch (JAXBException e) {
+            throw new RuntimeException("Could not parse configuration.", e);
+        }
+        
+        return obj; 
+        
+    }
+               
+
+}

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JAXBHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JAXBHelper.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java?view=diff&rev=560509&r1=560508&r2=560509
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java Sat Jul 28 00:26:42 2007
@@ -18,48 +18,135 @@
  */
 package org.apache.cxf.transport.http_jetty.spring;
 
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.Unmarshaller;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+
+import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.configuration.jsse.TLSServerParameters;
+import org.apache.cxf.configuration.jsse.spring.TLSServerParametersConfig;
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
 import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory;
-import org.apache.cxf.transports.http_jetty.configuration.JettyHTTPServerEngineFactoryConfigType;
+import org.apache.cxf.transport.http_jetty.ThreadingParameters;
+
+import org.apache.cxf.transports.http_jetty.configuration.TLSServerParametersIdentifiedType;
+import org.apache.cxf.transports.http_jetty.configuration.ThreadingParametersIdentifiedType;
+import org.apache.cxf.transports.http_jetty.configuration.ThreadingParametersType;
+
+
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.support.ManagedList;
 import org.springframework.beans.factory.xml.ParserContext;
 
 public class JettyHTTPServerEngineFactoryBeanDefinitionParser
         extends AbstractBeanDefinitionParser {
+    private static final String HTTP_JETTY_NS = "http://cxf.apache.org/transports/http-jetty/configuration";
 
     @Override
-    public void doParse(Element engineFactory, ParserContext ctx, BeanDefinitionBuilder bean) {
-        // Unmarshal the JAXB Generated Type from Config 
-        JAXBContext context = null;
+    public void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
+        //bean.setAbstract(true);        
+        String bus = element.getAttribute("bus");
+         
         try {
-            context = JAXBContext.newInstance(
-                    JettyHTTPServerEngineFactoryConfigType.class.getPackage().getName(), 
-                    getClass().getClassLoader());
-            Unmarshaller u = context.createUnmarshaller();
-            
-            JAXBElement<JettyHTTPServerEngineFactoryConfigType> jaxb = 
-                u.unmarshal(engineFactory, 
-                        JettyHTTPServerEngineFactoryConfigType.class);
+            List <ThreadingParametersIdentifiedType> threadingParametersIdentifiedTypes = 
+                JAXBHelper.parseListElement(element, bean, 
+                                            new QName(HTTP_JETTY_NS, "identifiedThreadingParameters"), 
+                                            ThreadingParametersIdentifiedType.class);
+            Map<String, ThreadingParameters> threadingParametersMap =
+                toThreadingParameters(threadingParametersIdentifiedTypes);
+            List <TLSServerParametersIdentifiedType> tlsServerParameters =
+                JAXBHelper.parseListElement(element, bean, 
+                                            new QName(HTTP_JETTY_NS, "identifiedTLSServerParameters"),
+                                            TLSServerParametersIdentifiedType.class);
+            Map<String, TLSServerParameters> tlsServerParametersMap =
+                toTLSServerParamenters(tlsServerParameters);
+                                    
+            bean.addPropertyValue("threadingParametersMap", threadingParametersMap);
+            bean.addPropertyValue("tlsServerParametersMap", tlsServerParametersMap);
             
-            JettyHTTPServerEngineFactoryConfigType params = jaxb.getValue();
             
-            JettyHTTPServerEngineFactoryConfig config =
-                new JettyHTTPServerEngineFactoryConfig(params);
+            if (StringUtils.isEmpty(bus)) {
+                if (ctx.getRegistry().containsBeanDefinition("cxf")) {
+                    bean.addPropertyReference("bus", "cxf");
+                }
+            } else {
+                bean.addPropertyReference("bus", bus);
+            }
             
-            bean.addPropertyValue("config", config);
-            bean.addPropertyReference("bus", params.getBus());
+            // parser the engine list
+            List list = 
+                getRequiredElementsList(element, ctx, new QName(HTTP_JETTY_NS, "engine"), bean);
+            if (list.size() > 0) {
+                bean.addPropertyValue("enginesList", list);
+            }
             
         } catch (Exception e) {
             throw new RuntimeException("Could not process configuration.", e);
         }
+    }    
+    
+    @SuppressWarnings("unchecked")
+    private List getRequiredElementsList(Element parent, ParserContext ctx, QName name,
+                                         BeanDefinitionBuilder bean) {
+       
+        NodeList nl = parent.getChildNodes();
+        ManagedList list = new ManagedList(nl.getLength());
+        list.setSource(ctx.extractSource(parent));
+        for (int i = 0; i < nl.getLength(); i++) {
+            Node n = nl.item(i);
+            if (n.getNodeType() == Node.ELEMENT_NODE && name.getLocalPart().equals(n.getLocalName())
+                && name.getNamespaceURI().equals(n.getNamespaceURI())) {
+                list.add(ctx.getDelegate().
+                         parsePropertySubElement((Element)n, bean.getBeanDefinition()));
+
+            }
+        }
+        return list;
+    }
+    
+    private Map<String, ThreadingParameters> toThreadingParameters(
+        List <ThreadingParametersIdentifiedType> list) {
+        Map<String, ThreadingParameters> map = new TreeMap<String, ThreadingParameters>();
+        for (ThreadingParametersIdentifiedType t : list) {
+            ThreadingParameters parameter = 
+                toThreadingParameters(t.getThreadingParameters());
+            map.put(t.getId(), parameter);
+        } 
+        return map;
+    }
+    
+    private ThreadingParameters toThreadingParameters(ThreadingParametersType paramtype) {
+        ThreadingParameters params = new ThreadingParameters();
+        params.setMaxThreads(paramtype.getMaxThreads());
+        params.setMinThreads(paramtype.getMinThreads());
+        return params;
+    }
+        
+    private Map<String, TLSServerParameters> toTLSServerParamenters(
+        List <TLSServerParametersIdentifiedType> list) {
+        Map<String, TLSServerParameters> map = new TreeMap<String, TLSServerParameters>();
+        for (TLSServerParametersIdentifiedType t : list) {
+            try {             
+                TLSServerParameters parameter = new TLSServerParametersConfig(t.getTlsServerParameters());
+                map.put(t.getId(), parameter);
+            } catch (Exception e) {
+                throw new RuntimeException(
+                        "Could not configure TLS for id " + t.getId(), e);
+            }
+            
+        }
+        return map;
+        
     }
     
+          
     /*
      * We do not require an id from the configuration.
      * 

Added: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHttpServerEngineBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHttpServerEngineBeanDefinitionParser.java?view=auto&rev=560509
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHttpServerEngineBeanDefinitionParser.java (added)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHttpServerEngineBeanDefinitionParser.java Sat Jul 28 00:26:42 2007
@@ -0,0 +1,191 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.transport.http_jetty.spring;
+
+import java.util.List;
+import java.util.Map;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+import org.apache.cxf.configuration.jsse.TLSServerParameters;
+import org.apache.cxf.configuration.jsse.spring.TLSServerParametersConfig;
+import org.apache.cxf.configuration.security.TLSServerParametersType;
+import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
+import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine;
+import org.apache.cxf.transport.http_jetty.ThreadingParameters;
+import org.apache.cxf.transports.http_jetty.configuration.TLSServerParametersIdentifiedType;
+import org.apache.cxf.transports.http_jetty.configuration.ThreadingParametersIdentifiedType;
+import org.apache.cxf.transports.http_jetty.configuration.ThreadingParametersType;
+import org.springframework.beans.MutablePropertyValues;
+import org.springframework.beans.PropertyValue;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.xml.ParserContext;
+
+public class JettyHttpServerEngineBeanDefinitionParser extends AbstractBeanDefinitionParser {
+
+    
+    public void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
+        
+        String portStr = element.getAttribute("port");
+        int port = Integer.valueOf(portStr);
+        bean.addPropertyValue("port", port);
+               
+        MutablePropertyValues engineFactoryProperties = ctx.getContainingBeanDefinition().getPropertyValues();
+        PropertyValue busValue = engineFactoryProperties.getPropertyValue("bus");
+              
+        // get the property value from paranets
+        try {
+            
+            NodeList children = element.getChildNodes();
+            for (int i = 0; i < children.getLength(); i++) {
+                Node n = children.item(i);
+                if (n.getNodeType() == Node.ELEMENT_NODE) {
+                    String name = n.getLocalName();
+                    if ("tlsServerParameters".equals(name)) {
+                        
+                        TLSServerParametersType parametersType = 
+                            JAXBHelper.parseElement((Element)n, bean, TLSServerParametersType.class);
+                        
+                        TLSServerParametersConfig param = 
+                            new TLSServerParametersConfig(parametersType);
+                        
+                        bean.addPropertyValue("tlsServerParameters", param);
+                        
+                    } else if ("tlsServerParametersRef".equals(name)) {
+                        
+                        TLSServerParametersIdentifiedType parameterTypeRef = 
+                            JAXBHelper.parseElement((Element)n, bean, 
+                                                    TLSServerParametersIdentifiedType.class);
+                        
+                        TLSServerParameters param = 
+                            getServerParameters(engineFactoryProperties, parameterTypeRef.getId()); 
+                        bean.addPropertyValue("tlsServerParameters", param);
+                        
+                    } else if ("threadingParameters".equals(name)) {
+                        ThreadingParametersType parametersType = 
+                            JAXBHelper.parseElement((Element)n, bean, ThreadingParametersType.class);
+                        
+                        ThreadingParameters param = toThreadingParameters(parametersType);
+                        bean.addPropertyValue("threadingParameters", param);  
+                        
+                    } else if ("threadingParametersRef".equals(name)) {
+                        ThreadingParametersIdentifiedType parametersTypeRef =
+                            JAXBHelper.parseElement((Element)n, bean, 
+                                                    ThreadingParametersIdentifiedType.class);
+                        ThreadingParameters param = 
+                            getThreadingParameters(engineFactoryProperties, parametersTypeRef.getId());
+                        bean.addPropertyValue("threadingParameters", param);
+                        
+                    } else if ("connector".equals(name)) { 
+                        // only deal with the one connector here
+                        List list = 
+                            ctx.getDelegate().parseListElement((Element) n, bean.getBeanDefinition());
+                        bean.addPropertyValue("connector", list.get(0));
+                    } else if ("handlers".equals(name)) {
+                        List handlers = 
+                            ctx.getDelegate().parseListElement((Element) n, bean.getBeanDefinition());
+                        bean.addPropertyValue("handlers", handlers);
+                    } else if ("sessionSupport".equals(name)) {
+                        String text = n.getTextContent();
+                        System.out.println("sessionSupport is " + Boolean.valueOf(text));
+                        bean.addPropertyValue(name, Boolean.valueOf(text));
+                    }
+                        
+                }
+            }
+        } catch (Exception e) {
+            throw new RuntimeException("Could not process configuration.", e);
+        }
+        
+        bean.addPropertyValue("bus", busValue.getValue());        
+        
+        bean.setLazyInit(false);
+        
+    }
+    
+    private TLSServerParameters getServerParameters(
+             MutablePropertyValues engineFactoryProperties,
+             String reference) {
+        TLSServerParameters result = null;
+        PropertyValue tlsParameterMapValue  = 
+            engineFactoryProperties.getPropertyValue("tlsServerParametersMap");
+        if (null == tlsParameterMapValue) {
+            throw new RuntimeException("can't find the tlsParametersMap form transport factory!");
+        } else {
+            Map tlsServerParametersMap  = 
+                (Map)tlsParameterMapValue.getValue();
+            result = (TLSServerParameters)tlsServerParametersMap.get(reference);
+            if (result == null) {
+                throw new RuntimeException("can't find the reference [" 
+                                           + reference + "]'s mapping tlsParameter");
+            }
+        }
+        return result;
+    }
+    
+    private ThreadingParameters getThreadingParameters(
+             MutablePropertyValues engineFactoryProperties,
+             String reference) {
+        ThreadingParameters result = null;
+        PropertyValue threadingParametersMapValue = 
+            engineFactoryProperties.getPropertyValue("threadingParametersMap");
+        if (null == threadingParametersMapValue) {
+            throw new RuntimeException("can't find the threadingParametersMap form transport factory!");
+        } else {
+            Map threadingParametersMap  = (Map)threadingParametersMapValue.getValue();
+            result = (ThreadingParameters)threadingParametersMap.get(reference);
+            if (result == null) {
+                throw new RuntimeException("can't find the reference [" 
+                          + reference + "]'s mapping threadingParameters");
+            }
+        }     
+       
+        return result;
+    }    
+                                            
+    
+    private ThreadingParameters toThreadingParameters(
+                                    ThreadingParametersType paramtype) {
+        ThreadingParameters params = new ThreadingParameters();
+        params.setMaxThreads(paramtype.getMaxThreads());
+        params.setMinThreads(paramtype.getMinThreads());
+        return params;
+    }
+    
+       
+    /*
+     * We do not require an id from the configuration.
+     * 
+     * (non-Javadoc)
+     * @see org.springframework.beans.factory.xml.AbstractBeanDefinitionParser#shouldGenerateId()
+     */
+    @Override
+    protected boolean shouldGenerateId() {
+        return true;
+    }
+
+    @Override
+    protected Class getBeanClass(Element arg0) {
+        return JettyHTTPServerEngine.class;
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHttpServerEngineBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHttpServerEngineBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/NamespaceHandler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/NamespaceHandler.java?view=diff&rev=560509&r1=560508&r2=560509
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/NamespaceHandler.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/NamespaceHandler.java Sat Jul 28 00:26:42 2007
@@ -24,5 +24,7 @@
     public void init() {
         registerBeanDefinitionParser("engine-factory", 
                 new JettyHTTPServerEngineFactoryBeanDefinitionParser());
+        registerBeanDefinitionParser("engine",
+                                     new JettyHttpServerEngineBeanDefinitionParser());
     }
 }

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd?view=diff&rev=560509&r1=560508&r2=560509
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd Sat Jul 28 00:26:42 2007
@@ -75,7 +75,10 @@
                       type="tns:ThreadingParametersType"/>
           <xs:element name="threadingParametersRef"
                       type="tns:ParametersRefType"/>
-         </xs:choice>
+         </xs:choice>         
+         <xs:element name="connector" type="xsd:anyType" minOccurs="0"/>
+         <xs:element name="handlers" type="xsd:anyType" minOccurs="0"/>
+         <xs:element name="sessionSupport" type="xsd:boolean" minOccurs="0"/>          
        </xs:sequence>
           <xs:attribute name="port" type="xs:int" use="required"/>
     </xs:complexType>

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactoryTest.java?view=diff&rev=560509&r1=560508&r2=560509
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactoryTest.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactoryTest.java Sat Jul 28 00:26:42 2007
@@ -102,7 +102,7 @@
         // This file configures the factory to configure
         // port 1234 with default TLS.
         
-        URL config = getClass().getResource("server-engine-factory.cxf");
+        URL config = getClass().getResource("server-engine-factory.xml");
         
         bus = new SpringBusFactory().createBus(config, true);
         
@@ -115,13 +115,51 @@
         // This will throw an error if it is not.
         JettyHTTPServerEngine engine = null;
         try {
-            engine = factory.createJettyHTTPSServerEngine(1234);
+            engine = factory.createJettyHTTPServerEngine(1234, "https");
         } catch (Exception e) {
             fail("Error getting factory" + e);
         }
         assertNotNull("Engine is not available.", engine);
         assertEquals(1234, engine.getPort());
         assertEquals("Not https", "https", engine.getProtocol());
+        
+        try {
+            engine = factory.createJettyHTTPServerEngine(1234, "http");
+            fail("the engine's protcal should be https");
+        } catch (Exception e) {
+            // expect the exception
+        }
     }
+    
+    @Test
+    public void testAnInvalideConfiguresfile() {
+        
+        // This file configures the factory to configure
+        // port 1234 with default TLS.
+        
+        URL config = getClass().getResource("invalide-engines.xml");
+
+        bus = new SpringBusFactory().createBus(config);
+            
+        JettyHTTPServerEngineFactory factory =
+            bus.getExtension(JettyHTTPServerEngineFactory.class);
+            
+        assertNotNull("EngineFactory is not configured.", factory);
+
+
+        // The Engine for port 1234 was configured for TLS.
+        // and the connector which is injected into the engine
+        // should be an instance of SslSocketConnector
+        // here will throw an error if it is not.
+
+        
+        try {
+            factory.createJettyHTTPServerEngine(1234, "https");
+            fail("A configure error will should be thrown here ");            
+        } catch (Exception e) {
+            // experct the exception
+        }
+        
+    }   
 
 }

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java?view=diff&rev=560509&r1=560508&r2=560509
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java Sat Jul 28 00:26:42 2007
@@ -26,6 +26,8 @@
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.net.URLConnection;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.configuration.Configurer;
@@ -37,7 +39,11 @@
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.mortbay.jetty.Connector;
+import org.mortbay.jetty.Handler;
 import org.mortbay.jetty.handler.ContextHandler;
+import org.mortbay.jetty.nio.SelectChannelConnector;
+import org.mortbay.jetty.security.SslSocketConnector;
 
 public class JettyHTTPServerEngineTest extends Assert {
 
@@ -62,7 +68,7 @@
     @Test
     public void testEngineRetrieval() throws Exception {
         JettyHTTPServerEngine engine = 
-            factory.createJettyHTTPServerEngine(1234);
+            factory.createJettyHTTPServerEngine(1234, "http");
         
         assertTrue(
             "Engine references for the same port should point to the same instance",
@@ -74,28 +80,80 @@
     @Test
     public void testHttpAndHttps() throws Exception {
         JettyHTTPServerEngine engine = 
-            factory.createJettyHTTPServerEngine(1234);
+            factory.createJettyHTTPServerEngine(1234, "http");
         
         assertTrue("Protocol must be http", 
                 "http".equals(engine.getProtocol()));
         
-        factory.setTLSServerParametersForPort(1235, new TLSServerParameters());
+        engine = new JettyHTTPServerEngine();
+        engine.setPort(1235);
+        engine.setTlsServerParameters(new TLSServerParameters());
+        engine.finalizeConfig();
+        
+        List<JettyHTTPServerEngine> list = new ArrayList<JettyHTTPServerEngine>();
+        list.add(engine);
+        factory.setEnginesList(list);
         
-        engine = factory.createJettyHTTPSServerEngine(1235);
+        engine = factory.createJettyHTTPServerEngine(1235, "https");
         
         assertTrue("Protocol must be https", 
                 "https".equals(engine.getProtocol()));
         
-        factory.removeTLSServerParametersForPort(1235);
+        
         factory.destroyForPort(1234);
         factory.destroyForPort(1235);
     }
     
+    
+    @Test 
+    public void testSetConnector() throws Exception {
+        JettyHTTPServerEngine engine = new JettyHTTPServerEngine();
+        Connector conn = new SslSocketConnector();
+        engine.setConnector(conn);
+        engine.setPort(9000);
+        try {
+            engine.finalizeConfig();
+            fail("We should get the connector not set with TSLServerParament exception ");
+        } catch (Exception ex) {
+            // expect the excepion            
+        }
+        
+        engine = new JettyHTTPServerEngine();        
+        conn = new SelectChannelConnector();
+        conn.setPort(9002);
+        engine.setConnector(conn);
+        engine.setPort(9000);
+        try {
+            engine.finalizeConfig();
+            fail("We should get the connector not set right port exception ");
+        } catch (Exception ex) {
+            // expect the excepion            
+        }
+        
+        engine = new JettyHTTPServerEngine();
+        conn = new SslSocketConnector();
+        conn.setPort(9003);
+        engine.setConnector(conn);
+        engine.setPort(9003);
+        engine.setTlsServerParameters(new TLSServerParameters());
+        try {
+            engine.finalizeConfig();
+        } catch (Exception ex) {
+            fail("we should not throw exception here");
+        }
+    }
+    
+    @Test
+    public void testSetSessionSupport() {
+        
+    }
+    
+    
     @Test 
     public void testaddServants() throws Exception {
         String urlStr = "http://localhost:1234/hello/test";
         JettyHTTPServerEngine engine = 
-            factory.createJettyHTTPServerEngine(1234);
+            factory.createJettyHTTPServerEngine(1234, "http");
         JettyHTTPTestHandler handler1 = new JettyHTTPTestHandler("string1");
         JettyHTTPTestHandler handler2 = new JettyHTTPTestHandler("string2");        
         engine.addServant(new URL(urlStr), handler1);
@@ -122,11 +180,37 @@
     }
     
     @Test 
+    public void testSetHandlers() throws Exception {
+        URL url = new URL("http://localhost:1245/hello/test");
+        JettyHTTPTestHandler handler1 = new JettyHTTPTestHandler("string1");
+        JettyHTTPTestHandler handler2 = new JettyHTTPTestHandler("string2");
+        
+        JettyHTTPServerEngine engine = new JettyHTTPServerEngine();
+        engine.setPort(1245);
+        
+        List<Handler> handlers = new ArrayList<Handler>();
+        handlers.add(handler1);
+        engine.setHandlers(handlers);
+        engine.finalizeConfig();
+        
+        engine.addServant(url, handler2);
+        String response = null;
+        try {
+            response = getResponse(url.toString());
+            System.out.println("response is " + response);
+        } catch (Exception ex) {
+            fail("Can't get the reponse from the server " + ex);
+        }
+        engine.stop();
+    }
+    
+    @Test 
     public void testGetContextHandler() throws Exception {
         String urlStr = "http://localhost:1234/hello/test";
         JettyHTTPServerEngine engine = 
-            factory.createJettyHTTPServerEngine(1234);
+            factory.createJettyHTTPServerEngine(1234, "http");
         ContextHandler contextHandler = engine.getContextHandler(new URL(urlStr));
+        // can't find the context handler here
         assertNull(contextHandler);
         JettyHTTPTestHandler handler1 = new JettyHTTPTestHandler("string1");
         JettyHTTPTestHandler handler2 = new JettyHTTPTestHandler("string2");

Added: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/invalide-engines.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/invalide-engines.xml?view=auto&rev=560509
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/invalide-engines.xml (added)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/invalide-engines.xml Sat Jul 28 00:26:42 2007
@@ -0,0 +1,33 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:beans="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:sec="http://cxf.apache.org/configuration/security"
+  xmlns:http="http://cxf.apache.org/transports/http/configuration"
+  xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
+  xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
+  xsi:schemaLocation="
+  		   http://cxf.apache.org/configuration/security
+  		      http://cxf.apache.org/schemas/configuration/security.xsd
+           http://cxf.apache.org/transports/http/configuration
+              http://cxf.apache.org/schemas/configuration/http-conf.xsd
+           http://cxf.apache.org/transports/http-jetty/configuration
+              http://cxf.apache.org/schemas/configuration/http-jetty.xsd
+           http://www.springframework.org/schema/beans
+              http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+  
+  <httpj:engine-factory bus="cxf">
+	 <httpj:engine port="1234">
+	     <httpj:tlsServerParameters>
+	         <sec:clientAuthentication want="true" required="true"/>
+	    </httpj:tlsServerParameters>
+	    <httpj:connector>
+	       <beans:bean class="org.mortbay.jetty.bio.SocketConnector">
+              <beans:property name = "port" value="1234" />
+           </beans:bean>
+	    </httpj:connector> 
+	  </httpj:engine>
+   </httpj:engine-factory>  
+   <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl">
+   </bean> 
+</beans>
\ No newline at end of file

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/invalide-engines.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/invalide-engines.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/invalide-engines.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java?view=diff&rev=560509&r1=560508&r2=560509
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java Sat Jul 28 00:26:42 2007
@@ -89,7 +89,7 @@
         TestApplicationContext ctx = new TestApplicationContext(
             new String[] {S1, S2, S3, s4});
         
-        ctx.refresh();
+        //ctx.refresh();
         
         ConfigurerImpl cfg = new ConfigurerImpl(ctx);
         
@@ -125,14 +125,29 @@
         engine = (JettyHTTPServerEngine)jd2.getEngine();
         assertEquals(99, engine.getThreadingParameters().getMinThreads());
         assertEquals(777, engine.getThreadingParameters().getMaxThreads());
+        assertTrue("The engine should support session manager", engine.isSessionSupport());
+        assertNotNull("The handlers should not be null", engine.getHandlers());
+        assertEquals(1, engine.getHandlers().size());
+        assertTrue("The connector should be instance of org.mortbay.jetty.bio.SocketConnector",
+                   engine.getConnector() instanceof org.mortbay.jetty.bio.SocketConnector);
         
         JettyHTTPDestination jd3 = 
             (JettyHTTPDestination)factory.getDestination(
-                getEndpointInfo("sna", "foo", "http://localhost:9100"));
+                getEndpointInfo("sna", "foo", "https://localhost:9002"));
         
         engine = (JettyHTTPServerEngine)jd3.getEngine();
-        assertEquals(99, engine.getThreadingParameters().getMinThreads());
-        assertEquals(777, engine.getThreadingParameters().getMaxThreads());
+        assertEquals(111, engine.getThreadingParameters().getMinThreads());
+        assertEquals(120, engine.getThreadingParameters().getMaxThreads());
+        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isWant(), true);
+        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isRequired(), true);
+        
+        JettyHTTPDestination jd4 = 
+            (JettyHTTPDestination)factory.getDestination(
+                getEndpointInfo("sna", "foo2", "https://localhost:9003"));
+        
+        engine = (JettyHTTPServerEngine)jd4.getEngine();
+        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isWant(), false);
+        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isRequired(), false);
     }
     
     private EndpointInfo getEndpointInfo(String serviceNS, 

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java?view=diff&rev=560509&r1=560508&r2=560509
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java Sat Jul 28 00:26:42 2007
@@ -18,8 +18,10 @@
  */
 package org.apache.cxf.transport.http_jetty.spring;
 
+
 import org.w3c.dom.Document;
 
+
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.transport.http.spring.HttpConduitBeanDefinitionParser;
 import org.apache.cxf.transport.http.spring.HttpDestinationBeanDefinitionParser;
@@ -60,37 +62,5 @@
         assertEquals(97, ((HTTPClientPolicy) pvs[0].getValue()).getConnectionTimeout(), 0);
     }
     
-    @Test
-    public void testJettyHTTPServerEngineFactory()throws Exception {
-        BeanDefinitionBuilder bd = BeanDefinitionBuilder.childBeanDefinition("child");
-        
-        JettyHTTPServerEngineFactoryBeanDefinitionParser parser = 
-            new JettyHTTPServerEngineFactoryBeanDefinitionParser();
-
-        Document d = DOMUtils.readXml(getClass().getResourceAsStream("serverenginefactory.xml"));
-        parser.doParse(d.getDocumentElement(), null, bd);
-        
-        PropertyValue[] pvs = bd.getRawBeanDefinition()
-            .getPropertyValues().getPropertyValues();
-        
-        // First is config, Second is the bus.
-        assertEquals(2, pvs.length);
-        
-        JettyHTTPServerEngineFactoryConfig con =
-            (JettyHTTPServerEngineFactoryConfig) pvs[0].getValue();
-        
-        assertEquals(1, con.threadingParametersMap.get(9000).getMinThreads());
-        assertEquals(2, con.threadingParametersMap.get(9000).getMaxThreads());
-        assertNotNull(con.tlsParametersMap.get(9000));
-        assertNotNull(con.tlsParametersMap.get(9000).getClientAuthentication());
-        assertFalse(con.tlsParametersMap.get(9000).getClientAuthentication().isWant());
-        assertFalse(con.tlsParametersMap.get(9000).getClientAuthentication().isRequired());
-
-        assertNotNull(con.tlsParametersMap.get(9001));
-        assertNotNull(con.tlsParametersMap.get(9001).getClientAuthentication());
-        assertEquals(11, con.threadingParametersMap.get(9001).getMinThreads());
-        assertEquals(12, con.threadingParametersMap.get(9001).getMaxThreads());
-        assertTrue(con.tlsParametersMap.get(9001).getClientAuthentication().isWant());
-        assertTrue(con.tlsParametersMap.get(9001).getClientAuthentication().isRequired());
-    }
+    
 }

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml?view=diff&rev=560509&r1=560508&r2=560509
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml Sat Jul 28 00:26:42 2007
@@ -18,7 +18,7 @@
   under the License.
 -->
 <beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:beans="http://www.springframework.org/schema/beans"
+       xmlns:beans="http://www.springframework.org/schema/beans"    
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:h="http://cxf.apache.org/transports/http/configuration"
        xmlns:hj="http://cxf.apache.org/transports/http-jetty/configuration"
@@ -47,17 +47,47 @@
     </h:conduit>
 
     <hj:engine-factory bus="cxf">
+       <hj:identifiedTLSServerParameters id="sample1">
+         <hj:tlsServerParameters jsseProvider="SUN" secureSocketProtocol="TLS">
+            <sec:clientAuthentication want="false" required="false"/>
+        </hj:tlsServerParameters>
+       </hj:identifiedTLSServerParameters>
+       
 	   <hj:identifiedThreadingParameters id="sampleThreading1">
 	      <hj:threadingParameters minThreads="111" maxThreads="120"/>
 	   </hj:identifiedThreadingParameters>
-	   
+       
 	   <hj:engine port="9000">
-	      <hj:threadingParametersRef id="sampleThreading1"/>
+	      <hj:threadingParametersRef id="sampleThreading1"/>	      
 	   </hj:engine>
 	   
 	   <hj:engine port="0">
 	      <hj:threadingParameters minThreads="99" maxThreads="777"/>
 	   </hj:engine>
 	   
+	   <hj:engine port="9001">
+	       <hj:threadingParameters minThreads="99" maxThreads="777"/>	      
+	     <hj:connector>
+           <beans:bean class="org.mortbay.jetty.bio.SocketConnector">
+              <beans:property name = "port" value="9001" />
+           </beans:bean>
+         </hj:connector>
+         <hj:handlers>
+           <beans:bean class="org.mortbay.jetty.handler.DefaultHandler"/>         
+         </hj:handlers>
+         <hj:sessionSupport>true</hj:sessionSupport>
+	  </hj:engine> 
+	  
+	  <hj:engine port="9002">
+        <hj:tlsServerParameters>
+           <sec:clientAuthentication want="true" required="true"/>
+        </hj:tlsServerParameters>
+           <hj:threadingParametersRef id="sampleThreading1"/>
+      </hj:engine>
+      
+      <hj:engine port="9003">
+         <hj:tlsServerParametersRef id="sample1"/>
+      </hj:engine>
+      
 	</hj:engine-factory>
 </beans>

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/serverenginefactory.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/serverenginefactory.xml?view=diff&rev=560509&r1=560508&r2=560509
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/serverenginefactory.xml (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/serverenginefactory.xml Sat Jul 28 00:26:42 2007
@@ -19,6 +19,7 @@
 <hj:engine-factory
        xmlns:hj="http://cxf.apache.org/transports/http-jetty/configuration"
        xmlns:sec="http://cxf.apache.org/configuration/security"
+       xmlns:beans="http://www.springframework.org/schema/beans"
    bus="cxf">
    
    <hj:identifiedTLSServerParameters id="sample1">
@@ -42,6 +43,15 @@
       </hj:tlsServerParameters>
       <hj:threadingParametersRef id="sampleThreading1"/>
    </hj:engine>
-   
+   <hj:engine port="9002">
+      <hj:connector>
+         <bean class="jettysocketconnector"/>
+      </hj:connector>
+      <hj:handlers>
+         <bean class="jettyhandler1"/>
+         <bean class="jettyhandler2"/>  
+      </hj:handlers>
+      <hj:useSession> true </hj:useSession>
+   </hj:engine>    
 </hj:engine-factory>
          

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/SessionServer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/SessionServer.java?view=diff&rev=560509&r1=560508&r2=560509
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/SessionServer.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/SessionServer.java Sat Jul 28 00:26:42 2007
@@ -19,7 +19,12 @@
 
 package org.apache.cxf.systest.http;
 
+import java.net.URL;
+
 import javax.xml.ws.Endpoint;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.spring.SpringBusFactory;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 
 public class SessionServer extends AbstractBusTestServerBase {
@@ -28,7 +33,11 @@
     protected void run() {
         Object implementor;
         String address;
-        
+        URL configure =
+            SessionServer.class.getResource("resources/SessionServer.xml");
+        System.out.println("the configure is " + configure);
+        Bus bus = new SpringBusFactory().createBus(configure, true);
+        SpringBusFactory.setDefaultBus(bus);
         implementor = new GreeterSessionImpl();
         address = "http://localhost:9020/SoapContext/GreeterPort";
         Endpoint.publish(address, implementor);
@@ -37,6 +46,7 @@
     
     public static void main(String[] args) {
         try {
+            System.out.println("!!!!start");
             SessionServer s = new SessionServer();
             s.start();
         } catch (Exception ex) {

Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/SessionServer.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/SessionServer.xml?view=auto&rev=560509
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/SessionServer.xml (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/SessionServer.xml Sat Jul 28 00:26:42 2007
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:sec="http://cxf.apache.org/configuration/security"
+  xmlns:http="http://cxf.apache.org/transports/http/configuration"
+  xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
+  xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
+  xsi:schemaLocation="
+  		   http://cxf.apache.org/configuration/security
+  		      http://cxf.apache.org/schemas/configuration/security.xsd
+           http://cxf.apache.org/transports/http/configuration
+              http://cxf.apache.org/schemas/configuration/http-conf.xsd
+           http://cxf.apache.org/transports/http-jetty/configuration
+              http://cxf.apache.org/schemas/configuration/http-jetty.xsd
+           http://www.springframework.org/schema/beans
+              http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+              
+  <httpj:engine-factory bus="cxf">
+	 <httpj:engine port="9020">
+	     <httpj:sessionSupport>true</httpj:sessionSupport>
+	  </httpj:engine>
+   </httpj:engine-factory>  
+</beans>
\ No newline at end of file

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/SessionServer.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/SessionServer.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/SessionServer.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message