public ConnectionFactoryResourceBuilder property(String key, String value) { checkState(); definition.getConfiguration().setFactoryProperty(key, value); return this; }
public ConnectionFactoryResource load(XMLStreamReader reader, IntrospectionContext context) throws XMLStreamException { if (parsers.isEmpty()) { // skip the resource return null; } String provider = reader.getAttributeValue(null, "provider"); ConnectionFactoryConfigurationParser parser; if (provider == null) { parser = parsers.values().iterator().next(); } else { parser = parsers.get(provider); if (parser == null) { UnrecognizedAttribute error = new UnrecognizedAttribute("JMS provider not installed: " + provider, reader.getLocation()); context.addError(error); return null; } } ConnectionFactoryConfiguration configuration = parser.parse(reader, context); return new ConnectionFactoryResource(configuration); } }
private ConnectionFactoryResourceBuilder(String name) { definition = new ConnectionFactoryResource(new ConnectionFactoryConfiguration(name)); }
/** * Sets the client id. The runtime name can be used via the <code>{runtime}</code> parameter. * * @param clientId the client id * @return the builder */ public ConnectionFactoryResourceBuilder clientId(String clientId) { checkState(); definition.getConfiguration().setClientId(clientId); return this; }
public ConnectionFactoryResourceBuilder username(String username) { checkState(); definition.getConfiguration().setUsername(username); return this; }
public ConnectionFactoryResourceBuilder password(String password) { checkState(); definition.getConfiguration().setPassword(password); return this; }
public ConnectionFactoryResourceBuilder attribute(String key, Object value) { checkState(); definition.getConfiguration().addAttribute(key, value); return this; }
public ConnectionFactoryResourceBuilder provider(String provider) { checkState(); definition.getConfiguration().setProvider(provider); return this; }
public ConnectionFactoryResourceBuilder type(ConnectionFactoryType type) { checkState(); definition.getConfiguration().setType(type); return this; }
public PhysicalConnectionFactory generateResource(LogicalResource<ConnectionFactoryResource> resource) { return new PhysicalConnectionFactory(resource.getDefinition().getConfiguration()); } }