jetty-9 fixed jetty-spring

This commit is contained in:
Greg Wilkins 2012-09-06 16:07:46 +10:00
parent 2dfcebfc04
commit 358e5b5bfd
6 changed files with 46 additions and 16 deletions

View File

@ -8,7 +8,7 @@
<!-- --> <!-- -->
<!-- This file may be run with: --> <!-- This file may be run with: -->
<!-- java -jar start.jar OPTIONS=Server,spring \ --> <!-- java -jar start.jar OPTIONS=Server,spring \ -->
<!-- start.class=org.mortbay.jetty.spring.Main \ --> <!-- start.class=org.eclipse.jetty.spring.Main \ -->
<!-- etc/jetty-spring.xml --> <!-- etc/jetty-spring.xml -->
<!-- --> <!-- -->
<!-- The spring and commons-logging jars may need to be added --> <!-- The spring and commons-logging jars may need to be added -->

View File

@ -19,8 +19,12 @@
package org.eclipse.jetty.spring; package org.eclipse.jetty.spring;
import java.net.InetSocketAddress;
import java.util.Collection; import java.util.Collection;
import org.eclipse.jetty.util.component.Container;
import org.eclipse.jetty.util.thread.ThreadPool;
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
@ -30,10 +34,34 @@ import java.util.Collection;
*/ */
public class Server extends org.eclipse.jetty.server.Server public class Server extends org.eclipse.jetty.server.Server
{ {
public Server()
{
super();
}
public Server(InetSocketAddress addr)
{
super(addr);
}
public Server(int port)
{
super(port);
}
public Server(ThreadPool pool, Container container)
{
super(pool,container);
}
public Server(ThreadPool pool)
{
super(pool);
}
public void setBeans(Collection<Object> beans) public void setBeans(Collection<Object> beans)
{ {
for (Object o:beans) for (Object o:beans)
addBean(o); addBean(o);
} }
} }

View File

@ -34,7 +34,7 @@ import static junit.framework.Assert.assertEquals;
public class SpringXmlConfigurationTest public class SpringXmlConfigurationTest
{ {
protected String _configure="org/mortbay/jetty/spring/configure.xml"; protected String _configure="org/eclipse/jetty/spring/configure.xml";
@Before @Before
public void init() throws Exception public void init() throws Exception
@ -128,7 +128,7 @@ public class SpringXmlConfigurationTest
@Test @Test
public void testJettyXml() throws Exception public void testJettyXml() throws Exception
{ {
URL url = SpringXmlConfigurationTest.class.getClassLoader().getResource("org/mortbay/jetty/spring/jetty.xml"); URL url = SpringXmlConfigurationTest.class.getClassLoader().getResource("org/eclipse/jetty/spring/jetty.xml");
XmlConfiguration configuration = new XmlConfiguration(url); XmlConfiguration configuration = new XmlConfiguration(url);
Server server = (Server)configuration.configure(); Server server = (Server)configuration.configure();
@ -140,7 +140,7 @@ public class SpringXmlConfigurationTest
@Test @Test
public void XmlConfigurationMain() throws Exception public void XmlConfigurationMain() throws Exception
{ {
XmlConfiguration.main(new String[]{"src/test/resources/org/mortbay/jetty/spring/jetty.xml"}); XmlConfiguration.main(new String[]{"src/test/resources/org/eclipse/jetty/spring/jetty.xml"});
} }
} }

View File

@ -12,20 +12,20 @@
<property name="arguments"><list><value>test</value></list></property> <property name="arguments"><list><value>test</value></list></property>
</bean> </bean>
<bean id="root" name="Some,Names,Main" class="org.mortbay.jetty.spring.TestConfiguration"> <bean id="root" name="Some,Names,Main" class="org.eclipse.jetty.spring.TestConfiguration">
<property name="testString1"><value>SetValue</value></property> <property name="testString1"><value>SetValue</value></property>
<property name="testInt1"><value>1</value></property> <property name="testInt1"><value>1</value></property>
<property name="nested" ref="nested"/> <property name="nested" ref="nested"/>
<property name="testString2" ref="testProperty"/> <property name="testString2" ref="testProperty"/>
</bean> </bean>
<bean id="nested" class="org.mortbay.jetty.spring.TestConfiguration"> <bean id="nested" class="org.eclipse.jetty.spring.TestConfiguration">
<property name="testInt2"><value>2</value></property> <property name="testInt2"><value>2</value></property>
<property name="testString1"><value>nested</value></property> <property name="testString1"><value>nested</value></property>
<property name="nested" ref="nestedDeep"/> <property name="nested" ref="nestedDeep"/>
</bean> </bean>
<bean id="nestedDeep" class="org.mortbay.jetty.spring.TestConfiguration"> <bean id="nestedDeep" class="org.eclipse.jetty.spring.TestConfiguration">
<property name="testString1"><value>deep</value></property> <property name="testString1"><value>deep</value></property>
<property name="testInt2"><value>2</value></property> <property name="testInt2"><value>2</value></property>
</bean> </bean>

View File

@ -2,12 +2,12 @@
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans> <beans>
<bean id="Server" name="Main" class="org.mortbay.jetty.spring.Server"> <bean id="Server" name="Main" class="org.eclipse.jetty.spring.Server">
<!-- <!--
<property name="beans"> <property name="beans">
<list> <list>
<bean id="ContextDeployer" class="org.mortbay.jetty.spring.ContextDeployer"> <bean id="ContextDeployer" class="org.eclipse.jetty.spring.ContextDeployer">
<property name="contexts" ref="contexts"/> <property name="contexts" ref="contexts"/>
<property name="contextsDir" value="contexts"/> <property name="contextsDir" value="contexts"/>
<property name="scanInterval" value="5"/> <property name="scanInterval" value="5"/>

View File

@ -3,22 +3,24 @@
<beans> <beans>
<bean id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/> <bean id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
<bean id="Server" name="Main" class="org.mortbay.jetty.spring.Server"> <bean id="Server" name="Main" class="org.eclipse.jetty.spring.Server">
<constructor-arg type="org.eclipse.jetty.util.thread.ThreadPool">
<property name="threadPool">
<bean id="ThreadPool" class="org.eclipse.jetty.util.thread.QueuedThreadPool"> <bean id="ThreadPool" class="org.eclipse.jetty.util.thread.QueuedThreadPool">
<property name="minThreads" value="10"/> <property name="minThreads" value="10"/>
<property name="maxThreads" value="200"/> <property name="maxThreads" value="200"/>
</bean> </bean>
</property> </constructor-arg>
<!--
<property name="connectors"> <property name="connectors">
<list> <list>
<bean id="Connector" class="org.eclipse.jetty.server.nio.SelectChannelConnector"> <bean id="Connector" class="org.eclipse.jetty.server.SelectChannelConnector">
<constructor-arg type="org.eclipse.jetty.spring.Server"><ref bean="Server"/></constructor-arg>
<property name="port" value="0"/> <property name="port" value="0"/>
</bean> </bean>
</list> </list>
</property> </property>
-->
<property name="handler"> <property name="handler">
<bean id="handlers" class="org.eclipse.jetty.server.handler.HandlerCollection"> <bean id="handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">