-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # .gitignore # comrueda-back-aspect/src/main/java/comrueda/back/aspect/Log.java # comrueda-back-aspect/src/main/java/comrueda/back/aspect/LoggerAspect.aj # comrueda-back-aspectos/src/main/java/comrueda/aspect/Log.java # comrueda-back-aspectos/src/main/java/comrueda/aspect/LoggerAspect.aj # comrueda-back/pom.xml # comrueda-back/src/main/java/comrueda/aspect/Log.java # comrueda-back/src/main/java/comrueda/aspect/LoggerAspect.aj # comrueda-back/target/maven-archiver/pom.properties # comrueda-front/src/main/java/comrueda/eventos/salidas/resources/SalidaResource.java
- Loading branch information
Showing
29 changed files
with
936 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.comrueda</groupId> | ||
<artifactId>comrueda</artifactId> | ||
<version>1.0</version> | ||
</parent> | ||
|
||
<artifactId>comrueda-back-aspect</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>com.comrueda</groupId> | ||
<artifactId>comrueda-back</artifactId> | ||
<version>1.0</version> | ||
</dependency> | ||
|
||
<!-- AspectJ --> | ||
<dependency> | ||
<groupId>org.aspectj</groupId> | ||
<artifactId>aspectjrt</artifactId> | ||
<version>1.8.13</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.6.1</version> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
<!-- IMPORTANT --> | ||
<useIncrementalCompilation>false</useIncrementalCompilation> | ||
<warn>constructorName,packageDefaultMethod,deprecation,maskedCatchBlocks,unusedLocals,unusedArguments,unusedImport</warn> | ||
</configuration> | ||
</plugin> | ||
|
||
<!-- AspectJ: weave aspects --> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>aspectj-maven-plugin</artifactId> | ||
<version>1.11</version> | ||
<configuration> | ||
<complianceLevel>1.8</complianceLevel> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
<showWeaveInfo>true</showWeaveInfo> | ||
<verbose>true</verbose> | ||
<Xlint>ignore</Xlint> | ||
<encoding>UTF-8 </encoding> | ||
<weaveDependencies> | ||
<weaveDependency> | ||
<groupId>com.comrueda</groupId> | ||
<artifactId>comrueda-back</artifactId> | ||
</weaveDependency> | ||
</weaveDependencies> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<!-- Compile and weave aspects after all classes compiled by javac --> | ||
<phase>process-sources</phase> | ||
<goals> | ||
<goal>compile</goal> | ||
<goal>test-compile</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>1.5.0</version> | ||
</plugin> | ||
|
||
</plugins> | ||
</build> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 6 additions & 11 deletions
17
...main/java/comrueda/aspect/LoggerAspect.aj → ...java/comrueda/back/aspect/LoggerAspect.aj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,23 @@ | ||
package comrueda.aspect; | ||
import java.io.IOException; | ||
import util.*; | ||
|
||
|
||
import comrueda.usuarios.miembros.*; | ||
package comrueda.back.aspect; | ||
|
||
public aspect LoggerAspect { | ||
|
||
|
||
// todos los métodos en los paquetes comrueda.*.ejb.* | ||
pointcut logger(): | ||
call(public * MiembroLogic.*(. .)); | ||
execution(* comrueda..ejb..*(..)) ; | ||
|
||
before():logger(){ | ||
System.out.println("Inicio de ejecucion del metodo: " + thisJoinPoint); | ||
Log.DebugLog("Inicio de ejecucion del metodo: " + thisJoinPoint); | ||
// Log.DebugLog("Inicio de ejecucion del metodo: " + thisJoinPoint); | ||
} | ||
|
||
after() returning(Object r):logger(){ | ||
System.out.println("Metodo " + r + " Retorno correctamente"); | ||
Log.DebugLog("Metodo " + r + " Retorno correctamente"); | ||
// Log.DebugLog("Metodo " + r + " Retorno correctamente"); | ||
} | ||
|
||
after() throwing(Throwable e):logger(){ | ||
System.out.println("Excepcion en el metodo: " + e); | ||
Log.DebugLog("Excepcion en el metodo: " + e); | ||
// Log.DebugLog("Excepcion en el metodo: " + e); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="http://java.sun.com/xml/ns/javaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd"> | ||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
comrueda-back/src/main/java/comrueda/eventos/encuentros/ejb/EncuentroLogic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package comrueda.eventos.encuentros.ejb; | ||
|
||
import comrueda.eventos.encuentros.ejb.*; | ||
import comrueda.eventos.encuentros.entities.EncuentroEntity; | ||
import comrueda.eventos.encuentros.persistance.EncuentroPersistance; | ||
|
||
import javax.ejb.Stateless; | ||
import javax.inject.Inject; | ||
import java.util.List; | ||
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
|
||
@Stateless | ||
public class EncuentroLogic { | ||
|
||
private static final Logger LOGGER = Logger.getLogger(EncuentroLogic.class.getName()); | ||
|
||
@Inject | ||
private EncuentroPersistance persistence; | ||
|
||
public EncuentroEntity crearEncuentro(EncuentroEntity entity) { | ||
LOGGER.info("Inicia proceso de creación de salida"); | ||
persistence.crear(entity); | ||
LOGGER.info("Termina proceso de creación de salida"); | ||
return entity; | ||
} | ||
|
||
public List<EncuentroEntity> listarEncuentros() { | ||
LOGGER.info("Inicia proceso de consultar todos los encuentros"); | ||
List<EncuentroEntity> encuentros = persistence.listarEncuentros(); | ||
LOGGER.info("Termina proceso de consultar todos los encuentros"); | ||
return encuentros; | ||
} | ||
|
||
public EncuentroEntity buscar(Long id) { | ||
return persistence.buscar(id); | ||
} | ||
|
||
public EncuentroEntity actualizar(EncuentroEntity entity) { | ||
return persistence.actualizar(entity); | ||
} | ||
|
||
public void borrar(EncuentroEntity entity) { | ||
LOGGER.log(Level.INFO, "Inicia proceso de borrar salida con id={0}", entity.getId()); | ||
persistence.borrar(entity); | ||
LOGGER.log(Level.INFO, "Termina proceso de borrar salida con id={0}", entity.getId()); | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
comrueda-back/src/main/java/comrueda/eventos/encuentros/entities/EncuentroEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package comrueda.eventos.encuentros.entities; | ||
|
||
|
||
import comrueda.eventos.entities.EventoEntity; | ||
import comrueda.common.podam.DateStrategy; | ||
import uk.co.jemos.podam.common.PodamStrategyValue; | ||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.Temporal; | ||
import javax.persistence.TemporalType; | ||
import java.io.Serializable; | ||
import java.util.Date; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
|
||
@Entity | ||
@XmlRootElement | ||
public class EncuentroEntity extends EventoEntity implements Serializable { | ||
private static final long serialVersionUID = 5141657634228477191L; | ||
|
||
private String direccion; | ||
|
||
|
||
public String getDireccion() { | ||
return direccion; | ||
} | ||
|
||
public void setDireccion(String direccion) { | ||
this.direccion = direccion; | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...ueda-back/src/main/java/comrueda/eventos/encuentros/persistance/EncuentroPersistance.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package comrueda.eventos.encuentros.persistance; | ||
|
||
|
||
|
||
import comrueda.eventos.encuentros.entities.EncuentroEntity; | ||
import comrueda.usuarios.miembros.persistance.MiembroPersistance; | ||
|
||
import javax.ejb.Stateless; | ||
import javax.persistence.EntityManager; | ||
import javax.persistence.PersistenceContext; | ||
import javax.persistence.TypedQuery; | ||
import java.util.List; | ||
import java.util.logging.Logger; | ||
|
||
@Stateless | ||
public class EncuentroPersistance { | ||
private static final Logger LOGGER = Logger.getLogger(MiembroPersistance.class.getName()); | ||
|
||
@PersistenceContext(unitName = "ComruedaPU") | ||
protected EntityManager em; | ||
|
||
public EncuentroEntity crear(EncuentroEntity entity) { | ||
LOGGER.info("Creando una encuentro nuevo"); | ||
em.persist(entity); | ||
LOGGER.info("Nuevo encuentro creado"); | ||
return entity; | ||
} | ||
|
||
public List<EncuentroEntity> listarEncuentros(){ | ||
LOGGER.info("Consultando todos los encuentros"); | ||
TypedQuery<EncuentroEntity> query = em.createQuery("select u from EncuentroEntity u", EncuentroEntity.class); | ||
return query.getResultList(); | ||
} | ||
|
||
public EncuentroEntity buscar(Long id) { | ||
return em.find(EncuentroEntity.class, id); | ||
} | ||
|
||
public EncuentroEntity actualizar(EncuentroEntity entity) { | ||
return em.merge(entity); | ||
} | ||
|
||
public void borrar(EncuentroEntity entity) { | ||
em.remove(entity); | ||
} | ||
} |
Oops, something went wrong.