Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Changed names and contents of Spring config to match new package name…
…s, removed Spring config no longer appropriate for the kernel
  • Loading branch information
ajs6f committed Feb 7, 2013
1 parent 63ff9fe commit ec87e9b
Show file tree
Hide file tree
Showing 22 changed files with 126 additions and 193 deletions.
Expand Up @@ -7,7 +7,7 @@
import javax.jcr.Property;
import javax.jcr.RepositoryException;

import org.fcrepo.modeshape.foxml.FOXMLParser;
import org.fcrepo.foxml.FOXMLParser;
import org.modeshape.common.i18n.TextI18n;
import org.modeshape.common.logging.Logger;
import org.modeshape.jcr.api.nodetype.NodeTypeManager;
Expand Down
24 changes: 24 additions & 0 deletions fcrepo-kernel/src/main/resources/META-INF/spring/eventing.xml
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">


<!-- Context that suports event management, including the internal
event bus (fedoraInternalEventBus) -->

<context:annotation-config/>

<!-- listener that moves JCR Events to the Fedora internal event bus -->
<bean class="org.fcrepo.observer.SimpleObserver"/>

<!-- used by bean above to filter which events get put on the bus -->
<bean name="fedoraEventFilter" class="org.fcrepo.observer.DefaultFilter"/>

<!-- Fedora's lightweight internal event bus. Currently memory-resident.-->
<bean name="fedoraInternalEventBus" class="com.google.common.eventbus.EventBus"/>

</beans>
Expand Up @@ -6,9 +6,8 @@

<!-- Master context for the application. -->

<import resource="classpath:/spring/repo.xml"/>
<import resource="classpath:/spring/rest.xml"/>
<import resource="classpath:/spring/eventing.xml"/>
<import resource="classpath:/spring/indexer.xml"/>
<import resource="classpath:/META-INF/spring/repo.xml"/>
<import resource="classpath:/META-INF/spring/rest.xml"/>
<import resource="classpath:/META-INF/spring/eventing.xml"/>

</beans>
Expand Up @@ -11,7 +11,7 @@
<context:annotation-config/>

<bean name="modeshapeRepofactory"
class="org.fcrepo.modeshape.spring.ModeShapeRepositoryFactoryBean"/>
class="org.fcrepo.spring.ModeShapeRepositoryFactoryBean"/>

<bean class="org.modeshape.jcr.JcrRepositoryFactory"/>

Expand Down
Expand Up @@ -22,17 +22,17 @@
<bean class="org.codehaus.jackson.map.ObjectMapper"/>

<!-- Mints PIDs-->
<bean class="org.fcrepo.modeshape.identifiers.UUIDPidMinter"/>
<bean class="org.fcrepo.identifiers.UUIDPidMinter"/>

<jaxrs:server address="/rest">
<jaxrs:serviceBeans>
<bean class="org.fcrepo.modeshape.FedoraRepository"/>
<bean class="org.fcrepo.modeshape.FedoraDatastreams"/>
<bean class="org.fcrepo.modeshape.FedoraIdentifiers"/>
<bean class="org.fcrepo.modeshape.FedoraNamespaces"/>
<bean class="org.fcrepo.modeshape.FedoraObjects"/>
<bean class="org.fcrepo.modeshape.foxml.FedoraOXML"/>
<bean class="org.fcrepo.modeshape.indexer.DublinCore" />
<bean class="org.fcrepo.FedoraRepository"/>
<bean class="org.fcrepo.FedoraDatastreams"/>
<bean class="org.fcrepo.FedoraIdentifiers"/>
<bean class="org.fcrepo.FedoraNamespaces"/>
<bean class="org.fcrepo.FedoraObjects"/>
<bean class="org.fcrepo.foxml.FedoraOXML"/>
<bean class="org.fcrepo.indexer.DublinCore" />
</jaxrs:serviceBeans>
<jaxrs:extensionMappings>
<entry key="json" value="application/json"/>
Expand Down
2 changes: 1 addition & 1 deletion fcrepo-kernel/src/main/resources/my_repository.json
Expand Up @@ -44,7 +44,7 @@
"sequencers" : {
"FOXML Eater" : {
"description" : "FOXML Files loaded under 'fedora:/foxml' and extracted into 'fedora:/'",
"classname" : "org.fcrepo.modeshape.foxml.FOXMLSequencer",
"classname" : "org.fcrepo.foxml.FOXMLSequencer",
"pathExpressions" : ["fedora:/foxml/(.*)/jcr:content[@jcr:data] => fedora:/$1"]
}
}
Expand Down
46 changes: 0 additions & 46 deletions fcrepo-kernel/src/main/resources/spring/eventing.xml

This file was deleted.

@@ -1,4 +1,4 @@
package org.fcrepo.modeshape.foxml
package org.fcrepo.foxml

import java.io.ByteArrayInputStream
import java.io.InputStream
Expand Down
Expand Up @@ -6,15 +6,15 @@
import org.slf4j.Logger;
import org.springframework.test.context.ContextConfiguration;

@ContextConfiguration("/spring-test/jetty.xml")
@ContextConfiguration("/spring-test/master.xml")
public abstract class AbstractResourceTest extends AbstractTest {

protected Logger logger;

protected static final int SERVER_PORT = 8080;
protected static final String HOSTNAME = "localhost";
protected static final String serverAddress = "http://" + HOSTNAME + ":"
+ SERVER_PORT + "/";
+ SERVER_PORT + "/rest/";

protected final HttpClient client = new HttpClient();

Expand Down
Expand Up @@ -11,9 +11,7 @@
import org.apache.commons.httpclient.methods.PutMethod;
import org.apache.commons.httpclient.methods.StringRequestEntity;
import org.junit.Test;
import org.springframework.test.context.ContextConfiguration;

@ContextConfiguration({ "/spring-test/rest.xml", "/spring-test/repo.xml" })
public class FedoraDatastreamsTest extends AbstractResourceTest {

private static final String faulkner1 = "The past is never dead. It's not even past.";
Expand Down
Expand Up @@ -12,9 +12,7 @@
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.PostMethod;
import org.junit.Test;
import org.springframework.test.context.ContextConfiguration;

@ContextConfiguration({ "/spring-test/rest.xml", "/spring-test/repo.xml" })
public class FedoraIdentifiersTest extends AbstractResourceTest {

@Test
Expand Down
2 changes: 0 additions & 2 deletions fcrepo-kernel/src/test/java/org/fcrepo/FedoraObjectsTest.java
Expand Up @@ -8,9 +8,7 @@
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.junit.Test;
import org.springframework.test.context.ContextConfiguration;

@ContextConfiguration({ "/spring-test/rest.xml", "/spring-test/repo.xml" })
public class FedoraObjectsTest extends AbstractResourceTest {

@Test
Expand Down
Expand Up @@ -11,9 +11,7 @@
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.junit.Test;
import org.springframework.test.context.ContextConfiguration;

@ContextConfiguration({ "/spring-test/rest.xml", "/spring-test/repo.xml" })
public class FedoraRepositoryTest extends AbstractResourceTest {

@Test
Expand Down
3 changes: 2 additions & 1 deletion fcrepo-kernel/src/test/java/org/fcrepo/observer/RSSTest.java
@@ -1,4 +1,4 @@
package org.fcrepo.observer;
/*package org.fcrepo.observer;
import static java.util.regex.Pattern.DOTALL;
import static java.util.regex.Pattern.compile;
Expand Down Expand Up @@ -31,3 +31,4 @@ public void testRSS() throws Exception {
}
}
*/
9 changes: 1 addition & 8 deletions fcrepo-kernel/src/test/resources/logback.xml
Expand Up @@ -7,20 +7,13 @@
</encoder>
</appender>

<logger name="org.fcrepo.modeshape.modules.audit" additivity="false" level="DEBUG">
<appender-ref ref="STDOUT"/>
</logger>

<logger name="org.fcrepo" additivity="false" level="DEBUG">
<appender-ref ref="STDOUT"/>
</logger>
<logger name="org.modeshape" additivity="false" level="INFO">
<appender-ref ref="STDOUT"/>
</logger>
<logger name="org.apache.abdera" additivity="false" level="INFO">
<appender-ref ref="STDOUT"/>
</logger>
<logger name="org.apache.cxf" additivity="false" level="TRACE">
<logger name="org.apache.cxf" additivity="false" level="INFO">
<appender-ref ref="STDOUT"/>
</logger>
<root additivity="false" level="INFO">
Expand Down
30 changes: 4 additions & 26 deletions fcrepo-kernel/src/test/resources/spring-test/eventing.xml
Expand Up @@ -2,45 +2,23 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

<import resource="classpath:META-INF/cxf/cxf.xml"/>

<!-- Context that suports event management, including the internal
event bus (fedoraInternalEventBus) and JMS and RSS publication-->
event bus (fedoraInternalEventBus) -->

<context:annotation-config/>

<!-- listener that moves JCR Events to the Fedora internal event bus -->
<bean class="org.fcrepo.modeshape.observer.SimpleObserver"/>
<bean class="org.fcrepo.observer.SimpleObserver"/>

<!-- used by bean above to filter which events get put on the bus -->
<bean name="fedoraEventFilter" class="org.fcrepo.modeshape.observer.DefaultFilter"/>
<bean name="fedoraEventFilter" class="org.fcrepo.observer.DefaultFilter"/>

<!-- publishes events from the internal bus to JMS, in Atom format -->
<bean class="org.fcrepo.modeshape.observer.JMSTopicAtomPublisher"/>

<!-- Fedora's lightweight internal event bus. Currently memory-resident.-->
<bean name="fedoraInternalEventBus" class="com.google.common.eventbus.EventBus"/>

<jaxrs:server address="http://localhost:8080/" bus="cxf">
<jaxrs:serviceBeans>
<bean class="org.fcrepo.modeshape.observer.RSSPublisher"/>
</jaxrs:serviceBeans>
</jaxrs:server>

<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"
depends-on="jmsBroker">
<property name="brokerURL" value="vm://localhost?create=false"/>
</bean>

<bean name="jmsBroker" class="org.apache.activemq.xbean.BrokerFactoryBean">
<property name="config" value="classpath:/spring/activemq.xml"/>
<property name="start" value="true"/>
</bean>

</beans>
33 changes: 0 additions & 33 deletions fcrepo-kernel/src/test/resources/spring-test/jetty.xml

This file was deleted.

13 changes: 13 additions & 0 deletions fcrepo-kernel/src/test/resources/spring-test/master.xml
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

<!-- Master context for the test application. -->

<import resource="classpath:/spring-test/repo.xml"/>
<import resource="classpath:/spring-test/rest.xml"/>
<import resource="classpath:/spring-test/eventing.xml"/>

</beans>
2 changes: 1 addition & 1 deletion fcrepo-kernel/src/test/resources/spring-test/repo.xml
Expand Up @@ -11,7 +11,7 @@
<context:annotation-config/>

<bean name="modeshapeRepofactory"
class="org.fcrepo.modeshape.spring.ModeShapeRepositoryFactoryBean"/>
class="org.fcrepo.spring.ModeShapeRepositoryFactoryBean"/>

<bean class="org.modeshape.jcr.JcrRepositoryFactory"/>

Expand Down
18 changes: 9 additions & 9 deletions fcrepo-kernel/src/test/resources/spring-test/rest.xml
Expand Up @@ -13,18 +13,18 @@
<import resource="classpath:META-INF/cxf/cxf.xml"/>

<!-- Context that houses JAX-RS Resources that compose the API
as well as som utility gear. -->
as well as some utility gear. -->

<context:annotation-config/>

<jaxrs:server address="http://localhost:8080/" bus="cxf">
<jaxrs:server address="http://localhost:8080/rest" >
<jaxrs:serviceBeans>
<bean class="org.fcrepo.modeshape.FedoraRepository"/>
<bean class="org.fcrepo.modeshape.FedoraDatastreams"/>
<bean class="org.fcrepo.modeshape.FedoraIdentifiers"/>
<bean class="org.fcrepo.modeshape.FedoraNamespaces"/>
<bean class="org.fcrepo.modeshape.FedoraObjects"/>
<bean class="org.fcrepo.modeshape.foxml.FedoraOXML"/>
<bean class="org.fcrepo.FedoraRepository"/>
<bean class="org.fcrepo.FedoraDatastreams"/>
<bean class="org.fcrepo.FedoraIdentifiers"/>
<bean class="org.fcrepo.FedoraNamespaces"/>
<bean class="org.fcrepo.FedoraObjects"/>
<bean class="org.fcrepo.foxml.FedoraOXML"/>
</jaxrs:serviceBeans>
<jaxrs:extensionMappings>
<entry key="json" value="application/json"/>
Expand All @@ -51,7 +51,7 @@
<bean class="org.codehaus.jackson.map.ObjectMapper"/>

<!-- Mints PIDs-->
<bean class="org.fcrepo.modeshape.identifiers.UUIDPidMinter"/>
<bean class="org.fcrepo.identifiers.UUIDPidMinter"/>


</beans>

0 comments on commit ec87e9b

Please sign in to comment.