Announcement Announcement Module
No announcement yet.
why is my joinpoint not working? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • why is my joinpoint not working?

    I got a joinpoint that uses custom annotation and it goes like this:
        @AfterReturning(pointcut = "execution(@com.praxis.desvucem.annotation.LogMe(com.praxis.desvucem.annotation.LoggingType.INSERT) * *(..))", returning = "result")
    	public void logAfterReturningInsert(JoinPoint jp, Object result)
    			throws Throwable {
    		final Logger logger = getLoggerForClass(jp);
    		System.out.println("AfterInsert");, result));
    and in my database interaction where I want to log my data base operations Ive:
    public class SpringDataCContactosSMSRepository implements CContactosSMSRepository {
        private Logger log = LoggerFactory.getLogger(SpringDataCContactosSMSRepository.class);
        private final QMfCContactosSMS qContactoSMS = QMfCContactosSMS.contactoSMS;
         * template para acceso a BD.
        private QueryDslJdbcTemplate template;
        private DataSource dataSource;
        public void setDataSourceBroker(DataSource dataSource) {
            this.template = new QueryDslJdbcTemplate(dataSource);
            this.dataSource = dataSource;
        public void guardarContactoSMS(ContactoSMS contactoSMS) {
            AgregarContactoSMSProcedure sproc = new AgregarContactoSMSProcedure(dataSource);
            Long id = sproc.execute(contactoSMS.getIdContacto(), contactoSMS.getNombreContacto(),
                    contactoSMS.getApellidoPaternoContacto(), contactoSMS.getApellidoMaternoContacto(),
                    contactoSMS.getTelefono(), contactoSMS.getIdUsuario(), contactoSMS.getStatus());
        private static class AgregarContactoSMSProcedure extends StoredProcedure {
            private static final String SPROC_NAME = "AGREGAR_CONTACTO_SMS";
            private static final String ID_CONTACTO = "ID_CONTACTO";
            private static final String NOMBRE = "NOMBRE";
            private static final String APELLIDO_PATERNO = "APELLIDO_PATERNO";
            private static final String APELLIDO_MATERNO = "APELLIDO_MATERNO";
            private static final String TELEFONO = "TELEFONO";
            private static final String ID_USUARIO = "ID_USUARIO";
            private static final String ESTATUS = "ESTATUS";
            public AgregarContactoSMSProcedure(DataSource dataSource) {
                super(dataSource, SPROC_NAME);
                declareParameter(new SqlOutParameter(ID_CONTACTO, OracleTypes.NUMBER));
                declareParameter(new SqlParameter(NOMBRE, OracleTypes.VARCHAR));
                declareParameter(new SqlParameter(APELLIDO_PATERNO, OracleTypes.VARCHAR));
                declareParameter(new SqlParameter(APELLIDO_MATERNO, OracleTypes.VARCHAR));
                declareParameter(new SqlParameter(TELEFONO, OracleTypes.NUMBER));
                declareParameter(new SqlParameter(ID_USUARIO, OracleTypes.VARCHAR));
            @SuppressWarnings({ "rawtypes", "unchecked" })
            public Long execute(Integer idContacto, String nombreContacto, String apellidoPaternoContacto,
                    String apellidoMaternoContacto, Long telefonoContacto, String idUsuario, String estatusContacto) {
                Map inputs = new HashMap();
                inputs.put(ID_CONTACTO, idContacto);
                inputs.put(NOMBRE, nombreContacto);
                inputs.put(APELLIDO_PATERNO, apellidoPaternoContacto);
                inputs.put(APELLIDO_MATERNO, apellidoMaternoContacto);
                inputs.put(TELEFONO, telefonoContacto);
                inputs.put(ID_USUARIO, idUsuario);
                inputs.put(ESTATUS, estatusContacto);
                Map outputs = super.execute(inputs);
                BigDecimal idRegistrado = (BigDecimal) outputs.get(ID_CONTACTO);
                return idRegistrado.longValue();
    as you can see Ive got an internal class to handle the procedure but when I run it I dont get my code to enter into the joinpoint unless I put my annotation in the method "public void guardarContactoSMS(ContactoSMS contactoSMS)".
    Is there a way to fix it so my annotations can be registered in an internal class?
    Thanks in advance.