* initial commit

git-svn-id: svn+ssh://svn.synyx.de/var/svn/synyx/opensource/synyx-plugin/trunk@2908 5a64d73e-33d6-4ccc-9058-23f8668ecac9
This commit is contained in:
Oliver Gierke
2008-10-06 20:02:56 +00:00
parent 2e9eedcc17
commit dd6e35cea3
19 changed files with 845 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
package org.synyx.plugin.core;
/**
* @author Oliver Gierke - gierke@synyx.de
*/
public interface SamplePlugin extends Plugin<String> {
void pluginMethod();
}

View File

@@ -0,0 +1,27 @@
package org.synyx.plugin.core;
/**
* @author Oliver Gierke - gierke@synyx.de
*/
public class SamplePluginImplementation implements SamplePlugin {
/*
* (non-Javadoc)
*
* @see org.synyx.plugin.core.Plugin#supports(java.lang.Object)
*/
public boolean supports(String delimiter) {
return "FOO".equals(delimiter);
}
/*
* (non-Javadoc)
*
* @see org.synyx.plugin.core.ISamplePlugin#pluginMethod()
*/
public void pluginMethod() {
}
}

View File

@@ -0,0 +1,32 @@
package org.synyx.plugin.core.config;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.synyx.plugin.core.PluginRegistry;
import org.synyx.plugin.core.SamplePlugin;
/**
* @author Oliver Gierke - gierke@synyx.de
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:application-context.xml")
public class PluginConfigurationIntegrationTest {
@Autowired
List<SamplePlugin> samplePlugins;
@Autowired
PluginRegistry<SamplePlugin, String> pluginRegistry;
@Test
public void test() throws Exception {
}
}

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:plugin="http://www.synyx.org/schema/plugin"
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.xsd
http://www.synyx.org/schema/plugin http://www.synyx.org/schema/plugin/plugin-config.xsd">
<plugin:list id="foo" class="org.synyx.plugin.core.SamplePlugin" />
<plugin:registry id="bar" class="org.synyx.plugin.core.SamplePlugin" />
<bean class="org.synyx.plugin.core.SamplePluginImplementation" />
</beans>

View File

@@ -0,0 +1,12 @@
# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
# Root logger option
log4j.rootLogger=WARN, stdout
# Hibernate logging options (INFO only shows startup messages)
log4j.logger.org.springframework=INFO
log4j.logger.org.synyx.plugin=DEBUG