use of org.oasis_open.docs.wsn.brw_2.ResourceNotDestroyedFault in project cxf by apache.
the class AbstractNotificationBroker method handleRegisterPublisher.
public RegisterPublisherResponse handleRegisterPublisher(RegisterPublisher registerPublisherRequest) throws InvalidTopicExpressionFault, PublisherRegistrationFailedFault, PublisherRegistrationRejectedFault, ResourceUnknownFault, TopicNotSupportedFault {
AbstractPublisher publisher = null;
boolean success = false;
try {
publisher = createPublisher(idGenerator.generateSanitizedId());
publisher.register();
publisher.create(registerPublisherRequest);
RegisterPublisherResponse response = new RegisterPublisherResponse();
response.setPublisherRegistrationReference(publisher.getEpr());
if (publisher.getPublisherReference() != null) {
publishers.put(WSNHelper.getInstance().getWSAAddress(publisher.getPublisherReference()), publisher);
} else {
nonContactPublishers.add(publisher);
}
success = true;
return response;
} catch (EndpointRegistrationException e) {
LOGGER.log(Level.WARNING, "Unable to register new endpoint", e);
PublisherRegistrationFailedFaultType fault = new PublisherRegistrationFailedFaultType();
throw new PublisherRegistrationFailedFault("Unable to register new endpoint", fault, e);
} finally {
if (!success && publisher != null) {
try {
publisher.destroy();
} catch (ResourceNotDestroyedFault e) {
LOGGER.log(Level.INFO, "Error destroying publisher", e);
}
}
}
}
Aggregations