private ServiceException createServiceException(String message) { ServiceException ex = new ServiceException(); ex.setMessage(message); return ex; }
public Object lookup() { ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(flex.messaging.FlexContext.getServletConfig().getServletContext()); String beanName = getSource(); try { return appContext.getBean(beanName); } catch (NoSuchBeanDefinitionException nexc) { ServiceException e = new ServiceException(); String msg = "Spring service named '" + beanName + "' does not exist."; e.setMessage(msg); e.setRootCause(nexc); e.setDetails(msg); e.setCode("Server.Processing"); throw e; } catch (BeansException bexc) { ServiceException e = new ServiceException(); String msg = "Unable to create Spring service named '" + beanName + "' "; e.setMessage(msg); e.setRootCause(bexc); e.setDetails(msg); e.setCode("Server.Processing"); throw e; } }
/** * Override to lower the preferred log level to debug if the exception is a 'not subscribed' fault. */ public short getPreferredLogLevel() { String code = getCode(); // Log not-subscribed errors at a lower level because this is a common occurance // following normal failover. if (code != null && code.equals(MessageService.NOT_SUBSCRIBED_CODE)) return LogEvent.DEBUG; else return super.getPreferredLogLevel(); } }
/** * * Tests a selector in an attempt to avoid runtime errors that we could catch at startup. * * @param selectorExpression The expression to test. * @param msg A test message. */ private void testSelector(String selectorExpression, Message msg) { try { JMSSelector selector = new JMSSelector(selectorExpression); selector.match(msg); } catch (Exception e) { ServiceException se = new ServiceException(); se.setMessage(BAD_SELECTOR, new Object[] {selectorExpression}); se.setRootCause(e); throw se; } }
!configuredClass.isAssignableFrom(instClass)) ServiceException e = new ServiceException(); e.setMessage(INVALID_CLASS_FOUND, new Object[] { factoryInstance.getAttributeId(), "session", factoryInstance.getId(), factoryInstance.getInstanceClass(), instance.getClass()}); e.setCode("Server.Processing"); throw e; ServiceException e = new ServiceException(); e.setMessage(SESSION_NOT_FOUND, new Object[] {factoryInstance.getId()}); e.setCode("Server.Processing"); throw e;
!configuredClass.isAssignableFrom(instClass)) ServiceException e = new ServiceException(); e.setMessage(INVALID_CLASS_FOUND, new Object[] { factoryInstance.getAttributeId(), "session", factoryInstance.getId(), factoryInstance.getInstanceClass(), instance.getClass()}); e.setCode("Server.Processing"); throw e; ServiceException e = new ServiceException(); e.setMessage(SESSION_NOT_FOUND, new Object[] {factoryInstance.getId()}); e.setCode("Server.Processing"); throw e;
/** * @exclude * Tests a selector in an attempt to avoid runtime errors that we could catch at startup. * * @param selectorExpression The expression to test. * @param msg A test message. */ private void testSelector(String selectorExpression, Message msg) { try { JMSSelector selector = new JMSSelector(selectorExpression); selector.match(msg); } catch (Exception e) { ServiceException se = new ServiceException(); se.setMessage(BAD_SELECTOR, new Object[] {selectorExpression}); se.setRootCause(e); throw se; } }
private ServiceException createServiceException(String message) { ServiceException ex = new ServiceException(); ex.setMessage(message); return ex; }
!configuredClass.isAssignableFrom(instClass)) ServiceException e = new ServiceException(); e.setMessage(INVALID_CLASS_FOUND, new Object[] { factoryInstance.getAttributeId(), "session", factoryInstance.getId(), factoryInstance.getInstanceClass(), instance.getClass()}); e.setCode("Server.Processing"); throw e; ServiceException e = new ServiceException(); e.setMessage(SESSION_NOT_FOUND, new Object[] {factoryInstance.getId()}); e.setCode("Server.Processing"); throw e;
public Object lookup() { ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(flex.messaging.FlexContext.getServletConfig().getServletContext()); String beanName = getSource(); try { return appContext.getBean(beanName); } catch (NoSuchBeanDefinitionException nexc) { ServiceException e = new ServiceException(); String msg = "Spring service named '" + beanName + "' does not exist."; e.setMessage(msg); e.setRootCause(nexc); e.setDetails(msg); e.setCode("Server.Processing"); throw e; } catch (BeansException bexc) { ServiceException e = new ServiceException(); String msg = "Unable to create Spring service named '" + beanName + "' "; e.setMessage(msg); e.setRootCause(bexc); e.setDetails(msg); e.setCode("Server.Processing"); throw e; } }
/** * * Tests a selector in an attempt to avoid runtime errors that we could catch at startup. * * @param selectorExpression The expression to test. * @param msg A test message. */ private void testSelector(String selectorExpression, Message msg) { try { JMSSelector selector = new JMSSelector(selectorExpression); selector.match(msg); } catch (Exception e) { ServiceException se = new ServiceException(); se.setMessage(BAD_SELECTOR, new Object[] {selectorExpression}); se.setRootCause(e); throw se; } }
/** * Override to lower the preferred log level to debug if the exception is a 'not subscribed' fault. */ public short getPreferredLogLevel() { String code = getCode(); // Log not-subscribed errors at a lower level because this is a common occurance // following normal failover. if (code != null && code.equals(MessageService.NOT_SUBSCRIBED_CODE)) return LogEvent.DEBUG; else return super.getPreferredLogLevel(); } }
private Object[] getObjectArrayFromHeader(Object header) { if (header instanceof Object[]) return (Object []) header; else if (header instanceof List) return ((List) header).toArray(); else if (header == null) return null; ServiceException se = new ServiceException(); se.setMessage("Invalid header: " + header + " in message. expected array or list and found: " + header.getClass().getName()); throw se; }
ServiceException se = new ServiceException(); se.setCode(NOT_SUBSCRIBED_CODE); se.setMessage(NOT_SUBSCRIBED, new Object[] {destination.getId()}); throw se; ServiceException se = new ServiceException(); se.setMessage(UNKNOWN_COMMAND, new Object[] {new Integer(command.getOperation())}); throw se;
public Object lookup() { ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(flex.messaging.FlexContext.getServletConfig().getServletContext()); String beanName = getSource(); try { return appContext.getBean(beanName); } catch (NoSuchBeanDefinitionException nexc) { ServiceException e = new ServiceException(); String msg = "Spring service named '" + beanName + "' does not exist."; e.setMessage(msg); e.setRootCause(nexc); e.setDetails(msg); e.setCode("Server.Processing"); throw e; } catch (BeansException bexc) { ServiceException e = new ServiceException(); String msg = "Unable to create Spring service named '" + beanName + "' "; e.setMessage(msg); e.setRootCause(bexc); e.setDetails(msg); e.setCode("Server.Processing"); throw e; } }
/** * Override to lower the preferred log level to debug if the exception is a 'not subscribed' fault. */ public short getPreferredLogLevel() { String code = getCode(); // Log not-subscribed errors at a lower level because this is a common occurance // following normal failover. if (code != null && code.equals(MessageService.NOT_SUBSCRIBED_CODE)) return LogEvent.DEBUG; else return super.getPreferredLogLevel(); } }
private Object[] getObjectArrayFromHeader(Object header) { if (header instanceof Object[]) return (Object []) header; else if (header instanceof List) return ((List) header).toArray(); else if (header == null) return null; ServiceException se = new ServiceException(); se.setMessage("Invalid header: " + header + " in message. expected array or list and found: " + header.getClass().getName()); throw se; }
ServiceException se = new ServiceException(); se.setCode(NOT_SUBSCRIBED_CODE); se.setMessage(NOT_SUBSCRIBED, new Object[] {destination.getId()}); throw se; ServiceException se = new ServiceException(); se.setMessage(UNKNOWN_COMMAND, new Object[] {new Integer(command.getOperation())}); throw se;
private Object[] getObjectArrayFromHeader(Object header) { if (header instanceof Object[]) return (Object []) header; else if (header instanceof List) return ((List) header).toArray(); else if (header == null) return null; ServiceException se = new ServiceException(); se.setMessage("Invalid header: " + header + " in message. expected array or list and found: " + header.getClass().getName()); throw se; }
!configuredClass.isAssignableFrom(instClass)) ServiceException e = new ServiceException(); e.setMessage(INVALID_CLASS_FOUND, new Object[] { instance.getAttributeId(), "application", instance.getId(), instance.getInstanceClass(), inst.getClass()}); e.setCode("Server.Processing"); throw e;