public void addEndpoint(final ServerEndpointConfig endpoint) throws DeploymentException {
if (deploymentComplete) {
throw JsrWebSocketMessages.MESSAGES.cannotAddEndpointAfterDeployment();
}
JsrWebSocketLogger.ROOT_LOGGER.addingProgramaticEndpoint(endpoint.getEndpointClass(), endpoint.getPath());
final PathTemplate template = PathTemplate.create(endpoint.getPath());
if (seenPaths.contains(template)) {
PathTemplate existing = null;
for (PathTemplate p : seenPaths) {
if (p.compareTo(template) == 0) {
existing = p;
break;
}