Author: echatellier Date: 2010-03-19 18:17:04 +0100 (Fri, 19 Mar 2010) New Revision: 2807 Log: Instanciation des services avec openejb (embedded mode) Added: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java trunk/lima-business/src/main/java/org/chorem/lima/business/data/Status.java trunk/lima-business/src/main/resources/META-INF/ trunk/lima-business/src/main/resources/META-INF/ejb-jar.xml Modified: trunk/lima-business/pom.xml trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceImpl.java trunk/lima-business/src/main/resources/log4j.properties trunk/pom.xml Modified: trunk/lima-business/pom.xml =================================================================== --- trunk/lima-business/pom.xml 2010-03-16 16:51:18 UTC (rev 2806) +++ trunk/lima-business/pom.xml 2010-03-19 17:17:04 UTC (rev 2807) @@ -36,6 +36,10 @@ <groupId>javax.time</groupId> <artifactId>jsr-310-ri</artifactId> </dependency> + <dependency> + <groupId>org.apache.openejb</groupId> + <artifactId>openejb-core</artifactId> + </dependency> </dependencies> <!-- ************************************************************* --> Added: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java 2010-03-19 17:17:04 UTC (rev 2807) @@ -0,0 +1,35 @@ +/* *##% + * Copyright (C) 2010 Code Lutin, Chatellier Eric + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +package org.chorem.lima.business; + +import org.chorem.lima.entity.Account; + +/** + * TODO add comment here. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public interface AccountService { + + public void createAccount(Account account) throws LimaException; +} Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceImpl.java 2010-03-16 16:51:18 UTC (rev 2806) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountServiceImpl.java 2010-03-19 17:17:04 UTC (rev 2807) @@ -20,9 +20,12 @@ package org.chorem.lima.business; import static org.nuiton.i18n.I18n._; + import java.util.ArrayList; import java.util.List; +import javax.ejb.Stateless; + import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; @@ -45,7 +48,8 @@ * * @author Rémi Chapelet */ -public class AccountServiceImpl { +@Stateless +public class AccountServiceImpl implements AccountService { private static final Log log = LogFactory.getLog(AccountServiceImpl.class); Added: trunk/lima-business/src/main/java/org/chorem/lima/business/data/Status.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/data/Status.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/data/Status.java 2010-03-19 17:17:04 UTC (rev 2807) @@ -0,0 +1,96 @@ +/* *##% + Copyright (C) 2009-2010 Lima Callao + *##%*/ +package org.chorem.lima.business.data; + +import org.apache.commons.lang.builder.ToStringBuilder; +import java.beans.PropertyChangeListener; +import java.util.List; +import java.util.Collection; + +/** + * DTO implantation for Status entity. + */ +public class Status implements java.io.Serializable { + + private java.lang.String idName; + private java.lang.String idType; + private java.lang.String description; + + protected java.beans.PropertyChangeSupport p; + + /** + * Default constructor of StatusDTO. + */ + public Status() { + p = new java.beans.PropertyChangeSupport(this); + } + + /** + * Constructor of StatusDTO with all parameters. + */ + public Status(java.lang.String idName, java.lang.String idType, java.lang.String description ) { + this(); + this.idName = idName; + this.idType = idType; + this.description = description; + } + + public void addPropertyChangeListener(PropertyChangeListener listener) { + p.addPropertyChangeListener(listener); + } + + public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { + p.addPropertyChangeListener(propertyName, listener); + } + + public void removePropertyChangeListener(PropertyChangeListener listener) { + p.removePropertyChangeListener(listener); + } + + public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { + p.removePropertyChangeListener(propertyName, listener); + } + + public void setIdName(java.lang.String value) { + java.lang.String oldValue = this.idName; + this.idName = value; + p.firePropertyChange("idName", oldValue, value); + } + + public java.lang.String getIdName() { + return idName; + } + + public void setIdType(java.lang.String value) { + java.lang.String oldValue = this.idType; + this.idType = value; + p.firePropertyChange("idType", oldValue, value); + } + + public java.lang.String getIdType() { + return idType; + } + + public void setDescription(java.lang.String value) { + java.lang.String oldValue = this.description; + this.description = value; + p.firePropertyChange("description", oldValue, value); + } + + public java.lang.String getDescription() { + return description; + } + + + @Override + public String toString() { + String result = new ToStringBuilder(this). + append("idName", this.idName). + append("idType", this.idType). + append("description", this.description). + toString(); + return result; + } + +} //StatusDTO Property changes on: trunk/lima-business/src/main/java/org/chorem/lima/business/data/Status.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/lima-business/src/main/resources/META-INF/ejb-jar.xml =================================================================== --- trunk/lima-business/src/main/resources/META-INF/ejb-jar.xml (rev 0) +++ trunk/lima-business/src/main/resources/META-INF/ejb-jar.xml 2010-03-19 17:17:04 UTC (rev 2807) @@ -0,0 +1,3 @@ +<!-- Empty configuration file based on + http://openejb.apache.org/3.0/application-discovery-via-the-classpath.html --> +<ejb-jar/> Modified: trunk/lima-business/src/main/resources/log4j.properties =================================================================== --- trunk/lima-business/src/main/resources/log4j.properties 2010-03-16 16:51:18 UTC (rev 2806) +++ trunk/lima-business/src/main/resources/log4j.properties 2010-03-19 17:17:04 UTC (rev 2807) @@ -8,3 +8,4 @@ # package level log4j.logger.org.chorem.lima=DEBUG +log4j.logger.org.nuiton.util=DEBUG \ No newline at end of file Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-03-16 16:51:18 UTC (rev 2806) +++ trunk/pom.xml 2010-03-19 17:17:04 UTC (rev 2807) @@ -61,6 +61,12 @@ </dependency> <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-email</artifactId> + <version>1.2</version> + </dependency> + + <dependency> <groupId>org.nuiton</groupId> <artifactId>nuiton-utils</artifactId> <version>${nuiton-utils.version}</version> @@ -114,6 +120,15 @@ <version>${axis.version}</version> </dependency>--> + <!-- Services --> + <dependency> + <groupId>org.apache.openejb</groupId> + <artifactId>openejb-core</artifactId> + <!-- 3.2.1 has a startup warning with 1.6.0_u18 --> + <version>3.1.3-SNAPSHOT</version> + <scope>compile</scope> + </dependency> + <!-- autres libraires --> <dependency> <groupId>org.swinglabs</groupId> @@ -224,7 +239,7 @@ <projectId>lima</projectId> <!-- customized libs version --> - <nuiton-utils.version>1.2</nuiton-utils.version> + <nuiton-utils.version>1.2.1-SNAPSHOT</nuiton-utils.version> <eugene.version>2.0</eugene.version> <topia.version>2.3</topia.version> <jaxx.version>2.0</jaxx.version> @@ -321,6 +336,10 @@ <id>jboss.repo</id> <url>http://repository.jboss.org/maven2</url> </repository> + <repository> + <id>apache.snapshot</id> + <url>http://repository.apache.org/snapshots</url> + </repository> </repositories> <pluginRepositories>