Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. package aspects;
  2.  
  3. import controller.*;
  4.  
  5. public aspect ExceptionHandling {
  6.    
  7.     declare soft: SQLException: call (void *.cadastra(..)) || call (void *.atualiza(..)) || call (void *.exclui(..)) ||
  8.                                 call (void *.listaEmpresas(..) || (void *.tabelaEmpresas(..)) ||
  9.                                 call (void *.listaProdutos(..) || (void *.tabelaProdutos(..));
  10.    
  11.     void around(): call (void *.cadastra(..)) || call (void *.atualiza(..)) || call (void *.exclui(..))
  12.                    call (void *.listaEmpresas(..) || (void *.tabelaEmpresas(..)) ||
  13.                    call (void *.listaProdutos(..) || (void *.tabelaProdutos(..)) {
  14.         try {
  15.             proceed();
  16.         } catch(SQLException e) {
  17.             JOptionPane.showMessageDialog(null, e.getMessage(), "ERRO", JOptionPane.ERROR_MESSAGE);
  18.         }
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement