Ignore:
Timestamp:
Mar 29, 2011, 8:21:25 PM (13 years ago)
Author:
mlg
Message:

Complete rewriting of the api
The api now uses interfaces everywhere (for the dao, services and session manager). This allows the developer to use his own implementations if he wants.
Deletion of the singletons. There are now getters and setters. It allows to make dependency injection.
Use of sl4j in the api, instead of using log4j.

Location:
extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/impl
Files:
1 added
1 copied

Legend:

Unmodified
Added
Removed
  • extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/impl/CommentDaoImpl.java

    r9902 r9919  
    1 package fr.mael.jiwigo.dao;
     1package fr.mael.jiwigo.dao.impl;
    22
    33import java.io.IOException;
     
    55import java.util.List;
    66
     7import org.slf4j.Logger;
     8import org.slf4j.LoggerFactory;
    79import org.w3c.dom.Document;
    810import org.w3c.dom.Element;
     
    1012import org.w3c.dom.NodeList;
    1113
     14import fr.mael.jiwigo.dao.CommentDao;
    1215import fr.mael.jiwigo.om.Comment;
    1316import fr.mael.jiwigo.transverse.enumeration.MethodsEnum;
     
    3437 *
    3538 */
    36 public class CommentDao {
     39public class CommentDaoImpl implements CommentDao {
    3740    /**
    3841     * Logger
    3942     */
    40     public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
    41             .getLog(CommentDao.class);
    42     /**
    43      *  Instance that allows to use a singleton
    44      */
    45     private static CommentDao instance;
     43    private final Logger LOG = LoggerFactory.getLogger(CommentDaoImpl.class);
    4644
    4745    private SessionManager sessionManager;
    48 
    49     /**
    50      * private constructor, to use a singleton
    51      */
    52     private CommentDao(SessionManager sessionManager) {
    53         this.sessionManager = sessionManager;
    54     }
    55 
    56     /**
    57      * @return the singleton
    58      */
    59     public static CommentDao getInstance(SessionManager sessionManager) {
    60         if (instance == null) {
    61             instance = new CommentDao(sessionManager);
    62         }
    63         return instance;
    64     }
    6546
    6647    /**
     
    133114
    134115    }
     116
     117    public SessionManager getSessionManager() {
     118        return sessionManager;
     119    }
     120
     121    public void setSessionManager(SessionManager sessionManager) {
     122        this.sessionManager = sessionManager;
     123    }
     124
    135125}
Note: See TracChangeset for help on using the changeset viewer.