use of org.wildfly.clustering.service.InjectedValueDependency in project wildfly by wildfly.
the class JChannelFactoryBuilder method configure.
@Override
public Builder<ChannelFactory> configure(OperationContext context, ModelNode model) throws OperationFailedException {
PathAddress address = context.getCurrentAddress();
Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS);
Optional<PathElement> transport = resource.getChildren(TransportResourceDefinition.WILDCARD_PATH.getKey()).stream().map(Resource.ResourceEntry::getPathElement).findFirst();
if (!transport.isPresent()) {
throw JGroupsLogger.ROOT_LOGGER.transportNotDefined(this.getName());
}
this.transport = new InjectedValueDependency<>(new SingletonProtocolServiceNameProvider(address, transport.get()), TransportConfiguration.class);
this.protocols = resource.getChildren(ProtocolResourceDefinition.WILDCARD_PATH.getKey()).stream().map(entry -> new InjectedValueDependency<>(new ProtocolServiceNameProvider(address, entry.getPathElement()), ProtocolConfiguration.class)).collect(Collectors.toList());
this.relay = resource.hasChild(RelayResourceDefinition.PATH) ? new InjectedValueDependency<>(new SingletonProtocolServiceNameProvider(address, RelayResourceDefinition.PATH), RelayConfiguration.class) : null;
return this;
}
Aggregations