move getAppName to AbstractBusEndpoint

This commit is contained in:
Spencer Gibb
2014-08-22 14:15:36 -06:00
parent d95f61f404
commit 3ea113fd15
2 changed files with 6 additions and 2 deletions

View File

@@ -17,6 +17,10 @@ public class AbstractBusEndpoint implements MvcEndpoint {
@Autowired
private BusEndpoint delegate;
protected String getAppName() {
return env.getProperty("spring.application.name");
}
@Override
public String getPath() {
return "/" + this.delegate.getId();

View File

@@ -16,8 +16,8 @@ public class RefreshBusEndpoint extends AbstractBusEndpoint {
@RequestMapping(value = "refresh", method = RequestMethod.POST)
@ResponseBody
public void refresh(@RequestParam Map<String, String> params) {
context.publishEvent(new RefreshRemoteApplicationEvent(this, env.getProperty("spring.application.name")));
//return "remote refresh event sent to bus";
context.publishEvent(new RefreshRemoteApplicationEvent(this, getAppName()));
}
}