* propagated name change in module directory names and pom

git-svn-id: svn+ssh://svn.synyx.de/var/svn/synyx/opensource/hera/trunk@3033 5a64d73e-33d6-4ccc-9058-23f8668ecac9
This commit is contained in:
Oliver Gierke
2008-10-15 16:18:00 +00:00
parent 12a8401c3e
commit 8bc770e679
43 changed files with 14 additions and 15 deletions

View File

@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Class-Path:

View File

@@ -0,0 +1,21 @@
package org.synyx.plugin.core;
/**
* Central interface for plugins for the system. This interface is meant to be
* extended by concrete plugin interfaces. Its core responsibility is to define
* a delimiter type and a selection callback with the delimiter as parameter.
* The delimiter is some kind of decision object concrete plugin implementations
* can use to decide if they are capable to be executed.
*
* @author Oliver Gierke - gierke@synyx.de
*/
public interface Plugin<S> {
/**
* Returns if a plugin should be invoked according to the given delimiter.
*
* @param delimiter
* @return if the plugin should be invoked
*/
boolean supports(S delimiter);
}

View File

@@ -0,0 +1,224 @@
package org.synyx.plugin.core;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* Registry for plugins. Allows sophisticated typesafe access to implementations
* of interfaces extending {link Plugin}.
*
* @param <T> the concrete plugin interface
* @param <S> the delimiter type
* @author Oliver Gierke - gierke@synyx.de
*/
public class PluginRegistry<T extends Plugin<S>, S> implements Iterable<T> {
// Registered plugins
private List<T> plugins;
/**
* Creates a new {@code PluginRegistry}.
*/
public PluginRegistry() {
plugins = new ArrayList<T>();
}
/**
* Creates a new {@link PluginRegistry}.
*
* @param <T>
* @param <S>
* @return
*/
public static <T extends Plugin<S>, S> PluginRegistry<T, S> create() {
return new PluginRegistry<T, S>();
}
/**
* Register plugins.
*
* @param plugins the plugins to set
*/
public void setPlugins(List<? extends T> plugins) {
this.plugins = new ArrayList<T>();
this.plugins.addAll(plugins);
}
/**
* Adds a given plugin to the registry.
*
* @param plugin
*/
public void addPlugin(T plugin) {
this.plugins.add(plugin);
}
/**
* Returns the first plugin found for the given originating system. Thus,
* further configured plugins are ignored.
*
* @param originatingSystem
* @return a plugin for the given originating system or {@code null} if none
* found
*/
public T getPluginFor(S delimiter) {
List<T> plugins = getPluginsFor(delimiter);
if (0 < plugins.size()) {
return plugins.get(0);
}
return null;
}
/**
* Returns all plugins for the given delimiter.
*
* @param delimiter
* @return a list of plugins or an empty list if none found
*/
public List<T> getPluginsFor(S delimiter) {
List<T> result = new ArrayList<T>();
for (T plugin : plugins) {
if (plugin.supports(delimiter)) {
result.add(plugin);
}
}
return result;
}
/**
* Retrieves a required plugin from the registry or throw the given
* exception if none can be found. If more than one plugins are found the
* first one will be returned.
*
* @param <E> the exception type to be thrown in case no plugin can be found
* @param delimiter
* @param ex the exception to be thrown in case no plugin can be found
* @return a single plugin for the given delimiter
* @throws E if no plugin can be found for the given delimiter
*/
public <E extends Exception> T getPluginFor(S delimiter, E ex) throws E {
T plugin = getPluginFor(delimiter);
if (null == plugin) {
throw ex;
}
return plugin;
}
/**
* Retrieves all plugins for the given delimiter or throws an exception if
* no plugin can be found.
*
* @param <E> the exception type to be thrown
* @param delimiter
* @param ex
* @return all plugins for the given delimiter
* @throws E if no plugin can be found
*/
public <E extends Exception> List<T> getPluginsFor(S delimiter, E ex)
throws E {
List<T> plugins = getPluginsFor(delimiter);
if (0 == plugins.size()) {
throw ex;
}
return plugins;
}
/**
* Returns the first {@link Plugin} supporting the given delimiter or the
* given plugin if none can be found.
*
* @param delimiter
* @param plugin
* @return a single {@link Plugin} supporting the given delimiter or the
* given {@link Plugin} if none found
*/
public T getPluginFor(S delimiter, T plugin) {
T candidate = getPluginFor(delimiter);
return null == candidate ? plugin : candidate;
}
/**
* Returns all {@link Plugin}s supporting the given delimiter or the given
* plugins if none found.
*
* @param delimiter
* @param plugins
* @return all {@link Plugin}s supporting the given delimiter or the given
* {@link Plugin}s if none found
*/
public List<T> getPluginsFor(S delimiter, List<T> plugins) {
List<T> candidates = getPluginsFor(delimiter);
return candidates.size() == 0 ? plugins : candidates;
}
/**
* Returns the number of registered plugins.
*
* @return the number of plugins in the registry
*/
public int countPlugins() {
return plugins.size();
}
/**
* Returns all registered plugins. Only use this method if you really need
* to access all plugins. For distinguished access to certain plugins favour
* accessor methods like {link #getPluginFor} over this one. This method
* should only be used for testing purposes to check registry configuration.
* <p>
* TODO: decide whether to make this method public
*
* @return all plugins of the registry
*/
@SuppressWarnings("unused")
private List<? extends T> getPlugins() {
return plugins;
}
/*
* (non-Javadoc)
*
* @see java.lang.Iterable#iterator()
*/
public Iterator<T> iterator() {
return plugins.iterator();
}
}

View File

@@ -0,0 +1,66 @@
package org.synyx.plugin.core.config;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.ManagedMap;
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
import org.springframework.util.StringUtils;
import org.w3c.dom.Element;
/**
* @author Oliver Gierke - gierke@synyx.de
*/
public class PluginListDefinitionParser extends
AbstractSingleBeanDefinitionParser {
/*
* (non-Javadoc)
*
* @see
* org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
* #getBeanClassName(org.w3c.dom.Element)
*/
@Override
protected String getBeanClassName(Element element) {
return "org.synyx.plugin.core.support.BeanListBeanFactoryPostProcessor";
}
/*
* (non-Javadoc)
*
* @see
* org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
* #doParse(org.w3c.dom.Element,
* org.springframework.beans.factory.support.BeanDefinitionBuilder)
*/
@Override
@SuppressWarnings("unchecked")
protected void doParse(Element element, BeanDefinitionBuilder builder) {
ManagedMap map = new ManagedMap();
map.put(element.getAttribute("id"), element.getAttribute("class"));
builder.addPropertyValue("lists", map);
String initFactories = element.getAttribute("init-factories");
if (StringUtils.hasText(initFactories)) {
builder.addPropertyValue("allowEagerInit", initFactories);
}
}
/*
* (non-Javadoc)
*
* @seeorg.springframework.beans.factory.xml.AbstractBeanDefinitionParser#
* shouldGenerateId()
*/
@Override
protected boolean shouldGenerateId() {
return true;
}
}

View File

@@ -0,0 +1,41 @@
/*
* Copyright 2002-2008 the original author or authors.
*
* Licensed 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.synyx.plugin.core.config;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
/**
* Simple namespace handler for {@literal dao-config} namespace.
*
* @author Eberhard Wolff
* @author Oliver Gierke - gierke@synyx.de
*/
public class PluginNamespaceHandler extends NamespaceHandlerSupport {
/*
* (non-Javadoc)
*
* @see org.springframework.beans.factory.xml.NamespaceHandler#init()
*/
public void init() {
registerBeanDefinitionParser("list", new PluginListDefinitionParser());
registerBeanDefinitionParser("registry",
new PluginRegistryDefinitionParser());
}
}

View File

@@ -0,0 +1,23 @@
package org.synyx.plugin.core.config;
import org.w3c.dom.Element;
/**
* @author Oliver Gierke - gierke@synyx.de
*/
public class PluginRegistryDefinitionParser extends PluginListDefinitionParser {
/*
* (non-Javadoc)
*
* @see
* org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
* #getBeanClassName(org.w3c.dom.Element)
*/
@Override
protected String getBeanClassName(Element element) {
return "org.synyx.plugin.core.support.PluginRegistryBeanFactoryPostProcessor";
}
}

View File

@@ -0,0 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
This package contains configuration support classes to ease registry configuration with
Spring namespaces.
</body>
</html>

View File

@@ -0,0 +1,8 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
This package contains the core plugin API. It allows other modules implementing
components that extend functionality defined by a plugin interface. Plugin clients
can be equipped with plugin implementations.
</body>
</html>

View File

@@ -0,0 +1,217 @@
package org.synyx.plugin.core.support;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.ListFactoryBean;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.ManagedList;
import org.synyx.plugin.core.PluginRegistry;
/**
* Simple {@link BeanFactoryPostProcessor} to autocreate lists of the configured
* {@code lists} property. The post processor will register
* {@link ListFactoryBean}s for each list named with the given key containing
* all beans of the {@link org.springframework.context.ApplicationContext}
* implementing the interface defines as lists value. E.g.:
*
* <pre>
* &lt;bean class=&quot;org.synyx.plugin.core.support.BeanListFactoryPostProcessor&quot;&gt;
* &lt;property name=&quot;lists&quot;&gt;
* &lt;map&gt;
* &lt;entry key=&quot;beanName&quot; value=&quot;org.synyx.plugin.core.Plugin&quot; /&gt;
* &lt;/map&gt;
* &lt;/property&gt;
* &lt;/bean&gt;
* </pre>
*
* This would register all Spring beans implementing the
* {@link org.synyx.plugin.core.Plugin} interface in a list bean with the name
* {@coder beanName}.
*
* @author Oliver Gierke - gierke@synyx.de
*/
public class BeanListBeanFactoryPostProcessor implements
BeanFactoryPostProcessor {
private static final Log log =
LogFactory.getLog(BeanListBeanFactoryPostProcessor.class);
private Map<String, Class<?>> lists = new HashMap<String, Class<?>>();
private boolean initFactories = false;
/**
* Setter to inject required plugin registry configuration. The map's keys
* will be used as bean ids for the resulting {@link PluginRegistry}
* instances. These registry instances will contain all beans having the
* given type.
*
* @param registryMap
*/
public void setLists(Map<String, Class<?>> lists) {
this.lists = lists;
}
/**
* Setter to activate {@link org.springframework.beans.factory.FactoryBean}
* scanning. This allows auto-registration of factory bean targets (the
* objects actually created by the factory bean} but comes with the drawback
* of having to initialize those factories eagerly. This can cause
* unpredictable behaviour if other {@link BeanFactoryPostProcessor}s would
* have been applied to these factories. Defaults to {@value #initFactories}
* .
*
* @param initFactories the allowEagerInit to set
*/
public void setInitFactories(boolean initFactories) {
this.initFactories = initFactories;
}
/*
* (non-Javadoc)
*
* @seeorg.springframework.beans.factory.config.BeanFactoryPostProcessor#
* postProcessBeanFactory
* (org.springframework.beans.factory.config.ConfigurableListableBeanFactory
* )
*/
public void postProcessBeanFactory(
ConfigurableListableBeanFactory beanFactory) throws BeansException {
if (!(beanFactory instanceof BeanDefinitionRegistry)) {
throw new IllegalArgumentException(
"Given beanFactory is not a BeanDefinitionRegistry!");
}
BeanDefinitionRegistry registry = (BeanDefinitionRegistry) beanFactory;
// Do for each required wrapper
for (String wrapperName : lists.keySet()) {
Class<?> requiredType = lists.get(wrapperName);
// Find implementations of the component type
List<RuntimeBeanReference> beans =
getBeanReferencesOfType(beanFactory, requiredType);
registerListBeanDefinition(wrapperName, requiredType, beans,
registry);
}
}
/**
* Registers a {@link ListFactoryBean} containing the given beans under the
* given id. Allows subclasses to modify or wrap the actually registered
* bean definition by calling
* {@link #wrapListBeanDefinition(BeanDefinition)} with the bean definition
* of the {<7B>linl {@link ListFactoryBean}.
*
* @param id
* @param beans
* @param registry
*/
protected <T> void registerListBeanDefinition(String id, Class<T> type,
List<RuntimeBeanReference> beans, BeanDefinitionRegistry registry) {
// Create ListFactory bean definition
BeanDefinitionBuilder listDefinitionBuilder =
BeanDefinitionBuilder.rootBeanDefinition(ListFactoryBean.class);
// Set the implementations as source for the wrapper
listDefinitionBuilder.addPropertyValue("sourceList", beans);
BeanDefinition beanDefinition =
wrapListBeanDefinition(getSourcedBeanDefinition(listDefinitionBuilder));
if (log.isDebugEnabled()) {
log.debug(String.format(
"Registering bean '%s' of type %s containing %s!", id,
beanDefinition.getBeanClassName(), beans.toString()));
}
// Register wrapper under defined name
registry.registerBeanDefinition(id, beanDefinition);
}
/**
* Template method to allow subclasses to wrap the list bean definition into
* another bean definition that will actually be registered. The default
* implementation simply returns the given bean definition.
*
* @param beanDefinition
* @return
*/
protected BeanDefinition wrapListBeanDefinition(
BeanDefinition beanDefinition) {
return beanDefinition;
}
/**
* Returns a {@link BeanDefinitionBuilder}s {@link BeanDefinition} setting
* the current {@link PluginRegistryBeanFactoryPostProcessor} as source.
*
* @param builder
* @return
*/
protected BeanDefinition getSourcedBeanDefinition(
BeanDefinitionBuilder builder) {
AbstractBeanDefinition beanDefinition = builder.getBeanDefinition();
beanDefinition.setSource(this);
return beanDefinition;
}
/**
* Returns bean references to beans with the given type.
*
* @param beanFactory
* @param type
* @return
*/
@SuppressWarnings("unchecked")
protected List<RuntimeBeanReference> getBeanReferencesOfType(
ConfigurableListableBeanFactory beanFactory, Class<?> type) {
// Lookup bean candidates either via Spring or manually
List<String> beanNames =
Arrays.asList(beanFactory.getBeanNamesForType(type, true,
initFactories));
List<RuntimeBeanReference> beanReferences =
new ManagedList(beanNames.size());
for (String beanName : beanNames) {
RuntimeBeanReference reference = new RuntimeBeanReference(beanName);
reference.setSource(this);
beanReferences.add(reference);
}
return (List<RuntimeBeanReference>) beanReferences;
}
}

View File

@@ -0,0 +1,43 @@
package org.synyx.plugin.core.support;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.synyx.plugin.core.PluginRegistry;
/**
* This {@link BeanFactoryPostProcessor} automatically looksup bean instances
* from the {@link BeanFactory} hierarchy and registers {@link PluginRegistry}
* instances for them.
*
* @see org.synyx.plugin.core.support.BeanListBeanFactoryPostProcessor
* @author Oliver Gierke - gierke@synyx.de
*/
public class PluginRegistryBeanFactoryPostProcessor extends
BeanListBeanFactoryPostProcessor {
/**
* Additionally wraps the
* {@link org.springframework.beans.factory.config.ListFactoryBean}
* {@link BeanDefinition} into a {@link PluginRegistry}.
*
* @see com.synyx.minos.core.plugin.support.BeanListBeanFactoryPostProcessor#
* wrapBeanDefinition
* (org.springframework.beans.factory.config.BeanDefinition)
* @return a {@link BeanDefinition} containing a {@link PluginRegistry}
*/
@Override
protected BeanDefinition wrapListBeanDefinition(
BeanDefinition beanDefinition) {
// Create PluginRegistry bean definition to wrap actual bean definition
BeanDefinitionBuilder builder =
BeanDefinitionBuilder.rootBeanDefinition(PluginRegistry.class);
builder.addPropertyValue("plugins", beanDefinition);
return getSourcedBeanDefinition(builder);
}
}

View File

@@ -0,0 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
This package contains support classes to create bean lists or plugin
registry instances out of beans implementing a certain interface.
</body>
</html>

View File

@@ -0,0 +1,27 @@
Manifest-Version: 1.0
Bundle-Name: Synyx Hades Bundle
Bundle-SymbolicName: org.synyx.hades
Bundle-Version: 0.0.1
Export-Package: org.synyx.hades.dao;specification-version="0.0.1",
org.synyx.hades.dao.orm;specification-version="0.0.1",
org.synyx.hades.dao.orm.support;specification-version="0.0.1",
org.synyx.hades.dao.test;specification-version="0.0.1",
org.synyx.hades.domain;specification-version="0.0.1",
org.synyx.hades.domain.support;specification-version="0.0.1"
Import-Package: javax.persistence,
org.aopalliance.intercept,
org.apache.commons.logging,
org.aspectj.lang.annotation;optional=true,
org.hibernate;optional=true,
org.hibernate.criterion;optional=true,
org.hibernate.ejb;optional=true,
org.springframework.aop.framework,
org.springframework.beans.factory,
org.springframework.beans.factory.annotation,
org.springframework.beans.factory.config,
org.springframework.beans.factory.support,
org.springframework.beans.factory.xml,
org.springframework.dao.annotation,
org.springframework.orm.jpa,
org.springframework.stereotype,
org.w3c.dom

View File

@@ -0,0 +1 @@
http\://www.synyx.org/schema/plugin=org.synyx.plugin.core.config.PluginNamespaceHandler

View File

@@ -0,0 +1 @@
http\://www.synyx.org/schema/plugin/plugin-config.xsd=org/synyx/plugin/core/config/plugin-config.xsd

View File

@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns="http://www.synyx.org/schema/plugin"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:tool="http://www.springframework.org/schema/tool"
targetNamespace="http://www.synyx.org/schema/plugin"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:import namespace="http://www.springframework.org/schema/tool"/>
<xsd:element name="list" type="pluginType">
<xsd:annotation>
<xsd:appinfo>
<tool:annotation>
<tool:exports identifier="@id" type="java.util.List" />
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="registry" type="pluginType">
<xsd:annotation>
<xsd:appinfo>
<tool:annotation>
<tool:exports identifier="@id" type="org.synyx.plugin.core.PluginRegistry" />
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="pluginType">
<xsd:attribute name="id" type="xsd:string" />
<xsd:attribute name="class" type="classType" />
<xsd:attribute name="init-factories" type="xsd:boolean" />
</xsd:complexType>
<xsd:simpleType name="classType">
<xsd:annotation>
<xsd:appinfo>
<tool:annotation kind="direct">
<tool:expected-type type="java.lang.Class" />
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
<xsd:union memberTypes="xsd:string" />
</xsd:simpleType>
</xsd:schema>

View File

@@ -0,0 +1,53 @@
package org.synyx.plugin.core;
import java.util.Arrays;
import java.util.List;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
/**
* Unit test for {@link PluginRegistry}.
*
* @author Oliver Gierke - gierke@synyx.de
*/
public class PluginRegistryUnitTest {
private SamplePlugin provider;
private PluginRegistry<SamplePlugin, String> registry;
/**
* Initializes a {@code PluginRegistry} and equips it with an {@code
* EmailNotificationProvider}.
*/
@Before
public void setUp() {
provider = new SamplePluginImplementation();
registry = PluginRegistry.create();
registry.setPlugins(Arrays.asList(provider));
}
/**
* Asserts asking for a plugin with the {@code PluginMetadata} provided by
* the {@link EmailNotificationProvider}.
*/
@Test
public void assertFindsEmailNotificationProvider() {
String metadata = "FOO";
List<SamplePlugin> plugins = registry.getPluginsFor(metadata);
Assert.assertNotNull(plugins);
Assert.assertEquals(1, plugins.size());
SamplePlugin provider = plugins.get(0);
Assert.assertTrue(provider instanceof SamplePluginImplementation);
}
}

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,34 @@
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;
/**
* Integration test to simply check if the configuration gets parsed correctly.
*
* @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