knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject [48/64] [partial] knox git commit: KNOX-998 - Refactoring save 1
Date Fri, 01 Sep 2017 13:17:46 GMT
http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleLdapDirectoryServer.java
----------------------------------------------------------------------
diff --git a/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleLdapDirectoryServer.java b/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleLdapDirectoryServer.java
new file mode 100644
index 0000000..9f59e9b
--- /dev/null
+++ b/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleLdapDirectoryServer.java
@@ -0,0 +1,124 @@
+/**
+ * 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.knox.gateway.security.ldap;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.directory.api.ldap.model.entry.DefaultModification;
+import org.apache.directory.api.ldap.model.entry.ModificationOperation;
+import org.apache.directory.api.ldap.model.exception.LdapException;
+import org.apache.directory.api.ldap.model.name.Dn;
+import org.apache.directory.server.core.api.CoreSession;
+import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.partition.Partition;
+import org.apache.directory.server.core.factory.DirectoryServiceFactory;
+import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.server.protocol.shared.store.LdifFileLoader;
+import org.apache.directory.server.protocol.shared.transport.TcpTransport;
+import org.apache.directory.server.protocol.shared.transport.Transport;
+import org.apache.log4j.PropertyConfigurator;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.net.ServerSocket;
+import java.util.UUID;
+
+public class SimpleLdapDirectoryServer {
+
+  private DirectoryServiceFactory factory;
+
+  private DirectoryService service;
+
+  private LdapServer server;
+
+  public SimpleLdapDirectoryServer( String rootDn, File usersLdif, Transport... transports ) throws Exception {
+    if( !usersLdif.exists() ) {
+      throw new FileNotFoundException( usersLdif.getAbsolutePath() );
+    }
+
+    factory = new SimpleDirectoryServiceFactory();
+    factory.init( UUID.randomUUID().toString() );
+    service = factory.getDirectoryService();
+
+    enabledPosixSchema( service );
+
+    Partition partition = factory.getPartitionFactory().createPartition(
+        service.getSchemaManager(), service.getDnFactory(), "users", rootDn, 500,
+        service.getInstanceLayout().getInstanceDirectory() );
+    service.addPartition( partition );
+
+    CoreSession session = service.getAdminSession();
+    LdifFileLoader lfl = new LdifFileLoader( session, usersLdif, null );
+    lfl.execute();
+
+    server = new LdapServer();
+    server.setTransports( transports );
+    server.setDirectoryService( service );
+  }
+
+  private static void enabledPosixSchema( DirectoryService service ) throws LdapException {
+    service.getSchemaManager().getLoadedSchema( "nis" ).enable();
+    service.getAdminSession().modify(
+        new Dn( "cn=nis,ou=schema" ),
+        new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, "m-disabled", "FALSE" ) );
+  }
+
+  public void start() throws Exception {
+    service.startup();
+    server.start();
+  }
+
+  public void stop( boolean clean ) throws Exception {
+    server.stop();
+    service.shutdown();
+    if( clean ) {
+      FileUtils.deleteDirectory( service.getInstanceLayout().getInstanceDirectory() );
+    }
+  }
+
+  public static void main( String[] args ) throws Exception {
+    PropertyConfigurator.configure( System.getProperty( "log4j.configuration" ) );
+
+    SimpleLdapDirectoryServer ldap;
+
+    File file;
+    if ( args.length < 1 ) {
+      file = new File( "conf/users.ldif" );
+    } else {
+      File dir = new File( args[0] );
+      if( !dir.exists() || !dir.isDirectory() ) {
+        throw new FileNotFoundException( dir.getAbsolutePath() );
+      }
+      file = new File( dir, "users.ldif" );
+    }
+
+    if( !file.exists() || !file.canRead() ) {
+      throw new FileNotFoundException( file.getAbsolutePath() );
+    }
+
+    int port = 33389;
+
+    // Make sure the port is free.
+    ServerSocket socket = new ServerSocket( port );
+    socket.close();
+
+    TcpTransport transport = new TcpTransport( port );
+    ldap = new SimpleLdapDirectoryServer( "dc=hadoop,dc=apache,dc=org", file, transport );
+    ldap.start();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-demo-ldap/src/test/java/org/apache/hadoop/gateway/security/ldap/SimpleLdapServerTest.java
----------------------------------------------------------------------
diff --git a/gateway-demo-ldap/src/test/java/org/apache/hadoop/gateway/security/ldap/SimpleLdapServerTest.java b/gateway-demo-ldap/src/test/java/org/apache/hadoop/gateway/security/ldap/SimpleLdapServerTest.java
deleted file mode 100644
index 33a367e..0000000
--- a/gateway-demo-ldap/src/test/java/org/apache/hadoop/gateway/security/ldap/SimpleLdapServerTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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.hadoop.gateway.security.ldap;
-
-import org.apache.directory.api.ldap.model.exception.LdapAuthenticationException;
-import org.apache.directory.api.ldap.model.exception.LdapException;
-import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.LdapNetworkConnection;
-import org.apache.directory.server.protocol.shared.transport.TcpTransport;
-import org.apache.directory.server.protocol.shared.transport.Transport;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.ServerSocket;
-
-import static org.junit.Assert.fail;
-
-public class SimpleLdapServerTest {
-
-  private static int port;
-  private static File ldifFile;
-  private static TcpTransport ldapTransport;
-  private static SimpleLdapDirectoryServer ldap;
-
-  @BeforeClass
-  public static void setup() throws Exception {
-    ldifFile = new File( ClassLoader.getSystemResource( "users.ldif" ).toURI() );
-    ldapTransport = new TcpTransport( 0 );
-    ldap = new SimpleLdapDirectoryServer( "dc=hadoop,dc=apache,dc=org", ldifFile, ldapTransport );
-    ldap.start();
-    port = ldapTransport.getAcceptor().getLocalAddress().getPort();
-  }
-
-  @AfterClass
-  public static void cleanup() throws Exception {
-    if( ldap != null ) {
-      ldap.stop( true );
-    }
-  }
-
-  @Test
-  public void testBind() throws LdapException, IOException {
-    LdapConnection connection;
-
-    connection = new LdapNetworkConnection( "localhost", port );
-    try {
-      connection.bind( "uid=guest,ou=people,dc=hadoop,dc=apache,dc=org", "guest-password" );
-    } finally {
-      connection.close();
-    }
-
-    connection = new LdapNetworkConnection( "localhost", port );
-    try {
-      connection.bind( "uid=nobody,ou=people,dc=hadoop,dc=apache,dc=org", "guest-password" );
-      fail( "Expected LdapAuthenticationException" );
-    } catch ( LdapAuthenticationException e ) {
-      // Expected
-    } finally {
-      connection.close();
-    }
-
-    connection = new LdapNetworkConnection( "localhost", port );
-    try {
-      connection.bind( "uid=guest,ou=people,dc=hadoop,dc=apache,dc=org", "wrong-password" );
-      fail( "Expected LdapAuthenticationException" );
-    } catch ( LdapAuthenticationException e ) {
-      // Expected
-    } finally {
-      connection.close();
-    }
-
-  }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-demo-ldap/src/test/java/org/apache/knox/gateway/security/ldap/SimpleLdapServerTest.java
----------------------------------------------------------------------
diff --git a/gateway-demo-ldap/src/test/java/org/apache/knox/gateway/security/ldap/SimpleLdapServerTest.java b/gateway-demo-ldap/src/test/java/org/apache/knox/gateway/security/ldap/SimpleLdapServerTest.java
new file mode 100644
index 0000000..8f20154
--- /dev/null
+++ b/gateway-demo-ldap/src/test/java/org/apache/knox/gateway/security/ldap/SimpleLdapServerTest.java
@@ -0,0 +1,91 @@
+/*
+ * 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.knox.gateway.security.ldap;
+
+import org.apache.directory.api.ldap.model.exception.LdapAuthenticationException;
+import org.apache.directory.api.ldap.model.exception.LdapException;
+import org.apache.directory.ldap.client.api.LdapConnection;
+import org.apache.directory.ldap.client.api.LdapNetworkConnection;
+import org.apache.directory.server.protocol.shared.transport.TcpTransport;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.IOException;
+
+import static org.junit.Assert.fail;
+
+public class SimpleLdapServerTest {
+
+  private static int port;
+  private static File ldifFile;
+  private static TcpTransport ldapTransport;
+  private static SimpleLdapDirectoryServer ldap;
+
+  @BeforeClass
+  public static void setup() throws Exception {
+    ldifFile = new File( ClassLoader.getSystemResource( "users.ldif" ).toURI() );
+    ldapTransport = new TcpTransport( 0 );
+    ldap = new SimpleLdapDirectoryServer( "dc=hadoop,dc=apache,dc=org", ldifFile, ldapTransport );
+    ldap.start();
+    port = ldapTransport.getAcceptor().getLocalAddress().getPort();
+  }
+
+  @AfterClass
+  public static void cleanup() throws Exception {
+    if( ldap != null ) {
+      ldap.stop( true );
+    }
+  }
+
+  @Test
+  public void testBind() throws LdapException, IOException {
+    LdapConnection connection;
+
+    connection = new LdapNetworkConnection( "localhost", port );
+    try {
+      connection.bind( "uid=guest,ou=people,dc=hadoop,dc=apache,dc=org", "guest-password" );
+    } finally {
+      connection.close();
+    }
+
+    connection = new LdapNetworkConnection( "localhost", port );
+    try {
+      connection.bind( "uid=nobody,ou=people,dc=hadoop,dc=apache,dc=org", "guest-password" );
+      fail( "Expected LdapAuthenticationException" );
+    } catch ( LdapAuthenticationException e ) {
+      // Expected
+    } finally {
+      connection.close();
+    }
+
+    connection = new LdapNetworkConnection( "localhost", port );
+    try {
+      connection.bind( "uid=guest,ou=people,dc=hadoop,dc=apache,dc=org", "wrong-password" );
+      fail( "Expected LdapAuthenticationException" );
+    } catch ( LdapAuthenticationException e ) {
+      // Expected
+    } finally {
+      connection.close();
+    }
+
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n-logging-log4j/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/log4j/Log4jMessageLogger.java
----------------------------------------------------------------------
diff --git a/gateway-i18n-logging-log4j/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/log4j/Log4jMessageLogger.java b/gateway-i18n-logging-log4j/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/log4j/Log4jMessageLogger.java
deleted file mode 100644
index f027d9f..0000000
--- a/gateway-i18n-logging-log4j/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/log4j/Log4jMessageLogger.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages.loggers.log4j;
-
-import org.apache.hadoop.gateway.i18n.messages.MessageLevel;
-import org.apache.hadoop.gateway.i18n.messages.MessageLogger;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.log4j.spi.LocationInfo;
-import org.apache.log4j.spi.LoggingEvent;
-import org.apache.log4j.spi.ThrowableInformation;
-
-public class Log4jMessageLogger implements MessageLogger {
-
-  private static String CLASS_NAME = Log4jMessageLogger.class.getName();
-
-  private Logger logger;
-
-  Log4jMessageLogger( Logger logger ) {
-    this.logger = logger;
-  }
-
-  @Override
-  public final boolean isLoggable( final MessageLevel level ) {
-    return logger.isEnabledFor( toLevel( level ) );
-  }
-
-  @Override
-  public final void log( final StackTraceElement caller, final MessageLevel messageLevel, final String messageId, final String messageText, final Throwable thrown ) {
-    LoggingEvent event = new LoggingEvent(
-        /* String fqnOfCategoryClass */ CLASS_NAME,
-        /* Category logger */ logger,
-        /* long timeStamp */ System.currentTimeMillis(),
-        /* Level level */ toLevel( messageLevel ),
-        /* Object message */ messageText,
-        /* String threadName */ Thread.currentThread().getName(),
-        /* ThrowableInformation throwable */ toThrownInformation( thrown ),
-        /* String ndc */ null,
-        /* LocationInfo info */ toLocationInfo( caller ),
-        /* java.util.Map properties */ null );
-    logger.callAppenders( event );
-  }
-
-  private static final ThrowableInformation toThrownInformation( final Throwable thrown ) {
-    ThrowableInformation info = null;
-    if( thrown != null ) {
-      info = new ThrowableInformation( thrown );
-    }
-    return info;
-  }
-
-  private static final LocationInfo toLocationInfo( final StackTraceElement caller ) {
-    LocationInfo info = null;
-    if( caller != null ) {
-        info = new LocationInfo( caller.getFileName(), caller.getClassName(), caller.getMethodName(), Integer.toString(caller.getLineNumber()) );
-    }
-    return info;
-  }
-
-  private static final Level toLevel( final MessageLevel level ) {
-    switch( level ) {
-      case FATAL: return Level.FATAL;
-      case ERROR: return Level.ERROR;
-      case WARN: return Level.WARN;
-      case INFO: return Level.INFO;
-      case DEBUG: return Level.DEBUG;
-      case TRACE: return Level.TRACE;
-      default: return Level.OFF;
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n-logging-log4j/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/log4j/Log4jMessageLoggerFactory.java
----------------------------------------------------------------------
diff --git a/gateway-i18n-logging-log4j/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/log4j/Log4jMessageLoggerFactory.java b/gateway-i18n-logging-log4j/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/log4j/Log4jMessageLoggerFactory.java
deleted file mode 100644
index 664053a..0000000
--- a/gateway-i18n-logging-log4j/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/log4j/Log4jMessageLoggerFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages.loggers.log4j;
-
-import org.apache.hadoop.gateway.i18n.messages.MessageLogger;
-import org.apache.hadoop.gateway.i18n.messages.MessageLoggerFactory;
-import org.apache.log4j.Logger;
-
-public class Log4jMessageLoggerFactory implements MessageLoggerFactory {
-
-  @Override
-  public MessageLogger getLogger( String name ) {
-    return new Log4jMessageLogger( Logger.getLogger( name ) );
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n-logging-log4j/src/main/java/org/apache/knox/gateway/i18n/messages/loggers/log4j/Log4jMessageLogger.java
----------------------------------------------------------------------
diff --git a/gateway-i18n-logging-log4j/src/main/java/org/apache/knox/gateway/i18n/messages/loggers/log4j/Log4jMessageLogger.java b/gateway-i18n-logging-log4j/src/main/java/org/apache/knox/gateway/i18n/messages/loggers/log4j/Log4jMessageLogger.java
new file mode 100644
index 0000000..4c66e5c
--- /dev/null
+++ b/gateway-i18n-logging-log4j/src/main/java/org/apache/knox/gateway/i18n/messages/loggers/log4j/Log4jMessageLogger.java
@@ -0,0 +1,87 @@
+/**
+ * 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.knox.gateway.i18n.messages.loggers.log4j;
+
+import org.apache.knox.gateway.i18n.messages.MessageLevel;
+import org.apache.knox.gateway.i18n.messages.MessageLogger;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.log4j.spi.LocationInfo;
+import org.apache.log4j.spi.LoggingEvent;
+import org.apache.log4j.spi.ThrowableInformation;
+
+public class Log4jMessageLogger implements MessageLogger {
+
+  private static String CLASS_NAME = Log4jMessageLogger.class.getName();
+
+  private Logger logger;
+
+  Log4jMessageLogger( Logger logger ) {
+    this.logger = logger;
+  }
+
+  @Override
+  public final boolean isLoggable( final MessageLevel level ) {
+    return logger.isEnabledFor( toLevel( level ) );
+  }
+
+  @Override
+  public final void log( final StackTraceElement caller, final MessageLevel messageLevel, final String messageId, final String messageText, final Throwable thrown ) {
+    LoggingEvent event = new LoggingEvent(
+        /* String fqnOfCategoryClass */ CLASS_NAME,
+        /* Category logger */ logger,
+        /* long timeStamp */ System.currentTimeMillis(),
+        /* Level level */ toLevel( messageLevel ),
+        /* Object message */ messageText,
+        /* String threadName */ Thread.currentThread().getName(),
+        /* ThrowableInformation throwable */ toThrownInformation( thrown ),
+        /* String ndc */ null,
+        /* LocationInfo info */ toLocationInfo( caller ),
+        /* java.util.Map properties */ null );
+    logger.callAppenders( event );
+  }
+
+  private static final ThrowableInformation toThrownInformation( final Throwable thrown ) {
+    ThrowableInformation info = null;
+    if( thrown != null ) {
+      info = new ThrowableInformation( thrown );
+    }
+    return info;
+  }
+
+  private static final LocationInfo toLocationInfo( final StackTraceElement caller ) {
+    LocationInfo info = null;
+    if( caller != null ) {
+        info = new LocationInfo( caller.getFileName(), caller.getClassName(), caller.getMethodName(), Integer.toString(caller.getLineNumber()) );
+    }
+    return info;
+  }
+
+  private static final Level toLevel( final MessageLevel level ) {
+    switch( level ) {
+      case FATAL: return Level.FATAL;
+      case ERROR: return Level.ERROR;
+      case WARN: return Level.WARN;
+      case INFO: return Level.INFO;
+      case DEBUG: return Level.DEBUG;
+      case TRACE: return Level.TRACE;
+      default: return Level.OFF;
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n-logging-log4j/src/main/java/org/apache/knox/gateway/i18n/messages/loggers/log4j/Log4jMessageLoggerFactory.java
----------------------------------------------------------------------
diff --git a/gateway-i18n-logging-log4j/src/main/java/org/apache/knox/gateway/i18n/messages/loggers/log4j/Log4jMessageLoggerFactory.java b/gateway-i18n-logging-log4j/src/main/java/org/apache/knox/gateway/i18n/messages/loggers/log4j/Log4jMessageLoggerFactory.java
new file mode 100644
index 0000000..5a908cb
--- /dev/null
+++ b/gateway-i18n-logging-log4j/src/main/java/org/apache/knox/gateway/i18n/messages/loggers/log4j/Log4jMessageLoggerFactory.java
@@ -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.knox.gateway.i18n.messages.loggers.log4j;
+
+import org.apache.knox.gateway.i18n.messages.MessageLogger;
+import org.apache.knox.gateway.i18n.messages.MessageLoggerFactory;
+import org.apache.log4j.Logger;
+
+public class Log4jMessageLoggerFactory implements MessageLoggerFactory {
+
+  @Override
+  public MessageLogger getLogger( String name ) {
+    return new Log4jMessageLogger( Logger.getLogger( name ) );
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n-logging-log4j/src/main/resources/META-INF/services/org.apache.hadoop.gateway.i18n.messages.MessageLoggerFactory
----------------------------------------------------------------------
diff --git a/gateway-i18n-logging-log4j/src/main/resources/META-INF/services/org.apache.hadoop.gateway.i18n.messages.MessageLoggerFactory b/gateway-i18n-logging-log4j/src/main/resources/META-INF/services/org.apache.hadoop.gateway.i18n.messages.MessageLoggerFactory
deleted file mode 100644
index 988ecd6..0000000
--- a/gateway-i18n-logging-log4j/src/main/resources/META-INF/services/org.apache.hadoop.gateway.i18n.messages.MessageLoggerFactory
+++ /dev/null
@@ -1,19 +0,0 @@
-##########################################################################
-# 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.
-##########################################################################
-
-org.apache.hadoop.gateway.i18n.messages.loggers.log4j.Log4jMessageLoggerFactory
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n-logging-log4j/src/main/resources/META-INF/services/org.apache.knox.gateway.i18n.messages.MessageLoggerFactory
----------------------------------------------------------------------
diff --git a/gateway-i18n-logging-log4j/src/main/resources/META-INF/services/org.apache.knox.gateway.i18n.messages.MessageLoggerFactory b/gateway-i18n-logging-log4j/src/main/resources/META-INF/services/org.apache.knox.gateway.i18n.messages.MessageLoggerFactory
new file mode 100644
index 0000000..ba8d704
--- /dev/null
+++ b/gateway-i18n-logging-log4j/src/main/resources/META-INF/services/org.apache.knox.gateway.i18n.messages.MessageLoggerFactory
@@ -0,0 +1,19 @@
+##########################################################################
+# 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.
+##########################################################################
+
+org.apache.knox.gateway.i18n.messages.loggers.log4j.Log4jMessageLoggerFactory
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n-logging-log4j/src/test/java/org/apache/hadoop/gateway/i18n/messages/loggers/log4j/Log4jMessageLoggerFactoryTest.java
----------------------------------------------------------------------
diff --git a/gateway-i18n-logging-log4j/src/test/java/org/apache/hadoop/gateway/i18n/messages/loggers/log4j/Log4jMessageLoggerFactoryTest.java b/gateway-i18n-logging-log4j/src/test/java/org/apache/hadoop/gateway/i18n/messages/loggers/log4j/Log4jMessageLoggerFactoryTest.java
deleted file mode 100644
index 2d97f27..0000000
--- a/gateway-i18n-logging-log4j/src/test/java/org/apache/hadoop/gateway/i18n/messages/loggers/log4j/Log4jMessageLoggerFactoryTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages.loggers.log4j;
-
-import org.apache.hadoop.gateway.i18n.messages.MessageLoggerFactory;
-import org.junit.Test;
-
-import java.util.Iterator;
-import java.util.ServiceLoader;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.fail;
-
-public class Log4jMessageLoggerFactoryTest {
-
-  @Test
-  public void testServiceLoader() throws Exception {
-    ServiceLoader loader = ServiceLoader.load( MessageLoggerFactory.class );
-    Iterator iterator = loader.iterator();
-    assertThat( "Service iterator empty.", iterator.hasNext() );
-    while( iterator.hasNext() ) {
-      Object object = iterator.next();
-      if( object instanceof Log4jMessageLoggerFactory ) {
-        return;
-      }
-    }
-    fail( "Failed to find " + Log4jMessageLoggerFactory.class.getName() + " via service loader." );
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n-logging-log4j/src/test/java/org/apache/knox/gateway/i18n/messages/loggers/log4j/Log4jMessageLoggerFactoryTest.java
----------------------------------------------------------------------
diff --git a/gateway-i18n-logging-log4j/src/test/java/org/apache/knox/gateway/i18n/messages/loggers/log4j/Log4jMessageLoggerFactoryTest.java b/gateway-i18n-logging-log4j/src/test/java/org/apache/knox/gateway/i18n/messages/loggers/log4j/Log4jMessageLoggerFactoryTest.java
new file mode 100644
index 0000000..26d25e8
--- /dev/null
+++ b/gateway-i18n-logging-log4j/src/test/java/org/apache/knox/gateway/i18n/messages/loggers/log4j/Log4jMessageLoggerFactoryTest.java
@@ -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.knox.gateway.i18n.messages.loggers.log4j;
+
+import org.apache.knox.gateway.i18n.messages.MessageLoggerFactory;
+import org.junit.Test;
+
+import java.util.Iterator;
+import java.util.ServiceLoader;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.fail;
+
+public class Log4jMessageLoggerFactoryTest {
+
+  @Test
+  public void testServiceLoader() throws Exception {
+    ServiceLoader loader = ServiceLoader.load( MessageLoggerFactory.class );
+    Iterator iterator = loader.iterator();
+    assertThat( "Service iterator empty.", iterator.hasNext() );
+    while( iterator.hasNext() ) {
+      Object object = iterator.next();
+      if( object instanceof Log4jMessageLoggerFactory ) {
+        return;
+      }
+    }
+    fail( "Failed to find " + Log4jMessageLoggerFactory.class.getName() + " via service loader." );
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n-logging-sl4j/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLogger.java
----------------------------------------------------------------------
diff --git a/gateway-i18n-logging-sl4j/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLogger.java b/gateway-i18n-logging-sl4j/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLogger.java
deleted file mode 100644
index c129500..0000000
--- a/gateway-i18n-logging-sl4j/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLogger.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages.loggers.sl4j;
-
-import org.apache.hadoop.gateway.i18n.messages.MessageLevel;
-import org.apache.hadoop.gateway.i18n.messages.MessageLogger;
-import org.slf4j.Logger;
-
-public class Sl4jMessageLogger implements MessageLogger {
-
-  private Logger logger;
-
-  Sl4jMessageLogger( Logger logger ) {
-    this.logger = logger;
-  }
-
-  @Override
-  public boolean isLoggable( MessageLevel level ) {
-    switch( level ) {
-      case FATAL: return logger.isErrorEnabled();
-      case ERROR: return logger.isErrorEnabled();
-      case WARN: return logger.isWarnEnabled();
-      case INFO: return logger.isInfoEnabled();
-      case DEBUG: return logger.isDebugEnabled();
-      case TRACE: return logger.isTraceEnabled();
-      default: return false;
-    }
-  }
-
-  @Override
-  public void log( final StackTraceElement caller, final MessageLevel messageLevel, final String messageId, final String messageText, final Throwable thrown ) {
-    switch( messageLevel ) {
-      case FATAL:
-      case ERROR:
-        if( thrown == null )
-          logger.error( messageText );
-        else
-          logger.error( messageText, thrown );
-        break;
-      case WARN:
-        if( thrown == null )
-          logger.warn( messageText );
-        else
-          logger.warn( messageText, thrown );
-        break;
-      case INFO:
-        if( thrown == null )
-          logger.info( messageText );
-        else
-          logger.info( messageText, thrown );
-        break;
-      case DEBUG:
-        if( thrown == null )
-          logger.debug( messageText );
-        else
-          logger.debug( messageText, thrown );
-        break;
-      case TRACE:
-        if( thrown == null )
-          logger.trace( messageText );
-        else
-          logger.trace( messageText, thrown );
-        break;
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n-logging-sl4j/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLoggerFactory.java
----------------------------------------------------------------------
diff --git a/gateway-i18n-logging-sl4j/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLoggerFactory.java b/gateway-i18n-logging-sl4j/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLoggerFactory.java
deleted file mode 100644
index 0fe4794..0000000
--- a/gateway-i18n-logging-sl4j/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLoggerFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages.loggers.sl4j;
-
-import org.apache.hadoop.gateway.i18n.messages.MessageLogger;
-import org.apache.hadoop.gateway.i18n.messages.MessageLoggerFactory;
-import org.slf4j.LoggerFactory;
-
-public class Sl4jMessageLoggerFactory implements MessageLoggerFactory {
-
-  @Override
-  public MessageLogger getLogger( String name ) {
-    return new Sl4jMessageLogger( LoggerFactory.getLogger( name ) );
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n-logging-sl4j/src/main/java/org/apache/knox/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLogger.java
----------------------------------------------------------------------
diff --git a/gateway-i18n-logging-sl4j/src/main/java/org/apache/knox/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLogger.java b/gateway-i18n-logging-sl4j/src/main/java/org/apache/knox/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLogger.java
new file mode 100644
index 0000000..03239dc
--- /dev/null
+++ b/gateway-i18n-logging-sl4j/src/main/java/org/apache/knox/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLogger.java
@@ -0,0 +1,82 @@
+/**
+ * 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.knox.gateway.i18n.messages.loggers.sl4j;
+
+import org.apache.knox.gateway.i18n.messages.MessageLevel;
+import org.apache.knox.gateway.i18n.messages.MessageLogger;
+import org.slf4j.Logger;
+
+public class Sl4jMessageLogger implements MessageLogger {
+
+  private Logger logger;
+
+  Sl4jMessageLogger( Logger logger ) {
+    this.logger = logger;
+  }
+
+  @Override
+  public boolean isLoggable( MessageLevel level ) {
+    switch( level ) {
+      case FATAL: return logger.isErrorEnabled();
+      case ERROR: return logger.isErrorEnabled();
+      case WARN: return logger.isWarnEnabled();
+      case INFO: return logger.isInfoEnabled();
+      case DEBUG: return logger.isDebugEnabled();
+      case TRACE: return logger.isTraceEnabled();
+      default: return false;
+    }
+  }
+
+  @Override
+  public void log( final StackTraceElement caller, final MessageLevel messageLevel, final String messageId, final String messageText, final Throwable thrown ) {
+    switch( messageLevel ) {
+      case FATAL:
+      case ERROR:
+        if( thrown == null )
+          logger.error( messageText );
+        else
+          logger.error( messageText, thrown );
+        break;
+      case WARN:
+        if( thrown == null )
+          logger.warn( messageText );
+        else
+          logger.warn( messageText, thrown );
+        break;
+      case INFO:
+        if( thrown == null )
+          logger.info( messageText );
+        else
+          logger.info( messageText, thrown );
+        break;
+      case DEBUG:
+        if( thrown == null )
+          logger.debug( messageText );
+        else
+          logger.debug( messageText, thrown );
+        break;
+      case TRACE:
+        if( thrown == null )
+          logger.trace( messageText );
+        else
+          logger.trace( messageText, thrown );
+        break;
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n-logging-sl4j/src/main/java/org/apache/knox/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLoggerFactory.java
----------------------------------------------------------------------
diff --git a/gateway-i18n-logging-sl4j/src/main/java/org/apache/knox/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLoggerFactory.java b/gateway-i18n-logging-sl4j/src/main/java/org/apache/knox/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLoggerFactory.java
new file mode 100644
index 0000000..2ff932a
--- /dev/null
+++ b/gateway-i18n-logging-sl4j/src/main/java/org/apache/knox/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLoggerFactory.java
@@ -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.knox.gateway.i18n.messages.loggers.sl4j;
+
+import org.apache.knox.gateway.i18n.messages.MessageLogger;
+import org.apache.knox.gateway.i18n.messages.MessageLoggerFactory;
+import org.slf4j.LoggerFactory;
+
+public class Sl4jMessageLoggerFactory implements MessageLoggerFactory {
+
+  @Override
+  public MessageLogger getLogger( String name ) {
+    return new Sl4jMessageLogger( LoggerFactory.getLogger( name ) );
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n-logging-sl4j/src/main/resources/META-INF/services/org.apache.hadoop.gateway.i18n.messages.MessageLoggerFactory
----------------------------------------------------------------------
diff --git a/gateway-i18n-logging-sl4j/src/main/resources/META-INF/services/org.apache.hadoop.gateway.i18n.messages.MessageLoggerFactory b/gateway-i18n-logging-sl4j/src/main/resources/META-INF/services/org.apache.hadoop.gateway.i18n.messages.MessageLoggerFactory
deleted file mode 100644
index afd88bd..0000000
--- a/gateway-i18n-logging-sl4j/src/main/resources/META-INF/services/org.apache.hadoop.gateway.i18n.messages.MessageLoggerFactory
+++ /dev/null
@@ -1,19 +0,0 @@
-##########################################################################
-# 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.
-##########################################################################
-
-org.apache.hadoop.gateway.i18n.messages.loggers.sl4j.Sl4jMessageLoggerFactory
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n-logging-sl4j/src/main/resources/META-INF/services/org.apache.knox.gateway.i18n.messages.MessageLoggerFactory
----------------------------------------------------------------------
diff --git a/gateway-i18n-logging-sl4j/src/main/resources/META-INF/services/org.apache.knox.gateway.i18n.messages.MessageLoggerFactory b/gateway-i18n-logging-sl4j/src/main/resources/META-INF/services/org.apache.knox.gateway.i18n.messages.MessageLoggerFactory
new file mode 100644
index 0000000..0fc7b6b
--- /dev/null
+++ b/gateway-i18n-logging-sl4j/src/main/resources/META-INF/services/org.apache.knox.gateway.i18n.messages.MessageLoggerFactory
@@ -0,0 +1,19 @@
+##########################################################################
+# 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.
+##########################################################################
+
+org.apache.knox.gateway.i18n.messages.loggers.sl4j.Sl4jMessageLoggerFactory
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n-logging-sl4j/src/test/java/org/apache/hadoop/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLoggerFactoryTest.java
----------------------------------------------------------------------
diff --git a/gateway-i18n-logging-sl4j/src/test/java/org/apache/hadoop/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLoggerFactoryTest.java b/gateway-i18n-logging-sl4j/src/test/java/org/apache/hadoop/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLoggerFactoryTest.java
deleted file mode 100644
index 699ad3d..0000000
--- a/gateway-i18n-logging-sl4j/src/test/java/org/apache/hadoop/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLoggerFactoryTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages.loggers.sl4j;
-
-import org.apache.hadoop.gateway.i18n.messages.MessageLoggerFactory;
-import org.junit.Test;
-
-import java.util.Iterator;
-import java.util.ServiceLoader;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.fail;
-
-public class Sl4jMessageLoggerFactoryTest {
-
-  @Test
-  public void testServiceLoader() throws Exception {
-    ServiceLoader loader = ServiceLoader.load( MessageLoggerFactory.class );
-    Iterator iterator = loader.iterator();
-    assertThat( "Service iterator empty.", iterator.hasNext() );
-    while( iterator.hasNext() ) {
-      Object object = iterator.next();
-      if( object instanceof Sl4jMessageLoggerFactory ) {
-        return;
-      }
-    }
-    fail( "Failed to find " + Sl4jMessageLoggerFactory.class.getName() + " via service loader." );
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n-logging-sl4j/src/test/java/org/apache/knox/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLoggerFactoryTest.java
----------------------------------------------------------------------
diff --git a/gateway-i18n-logging-sl4j/src/test/java/org/apache/knox/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLoggerFactoryTest.java b/gateway-i18n-logging-sl4j/src/test/java/org/apache/knox/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLoggerFactoryTest.java
new file mode 100644
index 0000000..7d2a6d0
--- /dev/null
+++ b/gateway-i18n-logging-sl4j/src/test/java/org/apache/knox/gateway/i18n/messages/loggers/sl4j/Sl4jMessageLoggerFactoryTest.java
@@ -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.knox.gateway.i18n.messages.loggers.sl4j;
+
+import org.apache.knox.gateway.i18n.messages.MessageLoggerFactory;
+import org.junit.Test;
+
+import java.util.Iterator;
+import java.util.ServiceLoader;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.fail;
+
+public class Sl4jMessageLoggerFactoryTest {
+
+  @Test
+  public void testServiceLoader() throws Exception {
+    ServiceLoader loader = ServiceLoader.load( MessageLoggerFactory.class );
+    Iterator iterator = loader.iterator();
+    assertThat( "Service iterator empty.", iterator.hasNext() );
+    while( iterator.hasNext() ) {
+      Object object = iterator.next();
+      if( object instanceof Sl4jMessageLoggerFactory ) {
+        return;
+      }
+    }
+    fail( "Failed to find " + Sl4jMessageLoggerFactory.class.getName() + " via service loader." );
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/Message.java
----------------------------------------------------------------------
diff --git a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/Message.java b/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/Message.java
deleted file mode 100644
index bc63e79..0000000
--- a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/Message.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- *
- */
-@Retention( RetentionPolicy.RUNTIME )
-@Target( ElementType.METHOD )
-public @interface Message {
-  static final String DEFAULT_TEXT = "{}";
-  static final int DEFAULT_CODE = -1;
-  MessageLevel level() default MessageLevel.INFO;
-  int code() default DEFAULT_CODE;
-  String text() default DEFAULT_TEXT;
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessageLevel.java
----------------------------------------------------------------------
diff --git a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessageLevel.java b/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessageLevel.java
deleted file mode 100644
index ae2cc0b..0000000
--- a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessageLevel.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages;
-
-/**
- *
- */
-public enum MessageLevel {
-  FATAL, ERROR, WARN, INFO, DEBUG, TRACE
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessageLogger.java
----------------------------------------------------------------------
diff --git a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessageLogger.java b/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessageLogger.java
deleted file mode 100644
index 5ab41ad..0000000
--- a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessageLogger.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages;
-
-/**
- *
- */
-public interface MessageLogger {
-
-  boolean isLoggable( MessageLevel level );
-
-  void log( StackTraceElement caller, MessageLevel messageLevel, String messageId, String messageText, Throwable thrown );
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessageLoggerFactory.java
----------------------------------------------------------------------
diff --git a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessageLoggerFactory.java b/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessageLoggerFactory.java
deleted file mode 100644
index e0e61c7..0000000
--- a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessageLoggerFactory.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages;
-
-/**
- *
- */
-public interface MessageLoggerFactory {
-
-  MessageLogger getLogger( String name );
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/Messages.java
----------------------------------------------------------------------
diff --git a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/Messages.java b/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/Messages.java
deleted file mode 100644
index 68579b8..0000000
--- a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/Messages.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- *
- */
-@Retention( RetentionPolicy.RUNTIME )
-@Target( ElementType.TYPE )
-public @interface Messages {
-  static final String DEFAULT_BUNDLE = "";
-  static final String DEFAULT_LOGGER = "";
-  static final String DEFAULT_CODES = "{0}";
-  String bundle() default DEFAULT_BUNDLE;
-  String logger() default DEFAULT_LOGGER;
-  String codes() default DEFAULT_CODES;
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessagesFactory.java
----------------------------------------------------------------------
diff --git a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessagesFactory.java b/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessagesFactory.java
deleted file mode 100644
index 7ba766a..0000000
--- a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessagesFactory.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages;
-
-import org.apache.hadoop.gateway.i18n.messages.loggers.jdk.JdkMessageLoggerFactory;
-import org.apache.hadoop.gateway.i18n.messages.loggers.sout.SoutMessageLoggerFactory;
-import org.apache.hadoop.gateway.i18n.messages.loggers.sout.SoutMessageLoggerFactory;
-
-import java.lang.reflect.Proxy;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.ServiceLoader;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- *
- */
-public class MessagesFactory {
-
-  private static MessageLoggerFactory loggers = getMessageLoggerFactory();
-  private static Map<Class<?>, Object> proxies = new ConcurrentHashMap<Class<?>, Object>();
-
-  @SuppressWarnings( "unchecked" )
-  public static <T> T get( Class<T> clazz ) {
-    Object proxy = proxies.get( clazz );
-    if( proxy == null ) {
-      Messages anno = clazz.getAnnotation( Messages.class );
-      if( anno == null ) {
-        throw new IllegalArgumentException( clazz.getName() + " missing @" + Messages.class.getCanonicalName() );
-      }
-      MessagesInvoker invoker = new MessagesInvoker( clazz, loggers );
-      proxy = Proxy.newProxyInstance( clazz.getClassLoader(), new Class[]{ clazz }, invoker );
-      proxies.put( clazz, proxy );
-    }
-    return (T)proxy;
-  }
-
-  private static MessageLoggerFactory getMessageLoggerFactory() {
-    MessageLoggerFactory factory;
-    ServiceLoader<MessageLoggerFactory> loader = ServiceLoader.load( MessageLoggerFactory.class );
-    Iterator<MessageLoggerFactory> factories = loader.iterator();
-    if( factories != null && factories.hasNext() ) {
-      factory = loader.iterator().next();
-    } else {
-      factory = new JdkMessageLoggerFactory();
-    }
-    return factory;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessagesInvoker.java
----------------------------------------------------------------------
diff --git a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessagesInvoker.java b/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessagesInvoker.java
deleted file mode 100644
index 7fad77d..0000000
--- a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/MessagesInvoker.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages;
-
-import org.apache.hadoop.gateway.i18n.resources.ResourcesInvoker;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.text.MessageFormat;
-
-/**
- *
- */
-public class MessagesInvoker extends ResourcesInvoker implements InvocationHandler {
-
-  private String codes;
-  private MessageLogger logger;
-  private String bundle;
-
-  public MessagesInvoker( Class<?> clazz, MessageLoggerFactory loggers ) {
-    super( clazz );
-    Messages anno = clazz.getAnnotation( Messages.class );
-    codes = calcCodePattern( clazz, anno );
-    bundle = calcBundleName( clazz, anno );
-    logger = getLogger( clazz, anno, loggers );
-  }
-
-  @Override
-  public Object invoke( final Object proxy, final Method method, final Object[] args ) throws Throwable {
-    String message = null;
-    MessageLevel level = getLevel( method );
-    if( logger.isLoggable( level ) ) {
-      message = getText( method, args );
-      String code = getCode( method );
-      Throwable throwable = findLoggableThrowable( logger, method, args );
-      // Supposedly this Throwable way is faster than the Thread way.
-      // From looking at the JRE code it looks this is probably the case.
-      // The second version ends up calling the first version after getting the current thread
-      // and then checking that it is being called from the current thread.
-      //TODO: Should probably only do this if the logger is at debug or finer to make sure there isn't a performance impact during production usage.
-      StackTraceElement caller = new Throwable().getStackTrace()[2];
-      // StackTraceElement caller = Thread.currentThread().getStackTrace()[3];
-      logger.log( caller, level, code, message, throwable );
-    }
-    return message;
-  }
-
-  private final String getCode( final Method method ) {
-    String code = null;
-    Message anno = method.getAnnotation( Message.class );
-    if( anno != null ) {
-      int num = anno.code();
-      if( Message.DEFAULT_CODE != num ) {
-        code = MessageFormat.format( codes, num );
-      }
-    }
-    return code;
-  }
-
-  private static final StackTrace getStackTraceAnno( final Method method, final int param ) {
-    final Annotation[] annos = method.getParameterAnnotations()[ param ];
-    for( Annotation anno: annos ) {
-      if( anno instanceof StackTrace ) {
-        return (StackTrace)anno;
-      }
-    }
-    return null;
-  }
-
-  private static final Throwable findLoggableThrowable( final MessageLogger logger, final Method method, final Object[] args ) {
-    Throwable throwable = null;
-    if( args != null ) {
-      for( int i=0; i<args.length; i++ ) {
-        Object arg = args[i];
-        if( arg instanceof Throwable ) {
-          StackTrace anno = getStackTraceAnno( method, i );
-          if( anno != null ) {
-            if( logger.isLoggable( anno.level() ) ) {
-              throwable = (Throwable)arg;
-              break;
-            }
-          }
-        }
-      }
-    }
-    return throwable;
-  }
-
-  protected String getAnnotationPattern( final Method method ) {
-    String pattern = null;
-    Message anno = method.getAnnotation( Message.class );
-    if( anno != null ) {
-      pattern = anno.text();
-    }
-    return pattern;
-  }
-
-  private static final MessageLevel getLevel( final Method method ) {
-    MessageLevel level;
-    Message anno = method.getAnnotation( Message.class );
-    if( anno == null ) {
-      level = MessageLevel.INFO;
-    } else {
-      level = anno.level();
-    }
-    return level;
-  }
-
-  private static String calcCodePattern( final Class<?> clazz, final Messages anno ) {
-    String pattern = anno.codes();
-    if( Messages.DEFAULT_CODES.equals( pattern ) ) {
-      pattern = clazz.getCanonicalName().replace( '.', '/' );
-    }
-    return pattern;
-  }
-
-  private static String calcBundleName( Class<?> clazz, Messages anno ) {
-    String bundle = null;
-    if( anno != null ) {
-      bundle = anno.bundle();
-      if( Messages.DEFAULT_BUNDLE.equals( bundle ) ) {
-        bundle = null;
-      }
-    }
-    if( bundle == null ) {
-      bundle = clazz.getCanonicalName().replace( '.', '/' );
-    }
-    return bundle;
-  }
-
-  private static final String calcLoggerName( final Class<?> clazz, final Messages anno ) {
-    String logger = null;
-    if( anno != null ) {
-      logger = anno.logger();
-      if( Messages.DEFAULT_LOGGER.equals( logger ) ) {
-        logger = null;
-      }
-    }
-    if( logger == null ) {
-      logger = clazz.getCanonicalName();
-    }
-    return logger;
-  }
-
-  protected String getBundleName() {
-    return bundle;
-  }
-
-  private static final MessageLogger getLogger( final Class<?> clazz, final Messages anno, final MessageLoggerFactory loggers ) {
-    return loggers.getLogger( calcLoggerName( clazz, anno ) );
-  }
-
-  public String toString() {
-    return "MessageInvoker["+bundle+"]";
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/StackTrace.java
----------------------------------------------------------------------
diff --git a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/StackTrace.java b/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/StackTrace.java
deleted file mode 100644
index 03ba33c..0000000
--- a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/StackTrace.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- *
- */
-@Retention( RetentionPolicy.RUNTIME )
-@Target( ElementType.PARAMETER )
-public @interface StackTrace {
-  MessageLevel level() default MessageLevel.DEBUG;
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/jdk/JdkMessageLogger.java
----------------------------------------------------------------------
diff --git a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/jdk/JdkMessageLogger.java b/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/jdk/JdkMessageLogger.java
deleted file mode 100644
index 42f07a5..0000000
--- a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/jdk/JdkMessageLogger.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages.loggers.jdk;
-
-import org.apache.hadoop.gateway.i18n.messages.MessageLevel;
-import org.apache.hadoop.gateway.i18n.messages.MessageLogger;
-
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-import java.util.logging.Logger;
-
-/**
- *
- */
-final class JdkMessageLogger implements MessageLogger {
-
-  private final Logger logger;
-
-  JdkMessageLogger( final Logger logger ) {
-    this.logger = logger;
-  }
-
-  @Override
-  public final boolean isLoggable( final MessageLevel level ) {
-    return logger.isLoggable( toLevel( level ) );
-  }
-
-  //TODO: Handle message ID.
-  @Override
-  public final void log( final StackTraceElement caller, final MessageLevel level, final String id, final String message, final Throwable thrown ) {
-    LogRecord record = new LogRecord( toLevel( level ), message );
-    record.setSourceClassName( caller.getClassName() );
-    record.setSourceMethodName( caller.getMethodName() );
-    if( thrown != null ) {
-      record.setThrown( thrown );
-    }
-    logger.log( record );
-  }
-
-  private static final Level toLevel( final MessageLevel level ) {
-    switch( level ) {
-      case FATAL: return Level.SEVERE;
-      case ERROR: return Level.SEVERE;
-      case WARN: return Level.WARNING;
-      case INFO: return Level.INFO;
-      case DEBUG: return Level.FINE;
-      case TRACE: return Level.FINEST;
-      default: return Level.OFF;
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/jdk/JdkMessageLoggerFactory.java
----------------------------------------------------------------------
diff --git a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/jdk/JdkMessageLoggerFactory.java b/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/jdk/JdkMessageLoggerFactory.java
deleted file mode 100644
index 0d540fb..0000000
--- a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/jdk/JdkMessageLoggerFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages.loggers.jdk;
-
-import org.apache.hadoop.gateway.i18n.messages.MessageLogger;
-import org.apache.hadoop.gateway.i18n.messages.MessageLoggerFactory;
-
-import java.util.logging.Logger;
-
-/**
- *
- */
-public class JdkMessageLoggerFactory implements MessageLoggerFactory {
-
-  @Override
-  public MessageLogger getLogger( String name ) {
-    return new JdkMessageLogger( Logger.getLogger( name ) );
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/sout/SoutMessageLogger.java
----------------------------------------------------------------------
diff --git a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/sout/SoutMessageLogger.java b/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/sout/SoutMessageLogger.java
deleted file mode 100644
index 283e494..0000000
--- a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/sout/SoutMessageLogger.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages.loggers.sout;
-
-import org.apache.hadoop.gateway.i18n.messages.MessageLevel;
-import org.apache.hadoop.gateway.i18n.messages.MessageLogger;
-
-import java.text.MessageFormat;
-
-/**
- *
- */
-public class SoutMessageLogger implements MessageLogger {
-
-  private static final String FORMAT_WITHOUT_ID = "{0}: {2}";
-  private static final String FORMAT_WITH_ID = "{0}: {2} [{1}]";
-
-  private final String name;
-
-  SoutMessageLogger( String name ) {
-    this.name = name;
-  }
-
-  @Override
-  public boolean isLoggable( MessageLevel level ) {
-    return true;
-  }
-
-  private static final String getFormat( final String id ) {
-    return( id == null ) ? FORMAT_WITHOUT_ID : FORMAT_WITH_ID;
-  }
-
-  @Override
-  public void log( final StackTraceElement caller, final MessageLevel level, final String id, final String message, final Throwable thrown ) {
-    System.out.println( MessageFormat.format( getFormat( id ), level, id, message ) ); // I18N not required.
-    if( thrown != null ) {
-      thrown.printStackTrace();
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/sout/SoutMessageLoggerFactory.java
----------------------------------------------------------------------
diff --git a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/sout/SoutMessageLoggerFactory.java b/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/sout/SoutMessageLoggerFactory.java
deleted file mode 100644
index 07c9e6c..0000000
--- a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/sout/SoutMessageLoggerFactory.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages.loggers.sout;
-
-import org.apache.hadoop.gateway.i18n.messages.MessageLogger;
-import org.apache.hadoop.gateway.i18n.messages.MessageLoggerFactory;
-import org.apache.hadoop.gateway.i18n.messages.loggers.test.TestMessageLogger;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- *
- */
-public class SoutMessageLoggerFactory implements MessageLoggerFactory {
-
-  private static SoutMessageLoggerFactory INSTANCE;
-  private static final Map<String,MessageLogger> LOGGERS = new ConcurrentHashMap<String,MessageLogger>();
-
-  public static SoutMessageLoggerFactory getFactory() {
-    if( INSTANCE == null ) {
-      INSTANCE = new SoutMessageLoggerFactory();
-    }
-    return INSTANCE;
-  }
-
-  public SoutMessageLoggerFactory() {
-    INSTANCE = this;
-  }
-
-  @Override
-  public MessageLogger getLogger( String name ) {
-    MessageLogger logger = LOGGERS.get( name );
-    if( logger == null ) {
-      logger = new SoutMessageLogger( name );
-      LOGGERS.put( name, logger );
-    }
-    return logger;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/test/TestMessageLogger.java
----------------------------------------------------------------------
diff --git a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/test/TestMessageLogger.java b/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/test/TestMessageLogger.java
deleted file mode 100644
index 4dc3409..0000000
--- a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/test/TestMessageLogger.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages.loggers.test;
-
-import org.apache.hadoop.gateway.i18n.messages.MessageLevel;
-import org.apache.hadoop.gateway.i18n.messages.MessageLogger;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- *
- */
-public class TestMessageLogger implements MessageLogger {
-
-  public final List<TestMessageRecord> records = Collections.synchronizedList( new ArrayList<TestMessageRecord>() );
-
-  public final String name;
-
-  TestMessageLogger( final String name ) {
-    this.name = name;
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  @Override
-  public boolean isLoggable( MessageLevel level ) {
-    return true;
-  }
-
-  @Override
-  public void log( final StackTraceElement caller, final MessageLevel level, final String id, final String text, final Throwable thrown ) {
-    TestMessageRecord record = new TestMessageRecord( this, caller, level, id, text, thrown );
-    records.add( record );
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/af9b0c3d/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/test/TestMessageLoggerFactory.java
----------------------------------------------------------------------
diff --git a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/test/TestMessageLoggerFactory.java b/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/test/TestMessageLoggerFactory.java
deleted file mode 100644
index 9b8b5e0..0000000
--- a/gateway-i18n/src/main/java/org/apache/hadoop/gateway/i18n/messages/loggers/test/TestMessageLoggerFactory.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * 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.hadoop.gateway.i18n.messages.loggers.test;
-
-import org.apache.hadoop.gateway.i18n.messages.MessageLogger;
-import org.apache.hadoop.gateway.i18n.messages.MessageLoggerFactory;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- *
- */
-public class TestMessageLoggerFactory implements MessageLoggerFactory {
-
-  private static TestMessageLoggerFactory INSTANCE;
-  private static final Map<String,MessageLogger> LOGGERS = new ConcurrentHashMap<String,MessageLogger>();
-
-  public static TestMessageLoggerFactory getFactory() {
-    if( INSTANCE == null ) {
-      INSTANCE = new TestMessageLoggerFactory();
-    }
-    return INSTANCE;
-  }
-
-  public TestMessageLoggerFactory() {
-    INSTANCE = this;
-  }
-
-  @Override
-  public MessageLogger getLogger( String name ) {
-    MessageLogger logger = LOGGERS.get( name );
-    if( logger == null ) {
-      logger = new TestMessageLogger( name );
-      LOGGERS.put( name, logger );
-    }
-    return logger;
-  }
-
-}


Mime
View raw message