Skip to content

Commit

Permalink
Task-49792 : Remove cyclic dependency with kernel (#17)
Browse files Browse the repository at this point in the history
Before this fix, there was a dependency on kernel module to use ExoLogger
This fix remove the dependency and use classic slf4j api LoggerFactory.getLogger, with create a logback logger
  • Loading branch information
rdenarie authored Jan 19, 2022
1 parent 2da78fd commit b533217
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 22 deletions.
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<artifactId>wci-wci</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.commons</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.exoplatform.gatein.wci</groupId>
<artifactId>wci-tomcat</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
import org.apache.catalina.ContainerServlet;
import org.apache.catalina.Engine;
import org.apache.catalina.Wrapper;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;

import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

Expand All @@ -38,7 +37,7 @@
*/
public class TomcatContainerServlet extends HttpServlet implements ContainerServlet
{
private static final Log log = ExoLogger.getLogger(TomcatContainerServlet.class);
private static final Logger log = LoggerFactory.getLogger(TomcatContainerServlet.class);

/** Servlet context init parameter name that can be used to turn off cross-context logout */
private static final String CROSS_CONTEXT_LOGOUT_KEY = "org.gatein.wci.cross_context_logout";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
import org.apache.catalina.LifecycleListener;
import org.apache.catalina.LifecycleState;
import org.apache.catalina.core.StandardContext;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.gatein.wci.RequestDispatchCallback;
import org.gatein.wci.ServletContainer;
import org.gatein.wci.ServletContainerFactory;
Expand Down Expand Up @@ -65,7 +65,8 @@
*/
public class TomcatServletContainerContext implements ServletContainerContext, ContainerListener, LifecycleListener
{
private final static Log log = ExoLogger.getLogger(TomcatServletContainerContext.class);
private final static Logger log =
LoggerFactory.getLogger(TomcatServletContainerContext.class);

private static TomcatServletContainerContext instance;

Expand Down
8 changes: 6 additions & 2 deletions wci/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.commons</artifactId>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
</dependencies>

Expand Down
9 changes: 4 additions & 5 deletions wci/src/main/java/org/gatein/wci/ServletContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.gatein.wci.api.GateInServlet;
import org.gatein.wci.authentication.AuthenticationEvent;
import org.gatein.wci.authentication.AuthenticationEventType;
Expand All @@ -48,6 +46,8 @@
import org.gatein.wci.security.Credentials;
import org.gatein.wci.spi.ServletContainerContext;
import org.gatein.wci.spi.WebAppContext;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;

/**
* A static registry for the servlet container context.
Expand All @@ -58,10 +58,9 @@
public final class ServletContainer
{

private final static Log log = ExoLogger.getLogger(ServletContainer.class);

private static final Logger log = LoggerFactory.getLogger(ServletContainer.class);
/** . */
private final Object lock = new Object();
private final Object lock = new Object();

/** The event webapp listeners. */
private final Vector<WebAppListener> webAppListeners = new Vector<WebAppListener>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/
package org.gatein.wci.spi;

import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.gatein.wci.command.CommandServlet;

import javax.naming.InitialContext;
Expand All @@ -31,7 +31,7 @@
* @author <a href="http://community.jboss.org/people/kenfinni">Ken Finnigan</a>
*/
public abstract class CatalinaWebAppContext implements WebAppContext {
protected final static Log log = ExoLogger.getLogger(CatalinaWebAppContext.class);
protected static final Logger log = LoggerFactory.getLogger(CatalinaWebAppContext.class);

protected static final String GATEIN_SERVLET_NAME = "TomcatGateInServlet";
protected static final String GATEIN_SERVLET_PATH = "/tomcatgateinservlet";
Expand Down

0 comments on commit b533217

Please sign in to comment.