Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

SWITCHYARD-1352 Defer initialization of remote endpoints for SCA bind…

…ings
  • Loading branch information...
commit fe5ac3bc1ed026d398ea15c43c669bbc419d1e25 1 parent 61ff84d
@kcbabo kcbabo authored
View
8 .../extension/src/main/java/org/switchyard/as7/extension/cluster/RemoteEndpointListener.java
@@ -58,6 +58,8 @@
private String _contextName;
private StandardContext _serverContext;
private Map<QName, ServiceDomain> _services = new ConcurrentHashMap<QName, ServiceDomain>();
+
+ private boolean _started;
/**
* Constructor.
@@ -72,6 +74,10 @@ public void init(String context) {
@Override
public synchronized void start() throws Exception {
+ // If the remote listener is already started, just return.
+ if (_started) {
+ return;
+ }
Host host = ServerUtil.getDefaultHost().getHost();
_serverContext = (StandardContext) host.findChild("/" + _contextName);
@@ -108,6 +114,8 @@ public synchronized void start() throws Exception {
SwitchYardRemotingServlet remotingServlet = (SwitchYardRemotingServlet) wrapper.getServlet();
remotingServlet.setEndpointPublisher(this);
_log.info("Published Remote Service Endpoint " + _serverContext.getPath());
+
+ _started = true;
} else {
throw new RuntimeException("Context " + _contextName + " already exists!");
}
Please sign in to comment.
Something went wrong with that request. Please try again.