@Test(expected = PanicInTheCougar.class) public void testMultipleServiceBindSameVersion() { final ServiceVersion sv = new ServiceVersion("v3.2"); final String serviceName = "testServiceName"; ServiceBindingDescriptor sbd = new ServiceBindingDescriptor() { @Override public OperationBindingDescriptor[] getOperationBindings() { return new OperationBindingDescriptor[0]; } @Override public ServiceVersion getServiceVersion() { return sv; } @Override public String getServiceName() { return serviceName; } @Override public Protocol getServiceProtocol() { return getProtocol(); } }; commandProcessor.bind(sbd); commandProcessor.bind(sbd); }
@Override 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"); } serviceBindingDescriptors.put(servicePlusMajorVersion, bindingDescriptor); }
AbstractHttpCommandProcessor extends
		AbstractCommandProcessor<HttpCommand> implements HttpCommandProcessor,
		GateListener { @Override 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"); } serviceBindingDescriptors.put(servicePlusMajorVersion, bindingDescriptor); } }
AbstractHttpCommandProcessor extends
		AbstractCommandProcessor<HttpCommand> implements HttpCommandProcessor,
		GateListener { @Override 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"); } serviceBindingDescriptors.put(servicePlusMajorVersion, bindingDescriptor); } protected  AbstractHttpCommandProcessor(Protocol protocol, DehydratedExecutionContextResolution contextResolution, String requestTimeoutHeader); }
AbstractHttpCommandProcessor extends
		AbstractCommandProcessor<HttpCommand> implements HttpCommandProcessor,
		GateListener { @Override 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"); } serviceBindingDescriptors.put(servicePlusMajorVersion, bindingDescriptor); } protected  AbstractHttpCommandProcessor(Protocol protocol, DehydratedExecutionContextResolution contextResolution, String requestTimeoutHeader); void setStartingGate(CougarStartingGate startingGate); void setRequestLogger(RequestLogger requestLogger); @ManagedAttribute boolean isHardFailEnumDeserialisation(); void setHardFailEnumDeserialisation(boolean hardFailEnumDeserialisation); @Override @ManagedAttribute String getName(); void setName(String name); @Override @ManagedAttribute int getPriority(); void setPriority(int priority); @Override void bind(ServiceBindingDescriptor bindingDescriptor); void writeIdentity(List<IdentityToken> tokens, IdentityTokenIOAdapter ioAdapter); ContentTypeNormaliser getContentTypeNormaliser(); void setContentTypeNormaliser(ContentTypeNormaliser contentTypeNormaliser); void setValidatorRegistry(CommandValidatorRegistry<HttpCommand> validatorRegistry); @ManagedAttribute long getMaxPostBodyLength(); void setMaxPostBodyLength(long maxPostBodyLength); }
AbstractHttpCommandProcessor extends
		AbstractCommandProcessor<HttpCommand> implements HttpCommandProcessor,
		GateListener { @Override 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"); } serviceBindingDescriptors.put(servicePlusMajorVersion, bindingDescriptor); } protected  AbstractHttpCommandProcessor(Protocol protocol, DehydratedExecutionContextResolution contextResolution, String requestTimeoutHeader); void setStartingGate(CougarStartingGate startingGate); void setRequestLogger(RequestLogger requestLogger); @ManagedAttribute boolean isHardFailEnumDeserialisation(); void setHardFailEnumDeserialisation(boolean hardFailEnumDeserialisation); @Override @ManagedAttribute String getName(); void setName(String name); @Override @ManagedAttribute int getPriority(); void setPriority(int priority); @Override void bind(ServiceBindingDescriptor bindingDescriptor); void writeIdentity(List<IdentityToken> tokens, IdentityTokenIOAdapter ioAdapter); ContentTypeNormaliser getContentTypeNormaliser(); void setContentTypeNormaliser(ContentTypeNormaliser contentTypeNormaliser); void setValidatorRegistry(CommandValidatorRegistry<HttpCommand> validatorRegistry); @ManagedAttribute long getMaxPostBodyLength(); void setMaxPostBodyLength(long maxPostBodyLength);  }