Package com.betfair.cougar.core.api.exception

Examples of com.betfair.cougar.core.api.exception.PanicInTheCougar


        logOperationEndpoints(serviceBindingDescriptors);
        try {
            server.start();
        } catch (Exception ex) {
            logger.log(Level.SEVERE, "Failed to startup jetty", ex);
            throw new PanicInTheCougar(ex);
        }
    }
View Full Code Here


        String jdkLogLevelString = getValueOrDefault(properties, LOG_LEVEL_PROPERTY, DEFAULT_LOG_LEVEL);

        Level logLevel = new Log4jLoggingControl().convertJdkLevelToLog4jLevel(jdkLogLevelString);

        if (logDir == null) {
            throw new PanicInTheCougar("Cannot start with " + LOG_DIR_PROPERTY + " being set - value is currently null");
        }

        Boolean echoToStdOut = Boolean.parseBoolean(getValueOrDefault(properties, ECHO_TO_STDOUT_PROPERTY, "false"));

        List<Appender> logAppenders = new ArrayList<Appender>();
View Full Code Here

            }else{
               context=new ClassPathXmlApplicationContext(configs.toArray(new String[configs.size()]), parentCtx);
            }
        } catch (Exception e) {
            CougarLoggingUtils.getLogger(CougarSpringCtxFactoryImpl.class).log(e);
            throw new PanicInTheCougar(e);
        }
        return context;
    }
View Full Code Here

            logBootstrap.init(properties);
        } catch (Exception ex) {
            System.err.println("An error occurred initialising the logger. Ensure the value of property [" +
                    LOGGING_BOOTSTRAP_CLASS_PROPERTY +
                    "] points to a class that the implements LogBootstrap interface or is set to \"none\"" + ex);
            throw new PanicInTheCougar(ex);
        }

    }
View Full Code Here

                final ApplicationContext ctx = ((ContextRefreshedEvent) event).getApplicationContext();
        // Check that the JMXControl exists before registering all exportables
        // see JMXControl javadocs for why we have to do it this way
        JMXControl jmxControl = JMXControl.getFromContext(ctx);
        if (jmxControl == null) {
          throw new PanicInTheCougar("jmxControl bean not found in ApplicationContext");
        }
        if (exportables != null) {
          for (Exportable exportable : exportables) {
            exportable.export(jmxControl);
          }
        }

        // Open the starting gate
        notifyStartingGateListeners();     
       
        Collection<ServiceAware> serviceAwareImpls = getServiceAwareImplementations(ctx);
        if (serviceAwareImpls != null && serviceAwareImpls.size() > 0) {
          Set<Service> services = new HashSet<Service>();
          Collection<Map<ServiceDefinition, Service>> serviceDefinitions = getServiceImplementationMap().values();
          for (Map<ServiceDefinition, Service>  serviceDefinition : serviceDefinitions) {
            services.addAll(serviceDefinition.values());
          }
          for (ServiceAware serviceAware : serviceAwareImpls) {
            serviceAware.setServices(services);
          }
        }       

                Status status = monitorRegistry
                        .getStatusAggregator()
                        .getStatus();
                logger.log((status != Status.OK ? Level.WARNING : Level.INFO),
                        "Cougar returned status %s at startup", status);
      } catch (Exception e) {
        throw new PanicInTheCougar("Failed to initialise server", e);
      }
            logSuccessfulCougarStartup();
    }
  }
View Full Code Here

                SchemaFactory sf = SchemaFactory.newInstance(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI);
                return sf.newSchema(new StreamSource(new StringReader(content)));
            }
        } catch (IOException e) {
            throw new PanicInTheCougar(e);
        } catch (SAXException e) {
            throw new PanicInTheCougar(e);
        } finally {
            if(tempFile!=null)tempFile.delete();
        }
        return null;
    }
View Full Code Here

                            }
                        }
                    }
                  break;
                default :
                    throw new PanicInTheCougar("Unsupported argument annotation "+ descriptor.getSource());
            }
            //request.trace("Deserialised argument %d from %s to value %s", i, param.getSource(), args[i]);
        }
        return args;
    }
View Full Code Here

            HttpServiceBindingDescriptor httpServiceBindingDescriptor = (HttpServiceBindingDescriptor) serviceBindingDescriptor;
            String uri = stripMinorVersionFromUri(httpServiceBindingDescriptor.getServiceContextPath() + httpServiceBindingDescriptor.getServiceVersion());
            if (uri == null) uri = ""; // defensive
            uri += rescriptOperationBindingDescriptor.getURI();
            if (bindings.containsKey(uri)) {
                throw new PanicInTheCougar("More than one operation is bound to the path [" + uri + "] edit your operation paths so that this is unique, existing = "+bindings.get(uri)+", new = "+bindingDescriptor);
            }
      bindings.put(uri, new RescriptOperationBinding(rescriptOperationBindingDescriptor, operationDefinition, hardFailEnumDeserialisation));
    }
  } 
View Full Code Here

  public void bind(ServiceBindingDescriptor bindingDescriptor) {
        String servicePlusMajorVersion=bindingDescriptor.getServiceName() +
                "-v" + bindingDescriptor.getServiceVersion().getMajor();

        if (serviceBindingDescriptors.containsKey(servicePlusMajorVersion)) {
                throw new PanicInTheCougar("More than one version of service [" + bindingDescriptor.getServiceName() +
                        "] is attempting to be bound for the same major version. The clashing versions are [" +
                        serviceBindingDescriptors.get(servicePlusMajorVersion).getServiceVersion() + ", " +
                        bindingDescriptor.getServiceVersion() +
                        "] - only one instance of a service is permissable for each major version");
        }
View Full Code Here

  @Override
  public HttpCommandProcessor getCommandProcessor(Protocol protocol) {
    String commandProcessorName = commandProcessorNames.get(protocol);

        if (commandProcessorName == null) {
      throw new PanicInTheCougar("No HTTP Command Processor has been configured for protocol " + protocol);
        }

        HttpCommandProcessor commandProcessor = (HttpCommandProcessor)applicationContext.getBean(commandProcessorName);

        if (commandProcessor == null) {
      throw new PanicInTheCougar("No HTTP Command Processor has been configured for the name " + commandProcessorName);
        }

    return commandProcessor;
  }
View Full Code Here

TOP

Related Classes of com.betfair.cougar.core.api.exception.PanicInTheCougar

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.