}
RemoteInfinispanServer server = null;
CommonContainerConfiguration conf;
try
{
conf = (CommonContainerConfiguration) event.getContainer().createDeployableConfiguration();
server = (RemoteInfinispanServer) infinispanContext.get().get(RemoteInfinispanServer.class, event.getContainer().getContainerConfiguration().getContainerName());
if (server != null)
{
if (server instanceof InfinispanServer)
{
InfinispanServer orig = (InfinispanServer) server;
orig.setManagementAddress(conf.getManagementAddress());
orig.setManagementPort(conf.getManagementPort());
return;
}
else
{
throw new RuntimeException("Cannot override properties of a server of different type");
}
}
else
{
server = new InfinispanServer(conf.getManagementAddress(), conf.getManagementPort());
}
}
catch (Exception e)
{
throw new RuntimeException("Could not create deployable configuration", e);