/** * Returns the singleton instance of the system wide ErrorHandler * * @return */ public static ErrorHandler getInstance() { if(singleton == null) { synchronized(ErrorHandler.class) { if(singleton == null) { singleton = new ErrorHandler(); } } } return singleton; }
private void stop() { try { Bus.activeBuses.remove(uri); } catch(Exception e) { ErrorHandler.getInstance().handle(e); } }
@Override public String getMessage() String message = super.getMessage();
ErrorHandler.getInstance().handle(e); throw new SystemException(e.getMessage(), e);
public static String generateOneWayHash(String input, String knownSalt) { try { String onewayHash = null; MessageDigest digest = MessageDigest.getInstance("SHA-512"); String randomSalt = Utilities.generateUID(); byte[] hashBytes = digest.digest((knownSalt+randomSalt).getBytes()); onewayHash = Utilities.encodeBinaryData(hashBytes); return onewayHash; } catch(Exception e) { throw new SystemException(e.getMessage(), e); } } }
ErrorHandler.getInstance().handle(hqe); throw new SystemException(hqe.getMessage(),hqe); catch(HornetQException hqe) ErrorHandler.getInstance().handle(hqe); throw new SystemException(hqe.getMessage(),hqe); catch(HornetQException hqe) ErrorHandler.getInstance().handle(hqe); throw new SystemException(hqe.getMessage(),hqe);
public void broadcastChannelEvent(ChannelEvent channelEvent) { if(this.channelListeners != null) { for(ChannelEventListener listener: this.channelListeners) { try { listener.channelUpdated(channelEvent); } catch(Exception e) { //so that if an error occurs on one listener, others don't suffer //listeners must be isolated of each other try{ErrorHandler.getInstance().handle(e);}catch(Exception ex){} } } } }
throw new SystemException(e.getMessage(), e);
ErrorHandler.getInstance().handle(e); throw new SystemException(e.getMessage(), e);
public void broadcastNetworkEvent(NetworkEvent networkEvent) { if(this.networkEventListeners != null) { for(NetworkEventListener listener: this.networkEventListeners) { try { listener.serverPush(networkEvent); } catch(Exception e) { //so that if an error occurs on one listener, others don't suffer //listeners must be isolated of each other try{ErrorHandler.getInstance().handle(e);}catch(Exception ex){} } } } } }
throw new SystemException(e.getMessage(), e);
ErrorHandler.getInstance().handle(e); throw new SystemException(e.getMessage(), e);
private void sendBusListenerEvent(Bus bus,BusMessage busMessage) { List<BusListener> busListeners = bus.getBusListeners(); if(busListeners == null) { return; } for(BusListener busListener: busListeners) { try { busListener.messageIncoming(busMessage); } catch(Exception e) { //so that if an error occurs on one listener, others don't suffer //listeners must be isolated of each other try{ErrorHandler.getInstance().handle(e);}catch(Exception ex){} } } } }
public static void delete(MobletApp mobletApp) throws SystemException { Session session = null; Transaction tx = null; try { session = getHibernateManager().getSessionFactory().getCurrentSession(); tx = session.beginTransaction(); String query = "delete from MobletApp where uri=?"; session.createQuery(query).setString(0, mobletApp.getUri()).executeUpdate(); tx.commit(); } catch(Exception e) { log.error(MobletApp.class, e); if(tx != null) { tx.rollback(); } throw new SystemException(e.getMessage(), e); } }
ErrorHandler.getInstance().handle(hqe); throw new SystemException(hqe.getMessage(),hqe); catch(HornetQException hqe) ErrorHandler.getInstance().handle(hqe); throw new SystemException(hqe.getMessage(),hqe);
ErrorHandler.getInstance().handle(pe); session.setAttribute("tx-rollback", Boolean.TRUE); ErrorHandler.getInstance().handle(e); session.setAttribute("tx-rollback", Boolean.TRUE);
ErrorHandler.getInstance().handle(hqe); throw new SystemException(hqe.getMessage(),hqe); ErrorHandler.getInstance().handle(hqe); throw new SystemException(hqe.getMessage(),hqe); ErrorHandler.getInstance().handle(hqe); throw new SystemException(hqe.getMessage(),hqe);
ErrorHandler.getInstance().handle(e);
ErrorHandler.getInstance().handle(e); throw new SystemException(e.getMessage(), e);
ErrorHandler.getInstance().handle(e); throw new SystemException(e.getMessage(), e);