Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update setUpJMSBaseURIs to run every request
  • Loading branch information
cbeer committed Oct 13, 2014
1 parent b824231 commit bd015c1
Showing 1 changed file with 8 additions and 18 deletions.
Expand Up @@ -87,28 +87,18 @@ public FedoraResource getResourceFromPath(final String externalPath) {
}



private static boolean baseURLSet = false;
/**
* Set the baseURL for JMS events.
**/
protected void setUpJMSBaseURIs(final UriInfo uriInfo) {
if ( !baseURLSet ) {
// set to true the first time this is run. if there is an exception the first time, there
// will likely be an exception every time. since this is run on each repository update,
// we should fail fast rather than retrying over and over.
baseURLSet = true;
try {
final URI baseURL = uriInfo.getBaseUri();
final Class<? extends FedoraBaseResource> klass = this.getClass();
LOGGER.debug(klass + ".init(): baseURL = " + baseURL.toString());
final ObservationManager obs = session().getWorkspace().getObservationManager();
final String json = "{\"baseURL\":\"" + baseURL.toString() + "\"}";
obs.setUserData(json);
LOGGER.trace(klass + ".init(): done");
} catch ( Exception ex ) {
LOGGER.warn("Error setting baseURL", ex);
}
try {
final URI baseURL = uriInfo.getBaseUri();
LOGGER.debug("setting baseURL = " + baseURL.toString());
final ObservationManager obs = session().getWorkspace().getObservationManager();
final String json = "{\"baseURL\":\"" + baseURL.toString() + "\"}";
obs.setUserData(json);
} catch ( Exception ex ) {
LOGGER.warn("Error setting baseURL", ex);
}
}

Expand Down

0 comments on commit bd015c1

Please sign in to comment.