myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r935183 [1/4] - in /myfaces/extensions/cdi/trunk: ./ jse-modules/ jse-modules/message-module/ jse-modules/message-module/api/ jse-modules/message-module/api/src/ jse-modules/message-module/api/src/main/ jse-modules/message-module/api/src/ma...
Date Sat, 17 Apr 2010 14:53:43 GMT
Author: gpetracek
Date: Sat Apr 17 14:53:40 2010
New Revision: 935183

URL: http://svn.apache.org/viewvc?rev=935183&view=rev
Log:
[EXTCDI-21] first prototype

Added:
    myfaces/extensions/cdi/trunk/jse-modules/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/pom.xml
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/config/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/config/beans.xml
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/AbstractMessage.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/AbstractMessageHandler.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/AbstractMessageWithSeverity.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/CompositeMessageHandler.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/ConfigRegistry.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Formatter.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/FormatterFactory.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/GenericConfig.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/LocaleResolver.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Localizable.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Message.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContext.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContextAware.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContextConfig.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContextConfigAware.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageFilter.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageHandler.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageInterpolator.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageResolver.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageWithSeverity.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/NamedArgument.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/InternalMessage.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/MessagePayload.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/MessagePayloadKey.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/MessageSeverity.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/resources/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/resources/LICENSE.txt
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/resources/NOTICE.txt
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/pom.xml
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/config/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/config/beans.xml
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/AbstractFormatterAwareMessageInterpolator.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/CompositeMessageInterpolator.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultCompositeMessageHandler.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultFormatterFactory.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultInternalMessage.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultLocaleResolver.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultMessage.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultMessageBuilder.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultMessageContext.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultMessageContextConfig.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultMessageInterpolator.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultNamedArgument.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/ELAwareMessageInterpolator.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/NamedArguments.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/NumberedArgumentAwareMessageInterpolator.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/UnmodifiableMessageContext.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/UnmodifiableMessageContextConfig.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/formatter/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/formatter/DefaultNumberFormatter.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/formatter/FormatterBuilder.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/formatter/NumberFormatterConfigKeys.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/formatter/ToStringFormatter.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/spi/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/spi/ELProvider.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/spi/SimpleELContext.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/resources/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/resources/LICENSE.txt
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/resources/NOTICE.txt
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/AbstractTest.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/AllTests.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/ExtensibilityTest.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/FormattedMessageArgumentTest.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/HelperTest.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/MessageFilterTest.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/MessageSeverityTest.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/ParametrizedMessageInterpolationTest.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/PayloadTest.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/SimpleMessageTest.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestCustomMessageContext.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestELContext.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestELProvider.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestInMemoryMessageHandler.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestInternalMessageAwareMessageHandler.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestMessageResolver.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/messages_de.properties
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/messages_en.properties
Modified:
    myfaces/extensions/cdi/trunk/parent/pom.xml
    myfaces/extensions/cdi/trunk/pom.xml

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/pom.xml?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/pom.xml (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/pom.xml Sat Apr 17 14:53:40 2010
@@ -0,0 +1,79 @@
+<?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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>jar</packaging>
+
+    <groupId>org.apache.myfaces.extensions.cdi.jse-modules</groupId>
+    <artifactId>myfaces-extcdi-message-module-api</artifactId>
+
+    <name>MyFaces Extensions-CDI I18N Message 1.0 Module API</name>
+
+    <parent>
+        <groupId>org.apache.myfaces.extensions.cdi.jse-modules</groupId>
+        <artifactId>message-module-project</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/config</directory>
+                <includes>
+                    <include>**/*xml</include>
+                </includes>
+                <targetPath>/META-INF</targetPath>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <includes>
+                    <include>LICENSE.txt</include>
+                    <include>NOTICE.txt</include>
+                </includes>
+                <targetPath>/META-INF</targetPath>
+            </resource>
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*properties</include>
+                </includes>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <inherited>true</inherited>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/config/beans.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/config/beans.xml?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/config/beans.xml (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/config/beans.xml Sat Apr 17 14:53:40 2010
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+</beans>

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/AbstractMessage.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/AbstractMessage.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/AbstractMessage.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/AbstractMessage.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,264 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+import org.apache.myfaces.extensions.cdi.message.api.payload.MessagePayload;
+import org.apache.myfaces.extensions.cdi.message.api.payload.MessagePayloadKey;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collections;
+
+/**
+ * @author Gerhard Petracek
+ */
+public abstract class AbstractMessage implements Message, MessageContextConfigAware
+{
+    protected String messageTemplate;
+    protected Set<NamedArgument> namedArguments = new HashSet<NamedArgument>();
+    protected List<Serializable> arguments = new ArrayList<Serializable>();
+    protected Map<Class, Class<? extends MessagePayload>> messagePayload =
+            new HashMap<Class, Class<? extends MessagePayload>>();
+
+    //optional
+    @Deprecated
+    //currently not used - would be useful for messages which are aware of the original context they were created in
+    private MessageContextConfig messageContextConfig;
+
+    public AbstractMessage(Message message)
+    {
+        this(message.getTemplate(), message.getArguments());
+        this.messagePayload = message.getPayload();
+    }
+
+    public AbstractMessage(String messageTemplate, Serializable... arguments)
+    {
+        this.messageTemplate = messageTemplate;
+
+        for (Serializable argument : arguments)
+        {
+            if (argument instanceof Class && MessagePayload.class.isAssignableFrom((Class) argument))
+            {
+                //TODO log warning
+                //noinspection unchecked
+                addPayload((Class) argument);
+            }
+            else
+            {
+                addArgument(argument);
+            }
+        }
+        cleanup();
+    }
+
+    public AbstractMessage(String messageTemplate, Set<NamedArgument> namedArguments)
+    {
+        this.messageTemplate = messageTemplate;
+        this.namedArguments = namedArguments;
+        this.arguments = null;
+    }
+
+    public void addArgument(Serializable... arguments)
+    {
+        for (Serializable argument : arguments)
+        {
+            checkArgument(argument);
+            if (argument instanceof NamedArgument)
+            {
+                addNamedArgument((NamedArgument) argument);
+            }
+            else
+            {
+                addNumberedArgument(argument);
+            }
+        }
+    }
+
+    private void checkArgument(Serializable argument)
+    {
+        if (argument instanceof NamedArgument)
+        {
+            //noinspection SuspiciousMethodCalls
+            if (this.namedArguments != null)
+            {
+                for (NamedArgument namedArgument : this.namedArguments)
+                {
+                    if (namedArgument.getName().equals(((NamedArgument) argument).getName()))
+                    {
+                        throw new UnsupportedOperationException(
+                                "it isn't allowed to override arguments - argument name: " +
+                                        ((NamedArgument) argument).getName());
+                    }
+                }
+            }
+        }
+    }
+
+    protected void addNamedArgument(NamedArgument namedArgument)
+    {
+        if (this.namedArguments == null)
+        {
+            this.namedArguments = new HashSet<NamedArgument>();
+        }
+
+        this.namedArguments.add(namedArgument);
+    }
+
+    protected void addNumberedArgument(Serializable argument)
+    {
+        if (this.arguments == null)
+        {
+            this.arguments = new ArrayList<Serializable>();
+        }
+
+        this.arguments.add(argument);
+    }
+
+    public String getTemplate()
+    {
+        return this.messageTemplate;
+    }
+
+    public Serializable[] getArguments()
+    {
+        if (this.namedArguments == null && this.arguments == null)
+        {
+            return new Serializable[]{};
+        }
+
+        if (this.namedArguments == null)
+        {
+            return this.arguments.toArray(new Serializable[this.arguments.size()]);
+        }
+        else if (this.arguments == null)
+        {
+            return this.namedArguments.toArray(new Serializable[this.namedArguments.size()]);
+        }
+
+        List<Serializable> mergedArguments =
+                new ArrayList<Serializable>(this.namedArguments.size() + this.arguments.size());
+
+        mergedArguments.addAll(this.namedArguments);
+        mergedArguments.addAll(this.arguments);
+        return mergedArguments.toArray(new Serializable[mergedArguments.size()]);
+    }
+
+    public void addPayload(Class<? extends MessagePayload> payload)
+    {
+        Class key = payload;
+
+        if (payload.isAnnotationPresent(MessagePayloadKey.class))
+        {
+            key = payload.getAnnotation(MessagePayloadKey.class).value();
+        }
+        addPayload(key, payload);
+    }
+
+    public Map<Class, Class<? extends MessagePayload>> getPayload()
+    {
+        return Collections.unmodifiableMap(this.messagePayload);
+    }
+
+    public void addPayload(Class key, Class<? extends MessagePayload> payload)
+    {
+        if (this.messagePayload.containsKey(key))
+        {
+            throw new UnsupportedOperationException("it isn't allowed to override payload - key: " + key.getName());
+        }
+        this.messagePayload.put(key, payload);
+    }
+
+    public Message setMessageContextConfig(MessageContextConfig messageContextConfig)
+    {
+        this.messageContextConfig = messageContextConfig;
+        return this;
+    }
+
+    public MessageContextConfig getMessageContextConfig()
+    {
+        return this.messageContextConfig;
+    }
+
+    private void cleanup()
+    {
+        if (this.namedArguments != null && this.namedArguments.isEmpty())
+        {
+            this.namedArguments = null;
+        }
+
+        if (this.arguments != null && this.arguments.isEmpty())
+        {
+            this.arguments = null;
+        }
+    }
+
+    /*
+    * generated
+    */
+
+    @Override
+    public boolean equals(Object o)
+    {
+        if (this == o)
+        {
+            return true;
+        }
+        if (!(o instanceof AbstractMessage))
+        {
+            return false;
+        }
+
+        AbstractMessage that = (AbstractMessage) o;
+
+        if (messagePayload != null ? !messagePayload.equals(that.messagePayload) : that.messagePayload != null)
+        {
+            return false;
+        }
+        if (!messageTemplate.equals(that.messageTemplate))
+        {
+            return false;
+        }
+        if (namedArguments != null ? !namedArguments.equals(that.namedArguments) : that.namedArguments != null)
+        {
+            return false;
+        }
+        //noinspection RedundantIfStatement
+        if (arguments != null ? !arguments.equals(that.arguments) : that.arguments != null)
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    @Override
+    public int hashCode()
+    {
+        int result = messageTemplate.hashCode();
+        result = 31 * result + (namedArguments != null ? namedArguments.hashCode() : 0);
+        result = 31 * result + (arguments != null ? arguments.hashCode() : 0);
+        result = 31 * result + (messagePayload != null ? messagePayload.hashCode() : 0);
+        return result;
+    }
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/AbstractMessageHandler.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/AbstractMessageHandler.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/AbstractMessageHandler.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/AbstractMessageHandler.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,68 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author Gerhard Petracek
+ */
+public abstract class AbstractMessageHandler implements MessageHandler
+{
+    private Set<MessageFilter> messageFilters = new HashSet<MessageFilter>();
+
+    public void addMessage(MessageContext messageContext, Message message)
+    {
+        if (isMessageAllowed(messageContext, message))
+        {
+            processMessage(messageContext, message);
+        }
+    }
+
+    protected abstract void processMessage(MessageContext messageContext, Message message);
+
+    public void addMessageFilter(MessageFilter... messageFilters)
+    {
+        if (this.messageFilters == null)
+        {
+            this.messageFilters = new HashSet<MessageFilter>();
+        }
+        this.messageFilters.addAll(Arrays.asList(messageFilters));
+    }
+
+    public Set<MessageFilter> getMessageFilters()
+    {
+        return Collections.unmodifiableSet(this.messageFilters);
+    }
+
+    private boolean isMessageAllowed(MessageContext messageContext, Message message)
+    {
+        for (MessageFilter messageFilter : this.messageFilters)
+        {
+            if (!messageFilter.processMessage(messageContext, message))
+            {
+                return false;
+            }
+        }
+        return true;
+    }
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/AbstractMessageWithSeverity.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/AbstractMessageWithSeverity.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/AbstractMessageWithSeverity.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/AbstractMessageWithSeverity.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,57 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+import org.apache.myfaces.extensions.cdi.message.api.payload.MessagePayload;
+import org.apache.myfaces.extensions.cdi.message.api.payload.MessageSeverity;
+
+import java.io.Serializable;
+import java.util.Set;
+
+/**
+ * @author Gerhard Petracek
+ */
+public abstract class AbstractMessageWithSeverity extends AbstractMessage implements MessageWithSeverity
+{
+    public AbstractMessageWithSeverity(Message message)
+    {
+        super(message);
+    }
+
+    public AbstractMessageWithSeverity(String messageTemplate,
+                                       Class<? extends MessagePayload> severity,
+                                       Serializable... arguments)
+    {
+        super(messageTemplate, arguments);
+        addPayload(severity);
+    }
+
+    public AbstractMessageWithSeverity(String messageTemplate,
+                                       Class<? extends MessagePayload> severity,
+                                       Set<NamedArgument> namedArguments)
+    {
+        super(messageTemplate, namedArguments);
+        addPayload(severity);
+    }
+
+    public Class<? extends MessagePayload> getSeverity()
+    {
+        return getPayload().get(MessageSeverity.class);
+    }
+}
\ No newline at end of file

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/CompositeMessageHandler.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/CompositeMessageHandler.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/CompositeMessageHandler.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/CompositeMessageHandler.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,29 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+import java.util.List;
+
+/**
+ * @author Gerhard Petracek
+ */
+public interface CompositeMessageHandler extends MessageHandler
+{
+    List<MessageHandler> getMessageHandlers();
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/ConfigRegistry.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/ConfigRegistry.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/ConfigRegistry.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/ConfigRegistry.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,33 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+import java.util.List;
+
+/**
+ * TODO
+ *
+ * @author Gerhard Petracek
+ */
+public interface ConfigRegistry<T, B>
+{
+    B add(T t);
+
+    List<T> reset();
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Formatter.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Formatter.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Formatter.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Formatter.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,29 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+/**
+ * @author Gerhard Petracek
+ */
+public interface Formatter<T>
+{
+    boolean isResponsibleFor(Class<?> type);
+
+    String format(MessageContext messageContext, T valueToFormat);
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/FormatterFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/FormatterFactory.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/FormatterFactory.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/FormatterFactory.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,39 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+import java.io.Serializable;
+import java.util.Locale;
+
+/**
+ * @author Gerhard Petracek
+ */
+public interface FormatterFactory extends ConfigRegistry<Formatter, FormatterFactory>, Serializable
+{
+    Formatter findFormatter(Class<?> type);
+
+    void addFormatterConfig(Class<?> type, GenericConfig formatterConfig);
+
+    void addFormatterConfig(Class<?> type, GenericConfig formatterConfig, Locale locale);
+
+    /**
+     * @return the config for a given type and locale - null otherwise
+     */
+    GenericConfig findFormatterConfig(Class<?> type, Locale locale);
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/GenericConfig.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/GenericConfig.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/GenericConfig.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/GenericConfig.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,35 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+import java.io.Serializable;
+
+/**
+ * @author Gerhard Petracek
+ */
+public interface GenericConfig extends Serializable
+{
+    GenericConfig addProperty(String key, Serializable value);
+
+    Serializable getProperty(String key);
+
+    <T extends Serializable> T getProperty(String key, Class<T> targetType);
+
+    boolean containsProperty(String key);
+}
\ No newline at end of file

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/LocaleResolver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/LocaleResolver.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/LocaleResolver.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/LocaleResolver.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,29 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+import java.util.Locale;
+
+/**
+ * @author Gerhard Petracek
+ */
+public interface LocaleResolver
+{
+    Locale getLocale();
+}
\ No newline at end of file

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Localizable.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Localizable.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Localizable.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Localizable.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,27 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+/**
+ * @author Manfred Geiler
+ */
+public interface Localizable
+{
+    String toString(MessageContext messageContext);
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Message.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Message.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Message.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Message.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,40 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+import org.apache.myfaces.extensions.cdi.message.api.payload.MessagePayload;
+
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * @author Gerhard Petracek
+ */
+public interface Message extends Localizable, Serializable
+{
+    String getTemplate();
+
+    Serializable[] getArguments();
+
+    void addArgument(Serializable... arguments);
+
+    Map<Class, Class<? extends MessagePayload>> getPayload();
+
+    void addPayload(Class key, Class<? extends MessagePayload> payload);
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContext.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContext.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContext.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContext.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,66 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+import org.apache.myfaces.extensions.cdi.message.api.payload.MessagePayload;
+
+import java.io.Serializable;
+
+/**
+ * @author Gerhard Petracek
+ */
+public interface MessageContext extends LocaleResolver, MessageHandler, Serializable
+{
+    MessageBuilder message();
+
+    MessageContextConfig config();
+
+    <T extends MessageContext> T typed(Class<T> contextType);
+
+    /*
+    * convenient methods
+    */
+
+    MessageContext cloneContext();
+
+    String getMessageText(Message message);
+
+    void addMessage(Message message);
+
+    interface MessageBuilder
+    {
+        MessageBuilder payload(Class<? extends MessagePayload>... messagePayload);
+
+        MessageBuilder text(String messageTemplate);
+
+        MessageBuilder argument(Serializable... arguments);
+
+        MessageBuilder namedArgument(String name, Serializable value);
+
+        //see MessageContext for add(Message)
+
+        Message add();
+
+        Message create();
+
+        String toText();
+
+        String toText(Message message);
+    }
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContextAware.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContextAware.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContextAware.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContextAware.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,31 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+/**
+ * e.g. autom. supported for MessageResolver and MessageInterpolator
+ *
+ * @author Gerhard Petracek
+ */
+public interface MessageContextAware
+{
+    void setMessageContext(MessageContext messageContext);
+
+    MessageContext getMessageContext();
+}
\ No newline at end of file

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContextConfig.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContextConfig.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContextConfig.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContextConfig.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,79 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+import java.io.Serializable;
+import java.util.Locale;
+
+/**
+ * @author Gerhard Petracek
+ */
+public interface MessageContextConfig extends Serializable
+{
+    /**
+     * create a new context based on the default context - default context won't get modified
+     *
+     * @return
+     */
+    MessageContextBuilder use();
+
+    /**
+     * change the default context
+     *
+     * @return
+     */
+    MessageContextBuilder change();
+
+    MessageInterpolator getMessageInterpolator();
+
+    MessageResolver getMessageResolver();
+
+    LocaleResolver getLocaleResolver();
+
+    //TODO
+    MessageHandler getMessageHandler();
+
+    FormatterFactory getFormatterFactory();
+
+    interface MessageContextBuilder
+    {
+        MessageContextBuilder messageInterpolator(MessageInterpolator messageInterpolator);
+
+        MessageContextBuilder messageResolver(MessageResolver messageResolver);
+
+        MessageContextBuilder addFormatter(Formatter formatter);
+
+        MessageContextBuilder addFormatterConfig(Class<?> type, GenericConfig config);
+
+        MessageContextBuilder addFormatterConfig(Class<?> type, GenericConfig config, Locale locale);
+
+        MessageContextBuilder formatterFactory(FormatterFactory formatterFactory);
+
+        MessageContextBuilder addMessageHandler(MessageHandler messageHandler);
+
+        MessageContextBuilder localeResolver(LocaleResolver localeResolver);
+
+        MessageContextBuilder reset();
+
+        @Deprecated
+        MessageContextBuilder clear();
+
+        MessageContext create();
+    }
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContextConfigAware.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContextConfigAware.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContextConfigAware.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageContextConfigAware.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,32 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+/**
+ * TODO
+ * allows to store e.g. messages with the original config (if it is serializable)
+ *
+ * @author Gerhard Petracek
+ */
+public interface MessageContextConfigAware
+{
+    Message setMessageContextConfig(MessageContextConfig messageContextConfig);
+
+    MessageContextConfig getMessageContextConfig();
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageFilter.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageFilter.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageFilter.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageFilter.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,29 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+/**
+ * TODO add to config (multiple message handlers are possible)
+ *
+ * @author Gerhard Petracek
+ */
+public interface MessageFilter
+{
+    boolean processMessage(MessageContext messageContext, Message message);
+}
\ No newline at end of file

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageHandler.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageHandler.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageHandler.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageHandler.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,48 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * an implementation is allowed to store messages directly or to forward messages
+ *
+ * @author Gerhard Petracek
+ */
+public interface MessageHandler
+{
+    void addMessage(MessageContext messageContext, Message message);
+
+    void addMessageFilter(MessageFilter... messageFilters);
+
+    Set<MessageFilter> getMessageFilters();
+
+    //TODO move to a separated interface?
+
+    void removeMessage(Message message);
+
+    //TODO move to a separated interface?
+
+    void removeAllMessages();
+
+    //TODO move to a separated interface?
+
+    List<Message> getMessages();
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageInterpolator.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageInterpolator.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageInterpolator.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageInterpolator.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,30 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+import java.io.Serializable;
+
+/**
+ * @author Manfred Geiler
+ * @author Gerhard Petracek
+ */
+public interface MessageInterpolator
+{
+    String interpolate(String messageTemplate, Serializable... arguments);
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageResolver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageResolver.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageResolver.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageResolver.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,39 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+import org.apache.myfaces.extensions.cdi.message.api.payload.MessagePayload;
+
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * @author Gerhard Petracek
+ */
+public interface MessageResolver
+{
+    static final String MISSING_RESOURCE_MARKER = "???";
+
+    /**
+     * @param key    unique key
+     * @param locale
+     * @return the final but not interpolated message text
+     */
+    String getMessage(String key, Locale locale, Map<Class, Class<? extends MessagePayload>> payload);
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageWithSeverity.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageWithSeverity.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageWithSeverity.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageWithSeverity.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,29 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+import org.apache.myfaces.extensions.cdi.message.api.payload.MessagePayload;
+
+/**
+ * @author Gerhard Petracek
+ */
+public interface MessageWithSeverity extends Message
+{
+    Class<? extends MessagePayload> getSeverity();
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/NamedArgument.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/NamedArgument.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/NamedArgument.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/NamedArgument.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,31 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api;
+
+import java.io.Serializable;
+
+/**
+ * @author Gerhard Petracek
+ */
+public interface NamedArgument extends Serializable
+{
+    String getName();
+
+    Serializable getValue();
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/InternalMessage.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/InternalMessage.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/InternalMessage.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/InternalMessage.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,28 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api.payload;
+
+/**
+ * marker to indicate that a message shouldn't be displayed e.g. to the user
+ *
+ * @author Gerhard Petracek
+ */
+public interface InternalMessage extends MessagePayload
+{
+}
\ No newline at end of file

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/MessagePayload.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/MessagePayload.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/MessagePayload.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/MessagePayload.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,28 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api.payload;
+
+/**
+ * hint: enums,... have major issues with serialization (to different machines) and aren't extensible
+ *
+ * @author Gerhard Petracek
+ */
+public interface MessagePayload
+{
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/MessagePayloadKey.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/MessagePayloadKey.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/MessagePayloadKey.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/MessagePayloadKey.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,34 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api.payload;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * @author Gerhard Petracek
+ */
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface MessagePayloadKey
+{
+    Class value();
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/MessageSeverity.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/MessageSeverity.java?rev=935183&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/MessageSeverity.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/payload/MessageSeverity.java Sat Apr 17 14:53:40 2010
@@ -0,0 +1,45 @@
+/*
+ * 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.myfaces.extensions.cdi.message.api.payload;
+
+/**
+ * @author Gerhard Petracek
+ */
+public interface MessageSeverity
+{
+    @MessagePayloadKey(MessageSeverity.class)
+    public final class Info implements MessagePayload
+    {
+    }
+
+    @MessagePayloadKey(MessageSeverity.class)
+    public final class Warn implements MessagePayload
+    {
+    }
+
+    @MessagePayloadKey(MessageSeverity.class)
+    public final class Error implements MessagePayload
+    {
+    }
+
+    @MessagePayloadKey(MessageSeverity.class)
+    public final class Fatal implements MessagePayload
+    {
+    }
+}



Mime
View raw message