move getAppName to AbstractBusEndpoint
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user