/** * Constructs a <code>Destination</code> with the indicated management. * * @param enableManagement <code>true</code> if the <code>Destination</code> * is manageable; otherwise <code>false</code>. */ public Destination(boolean enableManagement) { super(enableManagement); networkSettings = new NetworkSettings(); }
/** * Sets the <code>NetworkSettings</code> of the <code>MessageDestination</code>. * * @param networkSettings The <code>NetworkSettings</code> of the <code>MessageDestination</code> */ public void setNetworkSettings(NetworkSettings networkSettings) { super.setNetworkSettings(networkSettings); // Set throttle and subscription manager settings if needed if (networkSettings.getThrottleSettings() != null) { ThrottleSettings settings = networkSettings.getThrottleSettings(); settings.setDestinationName(getId()); throttleManager.setThrottleSettings(settings); } if (networkSettings.getSubscriptionTimeoutMinutes() > 0) { long subscriptionTimeoutMillis = networkSettings.getSubscriptionTimeoutMinutes() * 60 * 1000; // Convert to millis. subscriptionManager.setSubscriptionTimeoutMillis(subscriptionTimeoutMillis); } }
networkSettings.setReliable(network.getPropertyAsBoolean(NetworkSettings.RELIABLE_ELEMENT, false)); String coordinatorPolicy = clusterInfo.getPropertyAsString(ClusterSettings.SHARED_BACKEND_ATTR, null); if (coordinatorPolicy != null) networkSettings.setSharedBackend(Boolean.valueOf(coordinatorPolicy)); networkSettings.setClusterId(clusterId);
protected void network(ConfigMap properties) { ConfigMap network = properties.getPropertyAsMap(NetworkSettings.NETWORK_ELEMENT, null); if (network != null) { // Get implementation specific network settings, including subclasses! NetworkSettings ns = getNetworkSettings(); // Subscriber timeout; first check for subscription-timeout-minutes and fallback to legacy session-timeout. int useLegacyPropertyToken = -999999; int subscriptionTimeoutMinutes = network.getPropertyAsInt(NetworkSettings.SUBSCRIPTION_TIMEOUT_MINUTES, useLegacyPropertyToken); if (subscriptionTimeoutMinutes == useLegacyPropertyToken) subscriptionTimeoutMinutes = network.getPropertyAsInt(NetworkSettings.SESSION_TIMEOUT, NetworkSettings.DEFAULT_TIMEOUT); ns.setSubscriptionTimeoutMinutes(subscriptionTimeoutMinutes); // Throttle Settings throttle(ns.getThrottleSettings(), network); setNetworkSettings(ns); } }
public void clusterDestination(Destination destination) String clusterId = destination.getNetworkSettings().getClusterId(); String serviceType = destination.getServiceType(); String destinationName = destination.getId(); boolean sharedBackend = destination.getNetworkSettings().isSharedBackend(); List channelIds = destination.getChannels();
/** * Initializes the <code>Destination</code> with the properties. * If subclasses override, they must call <code>super.initialize()</code>. * * @param id The id of the destination. * @param properties Properties for the destination. */ public void initialize(String id, ConfigMap properties) { super.initialize(id, properties); if (properties == null || properties.size() == 0) return; ConfigMap network = properties.getPropertyAsMap(NetworkSettings.NETWORK_ELEMENT, null); if (network != null) { ConfigMap clusterInfo = network.getPropertyAsMap(ClusterSettings.CLUSTER_ELEMENT, null); if (clusterInfo != null) { // Mark these as used so we do not get warnings about them. network.allowProperty(ClusterSettings.CLUSTER_ELEMENT); clusterInfo.allowProperty(ClusterSettings.REF_ATTR); clusterInfo.allowProperty(ClusterSettings.SHARED_BACKEND_ATTR); String clusterId = clusterInfo.getPropertyAsString(ClusterSettings.REF_ATTR, null); String coordinatorPolicy = clusterInfo.getPropertyAsString(ClusterSettings.SHARED_BACKEND_ATTR, null); if (coordinatorPolicy != null) networkSettings.setSharedBackend(Boolean.valueOf(coordinatorPolicy).booleanValue()); networkSettings.setClusterId(clusterId); } } }
/** * Sets up the throttle manager before it starts. */ @Override public void start() { // Create the throttle manager, only if needed. if (networkSettings.getThrottleSettings() != null) { ThrottleSettings settings = networkSettings.getThrottleSettings(); if (settings.isClientThrottleEnabled() || settings.isDestinationThrottleEnabled()) { settings.setDestinationName(getId()); throttleManager = createThrottleManager(); throttleManager.setThrottleSettings(settings); throttleManager.start(); } } super.start(); }
if (getNetworkSettings().getClusterId() != null || cm.getDefaultClusterId() != null)
/** * Sets the <code>NetworkSettings</code> of the <code>MessageDestination</code>. * * @param networkSettings The <code>NetworkSettings</code> of the <code>MessageDestination</code> */ @Override public void setNetworkSettings(NetworkSettings networkSettings) { super.setNetworkSettings(networkSettings); // Set the subscription manager settings if needed. if (networkSettings.getSubscriptionTimeoutMinutes() > 0) { long subscriptionTimeoutMillis = networkSettings.getSubscriptionTimeoutMinutes() * 60L * 1000L; // Convert to millis. subscriptionManager.setSubscriptionTimeoutMillis(subscriptionTimeoutMillis); } }
boolean reliable = networkSettings != null && networkSettings.isReliable(); if (onlyReliable && !reliable) return null; reliableMap.addProperty(ConfigurationConstants.EMPTY_STRING, Boolean.toString(networkSettings.isReliable()));
networkSettings.setReliable(network.getPropertyAsBoolean(NetworkSettings.RELIABLE_ELEMENT, false)); String coordinatorPolicy = clusterInfo.getPropertyAsString(ClusterSettings.SHARED_BACKEND_ATTR, null); if (coordinatorPolicy != null) networkSettings.setSharedBackend(Boolean.valueOf(coordinatorPolicy)); networkSettings.setClusterId(clusterId);
protected void network(ConfigMap properties) { ConfigMap network = properties.getPropertyAsMap(NetworkSettings.NETWORK_ELEMENT, null); if (network == null) return; // Get implementation specific network settings, including subclasses! NetworkSettings ns = getNetworkSettings(); // Subscriber timeout; first check for subscription-timeout-minutes and fallback to legacy session-timeout. int useLegacyPropertyToken = -999999; int subscriptionTimeoutMinutes = network.getPropertyAsInt(NetworkSettings.SUBSCRIPTION_TIMEOUT_MINUTES, useLegacyPropertyToken); if (subscriptionTimeoutMinutes == useLegacyPropertyToken) subscriptionTimeoutMinutes = network.getPropertyAsInt(NetworkSettings.SESSION_TIMEOUT, NetworkSettings.DEFAULT_TIMEOUT); ns.setSubscriptionTimeoutMinutes(subscriptionTimeoutMinutes); // Throttle Settings ThrottleSettings ts = ns.getThrottleSettings(); ts.setDestinationName(getId()); throttle(ts, network); setNetworkSettings(ns); }
String clusterId = destination.getNetworkSettings().getClusterId(); if (clusterId == null) clusterId = getDefaultClusterId(); destination.getId(), channelId, endpointUrl, endpointPort, destination.getNetworkSettings().isSharedBackend());
/** * Sets up the throttle manager before it starts. */ @Override public void start() { // Create the throttle manager, only if needed. if (networkSettings.getThrottleSettings() != null) { ThrottleSettings settings = networkSettings.getThrottleSettings(); if (settings.isClientThrottleEnabled() || settings.isDestinationThrottleEnabled()) { settings.setDestinationName(getId()); throttleManager = createThrottleManager(); throttleManager.setThrottleSettings(settings); throttleManager.start(); } } super.start(); }
if (getNetworkSettings().getClusterId() != null || cm.getDefaultClusterId() != null)
/** * Sets the <code>NetworkSettings</code> of the <code>MessageDestination</code>. * * @param networkSettings The <code>NetworkSettings</code> of the <code>MessageDestination</code> */ @Override public void setNetworkSettings(NetworkSettings networkSettings) { super.setNetworkSettings(networkSettings); // Set the subscription manager settings if needed. if (networkSettings.getSubscriptionTimeoutMinutes() > 0) { long subscriptionTimeoutMillis = networkSettings.getSubscriptionTimeoutMinutes() * 60L * 1000L; // Convert to millis. subscriptionManager.setSubscriptionTimeoutMillis(subscriptionTimeoutMillis); } }
boolean reliable = networkSettings != null && networkSettings.isReliable(); if (onlyReliable && !reliable) return null; reliableMap.addProperty(ConfigurationConstants.EMPTY_STRING, Boolean.toString(networkSettings.isReliable()));
protected void network(ConfigMap properties) { ConfigMap network = properties.getPropertyAsMap(NetworkSettings.NETWORK_ELEMENT, null); if (network == null) return; // Get implementation specific network settings, including subclasses! NetworkSettings ns = getNetworkSettings(); // Subscriber timeout; first check for subscription-timeout-minutes and fallback to legacy session-timeout. int useLegacyPropertyToken = -999999; int subscriptionTimeoutMinutes = network.getPropertyAsInt(NetworkSettings.SUBSCRIPTION_TIMEOUT_MINUTES, useLegacyPropertyToken); if (subscriptionTimeoutMinutes == useLegacyPropertyToken) subscriptionTimeoutMinutes = network.getPropertyAsInt(NetworkSettings.SESSION_TIMEOUT, NetworkSettings.DEFAULT_TIMEOUT); ns.setSubscriptionTimeoutMinutes(subscriptionTimeoutMinutes); // Throttle Settings ThrottleSettings ts = ns.getThrottleSettings(); ts.setDestinationName(getId()); throttle(ts, network); setNetworkSettings(ns); }
String clusterId = destination.getNetworkSettings().getClusterId(); if (clusterId == null) clusterId = getDefaultClusterId(); destination.getId(), channelId, endpointUrl, endpointPort, destination.getNetworkSettings().isSharedBackend());
ThrottleSettings ts = destination.getNetworkSettings().getThrottleSettings(); if (ts.getOutboundPolicy() != Policy.NONE && (ts.isOutboundClientThrottleEnabled() || si.maxFrequency > 0))