dependencies.add(new Dependency<Object>(ServiceName.JBOSS.append("data-source", datasource)));
builder.dataSource().jndiUrl(datasource);
return builder;
} else if (storeKey.equals(ModelKeys.REMOTE_STORE)) {
final RemoteCacheStoreConfigurationBuilder builder = loadersBuilder.addStore(RemoteCacheStoreConfigurationBuilder.class);
for (ModelNode server : store.require(ModelKeys.REMOTE_SERVERS).asList()) {
String outboundSocketBinding = server.get(ModelKeys.OUTBOUND_SOCKET_BINDING).asString();
Injector<OutboundSocketBinding> injector = new SimpleInjector<OutboundSocketBinding>() {
@Override
public void inject(OutboundSocketBinding value) {
try {
builder.addServer().host(value.getDestinationAddress().getHostAddress()).port(value.getDestinationPort());
} catch (UnknownHostException e) {
throw InfinispanMessages.MESSAGES.failedToInjectSocketBinding(e, value);
}
}
};
dependencies.add(new Dependency<OutboundSocketBinding>(OutboundSocketBinding.OUTBOUND_SOCKET_BINDING_BASE_SERVICE_NAME.append(outboundSocketBinding), OutboundSocketBinding.class, injector));
}
if (store.hasDefined(ModelKeys.CACHE)) {
builder.remoteCacheName(store.get(ModelKeys.CACHE).asString());
}
if (store.hasDefined(ModelKeys.SOCKET_TIMEOUT)) {
builder.socketTimeout(store.require(ModelKeys.SOCKET_TIMEOUT).asLong());
}
if (store.hasDefined(ModelKeys.TCP_NO_DELAY)) {
builder.tcpNoDelay(store.require(ModelKeys.TCP_NO_DELAY).asBoolean());
}
return builder;
} else {
String className = store.require(ModelKeys.CLASS).asString();
try {