use of org.apache.qpid.server.model.Protocol in project qpid-broker-j by apache.
the class JmsTestBase method setUpTestBase.
@BeforeClass
public static void setUpTestBase() {
Protocol protocol = getProtocol();
_managementFacade = new AmqpManagementFacade(protocol);
if (protocol == Protocol.AMQP_1_0) {
_jmsProvider = new QpidJmsClientProvider(_managementFacade);
} else {
_jmsProvider = new QpidJmsClient0xProvider();
}
LOGGER.debug("Test receive timeout is {} milliseconds", getReceiveTimeout());
}
use of org.apache.qpid.server.model.Protocol in project qpid-broker-j by apache.
the class HttpTestBase method setUpTestBase.
@Before
public void setUpTestBase() throws Exception {
System.setProperty("sun.net.http.allowRestrictedHeaders", "true");
HttpRequestConfig config = getHttpRequestConfig();
_helper = new HttpTestHelper(getBrokerAdmin(), config != null && config.useVirtualHostAsHost() ? getVirtualHost() : null);
Protocol protocol = getProtocol();
AmqpManagementFacade managementFacade = new AmqpManagementFacade(protocol);
if (protocol == Protocol.AMQP_1_0) {
_jmsProvider = new QpidJmsClientProvider(managementFacade);
} else {
_jmsProvider = new QpidJmsClient0xProvider();
}
}
use of org.apache.qpid.server.model.Protocol in project qpid-broker-j by apache.
the class AmqpPortImpl method onActivate.
@Override
protected State onActivate() {
if (getAncestor(SystemConfig.class).isManagementMode()) {
return State.QUIESCED;
} else {
Collection<Transport> transports = getTransports();
TransportProvider transportProvider = null;
final HashSet<Transport> transportSet = new HashSet<>(transports);
for (TransportProviderFactory tpf : (new QpidServiceLoader()).instancesOf(TransportProviderFactory.class)) {
if (tpf.getSupportedTransports().contains(transports)) {
transportProvider = tpf.getTransportProvider(transportSet);
}
}
if (transportProvider == null) {
throw new IllegalConfigurationException("No transport providers found which can satisfy the requirement to support the transports: " + transports);
}
if (transports.contains(Transport.SSL) || transports.contains(Transport.WSS)) {
_sslContext = createSslContext();
}
Protocol defaultSupportedProtocolReply = getDefaultAmqpSupportedReply();
try {
_transport = transportProvider.createTransport(transportSet, _sslContext, this, getProtocols(), defaultSupportedProtocolReply);
_transport.start();
_boundPort = _transport.getAcceptingPort();
for (Transport transport : getTransports()) {
_container.getEventLogger().message(BrokerMessages.LISTENING(String.valueOf(transport), _transport.getAcceptingPort()));
}
return State.ACTIVE;
} catch (PortBindFailureException e) {
_container.getEventLogger().message(PortMessages.BIND_FAILED(getType().toUpperCase(), getPort()));
throw e;
}
}
}
use of org.apache.qpid.server.model.Protocol in project qpid-broker-j by apache.
the class AmqpPortImpl method getDefaultAmqpSupportedReply.
private Protocol getDefaultAmqpSupportedReply() {
String defaultAmqpSupportedReply = getContextKeys(false).contains(AmqpPort.PROPERTY_DEFAULT_SUPPORTED_PROTOCOL_REPLY) ? getContextValue(String.class, AmqpPort.PROPERTY_DEFAULT_SUPPORTED_PROTOCOL_REPLY) : null;
Protocol protocol = null;
if (defaultAmqpSupportedReply != null && defaultAmqpSupportedReply.length() != 0) {
try {
protocol = Protocol.valueOf("AMQP_" + defaultAmqpSupportedReply.substring(1));
} catch (IllegalArgumentException e) {
LOGGER.warn("The configured default reply ({}) is not a valid value for a protocol. This value will be ignored", defaultAmqpSupportedReply);
}
}
final Set<Protocol> protocolSet = getProtocols();
if (protocol != null && !protocolSet.contains(protocol)) {
LOGGER.warn("The configured default reply ({}) to an unsupported protocol version initiation is not" + " supported on this port. Only the following versions are supported: {}", defaultAmqpSupportedReply, protocolSet);
protocol = null;
}
return protocol;
}
use of org.apache.qpid.server.model.Protocol in project qpid-broker-j by apache.
the class Main method printVersion.
private void printVersion() {
final StringBuilder protocol = new StringBuilder("AMQP version(s) [major.minor]: ");
boolean first = true;
Set<Protocol> protocols = new TreeSet<>();
for (ProtocolEngineCreator installedEngine : (new QpidServiceLoader()).instancesOf(ProtocolEngineCreator.class)) {
protocols.add(installedEngine.getVersion());
}
for (Protocol supportedProtocol : protocols) {
if (first) {
first = false;
} else {
protocol.append(", ");
}
protocol.append(supportedProtocol.getProtocolVersion());
}
System.out.println(CommonProperties.getVersionString() + " (" + protocol + ")");
}
Aggregations