/** * Gets default virtual host, should be the only one. */ public VirtualHost getVHost() { return BROKER.getBroker().findVirtualHostByName("default"); }
private EventLogger getEventLogger() { return _broker.getEventLogger(); }
private void reportUnexpectedByteBufferSizeUsage() { if (!_unexpectedByteBufferSizeReported) { LOGGER.info("At least one frame unexpectedly does not fit into default byte buffer size ({}B) on a connection {}.", _broker.getNetworkBufferSize(), this.toString()); _unexpectedByteBufferSizeReported = true; } }
@Override public void childRemoved(final ConfiguredObject<?> object, final ConfiguredObject<?> child) { if (child == vhost) { broker.removeChangeListener(brokerListener); object.removeChangeListener(this); broker.getChildren(TrustStore.class).forEach(t -> t.removeChangeListener(trustStoreChangeListener)); } } });
@Override public void stateChanged(final ConfiguredObject<?> object, final State oldState, final State newState) { if (newState == State.ACTIVE) { _checkExpiryTaskFuture = getBroker().scheduleHouseKeepingTask(frequency, TimeUnit.DAYS, () -> checkCertificateExpiry()); getBroker().removeChangeListener(this); } } });
@Override public NamedAddressSpace getAddressSpace(final String name) { Broker<?> broker = getAncestor(Broker.class); NamedAddressSpace addressSpace = broker.getSystemAddressSpace(name); if(addressSpace == null) { for (VirtualHostNode<?> vhn : broker.getVirtualHostNodes()) { VirtualHost<?> vh = vhn.getVirtualHost(); if (vh != null && vh.getName().equals(name)) { addressSpace = vh; break; } } } return addressSpace; } }
Broker<?> broker = getBroker(); RmiPort registryPort = getEligibleJmxPort(RmiPort.class, broker.getPorts(), Protocol.RMI); JmxPort connectorPort = getEligibleJmxPort(JmxPort.class, broker.getPorts(), Protocol.JMX_RMI); if (registryPort == null || connectorPort == null) broker.addChangeListener(_changeListener); for (VirtualHostNode<?> virtualHostNode : broker.getVirtualHostNodes()) Collection<AuthenticationProvider<?>> authenticationProviders = broker.getAuthenticationProviders(); for (AuthenticationProvider<?> authenticationProvider : authenticationProviders) Collection<BrokerLogger> brokerLoggers = broker.getChildren(BrokerLogger.class); for (BrokerLogger brokerLogger : brokerLoggers)
@Override protected ListenableFuture<Void> onClose() { getBroker().removeChangeListener(_brokerChangeListener); if (_server != null) { try { logOperationalShutdownMessage(); _server.stop(); } catch (Exception e) { throw new ServerScopedRuntimeException("Failed to stop HTTP management", e); } } if (_jettyServerExecutor != null) { _jettyServerExecutor.shutdown(); } getBroker().getEventLogger().message(ManagementConsoleMessages.STOPPED(OPERATIONAL_LOGGING_NAME)); return Futures.immediateFuture(null); }
modifiedProperties.put(ServerPropertyNames.VERSION, CommonProperties.getReleaseVersion()); modifiedProperties.put(ServerPropertyNames.QPID_BUILD, CommonProperties.getBuildVersion()); modifiedProperties.put(ServerPropertyNames.QPID_INSTANCE_NAME, broker.getName()); modifiedProperties.put(ConnectionStartProperties.QPID_VIRTUALHOST_PROPERTIES_SUPPORTED, String.valueOf(broker.isVirtualHostPropertiesNodeEnabled())); String.valueOf(broker.isMessageCompressionEnabled())); modifiedProperties.put(ConnectionStartProperties.QPID_QUEUE_LIFETIME_SUPPORTED, Boolean.TRUE.toString()); case AMQP_0_10: modifiedProperties.put(ServerPropertyNames.FEDERATION_TAG, broker.getId().toString()); final List<String> features = getFeatures(broker); if (features.size() > 0)
void initializeExpiryChecking() { int checkFrequency = getCertificateExpiryCheckFrequency(); if(getBroker().getState() == State.ACTIVE) { _checkExpiryTaskFuture = getBroker().scheduleHouseKeepingTask(checkFrequency, TimeUnit.DAYS, this::checkCertificateExpiry); } else { final int frequency = checkFrequency; getBroker().addChangeListener(new AbstractConfigurationChangeListener() { @Override public void stateChanged(final ConfiguredObject<?> object, final State oldState, final State newState) { if (newState == State.ACTIVE) { _checkExpiryTaskFuture = getBroker().scheduleHouseKeepingTask(frequency, TimeUnit.DAYS, () -> checkCertificateExpiry()); getBroker().removeChangeListener(this); } } }); } }
Collection<HttpPort<?>> httpPorts = getEligibleHttpPorts(getBroker().getPorts()); if (httpPorts.isEmpty()) getBroker().getEventLogger().message(ManagementConsoleMessages.STARTUP(OPERATIONAL_LOGGING_NAME)); getBroker().getEventLogger().message(PortMessages.BIND_FAILED("HTTP", e.getAddress().getPort())); throw e; getBroker().getEventLogger().message(ManagementConsoleMessages.READY(OPERATIONAL_LOGGING_NAME));
long totalCacheSize = broker.getContextValue(Long.class, BDBVirtualHost.QPID_BROKER_BDB_TOTAL_CACHE_SIZE); Collection<VirtualHostNode<?>> nodes = broker.getVirtualHostNodes(); Collection<BDBEnvironmentContainer> bdbEnvironmentContainers = new HashSet<>(); for (VirtualHostNode<?> virtualHostNode: nodes)
@Override public void onFailure(final Throwable t) { setState(State.ERRORED); if (((Broker) getParent()).isManagementMode()) { LOGGER.warn("Failed to make {} active.", this, t); resultFuture.set(null); } else { resultFuture.setException(t); } } }, getTaskExecutor());
VirtualHost<?,?,?> virtualHost = _broker.findVirtualHostByName(virtualHostName); if (virtualHost == null) Operation operation = (isAccessMethod(methodName) || impact == MBeanOperationInfo.INFO) ? Operation.ACCESS : Operation.UPDATE; SecurityManager security = _broker.getSecurityManager(); security.authoriseMethod(operation, type, methodName, virtualHostName);
final Broker<?> broker = (Broker<?>) virtualHostNode.getParent(); final Collection<TrustStore> trustStores = broker.getChildren(TrustStore.class); broker.addChangeListener(brokerListener); virtualHostNode.addChangeListener(new AbstractConfigurationChangeListener()
public AMQPConnection_0_8Impl(Broker<?> broker, ServerNetworkConnection network, AmqpPort<?> port, Transport transport, Protocol protocol, long connectionId, AggregateTicker aggregateTicker) { super(broker, network, port, transport, protocol, connectionId, aggregateTicker); _maxNoOfChannels = port.getSessionCountLimit(); _decoder = new BrokerDecoder(this); _binaryDataLimit = getBroker().getContextKeys(false).contains(BROKER_DEBUG_BINARY_DATA_LENGTH) ? getBroker().getContextValue(Integer.class, BROKER_DEBUG_BINARY_DATA_LENGTH) : DEFAULT_DEBUG_BINARY_DATA_LENGTH; String sendQueueDeleteOkRegardlessRegexp = getBroker().getContextKeys(false).contains(Broker.SEND_QUEUE_DELETE_OK_REGARDLESS_CLIENT_VER_REGEXP) ? getBroker().getContextValue(String.class, Broker.SEND_QUEUE_DELETE_OK_REGARDLESS_CLIENT_VER_REGEXP): ""; _sendQueueDeleteOkRegardlessClientVerRegexp = Pattern.compile(sendQueueDeleteOkRegardlessRegexp); _sender = network.getSender(); _closeWhenNoRoute = port.getCloseWhenNoRoute(); }
public boolean isCompressionSupported() { return _compressionSupported && _broker.isMessageCompressionEnabled(); }
public ServerSession(ServerConnection connection, ServerSessionDelegate delegate, Binary name, long expiry) { this.connection = connection; this.delegate = delegate; this.name = name; this.closing = false; this._isNoReplay = false; initReceiver(); _transaction = new AsyncAutoCommitTransaction(this.getMessageStore(),this); _blockingTimeout = connection.getBroker().getContextValue(Long.class, Broker.CHANNEL_FLOW_CONTROL_ENFORCEMENT_TIMEOUT); }
@Override protected void onClose() { synchronized (_childrenLock) { for(ConfiguredObject<?> object : _children.keySet()) { unregisterObjectMBeans(object); } _children.clear(); } getBroker().removeChangeListener(_changeListener); closeObjectRegistry(); _loggingManagementMBean = null; }
@Override protected void onOpen() { super.onOpen(); _serveUncompressedDojo = Boolean.TRUE.equals(getContextValue(Boolean.class, "qpid.httpManagement.serveUncompressedDojo")); _saslExchangeExpiry = getContextValue(Long.class, SASL_EXCHANGE_EXPIRY_CONTEXT_NAME); getBroker().addChangeListener(_brokerChangeListener); }