Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2005-2012 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package org.kuali.rice.ksb.impl.bus;
A factory bean which is used to produce an instance id for the service bus.

The value for the instance id is determined in the following order of preferences:

  1. If instanceId is set on this factory bean, that value will be used.
  2. If org.kuali.rice.ksb.util.KSBConstants.Config.INSTANCE_ID has been set in the configuration context, that value will be used.
  3. If none of the above, the instance id will be a combination of this application's namespace plus ip address.

In the case that the instance id is generated, the application id will be pulled from the configuration context using the org.kuali.rice.ksb.util.KSBConstants.Config.INSTANCE_ID configuration parameter which should always have a value.

Kuali Rice Team (
	private String instanceId;
	public void setInstanceId(String instanceId) {
		this. = instanceId;
	protected String createInstance() throws Exception {
		if (StringUtils.isBlank()) {
		if (StringUtils.isBlank()) {
			String applicationId = CoreConfigHelper.getApplicationId();
			String ipNumber = RiceUtilities.getIpNumber();
			this. = applicationId + "-" + ipNumber;
		return this.;
	public Class<StringgetObjectType() {
		return String.class;
New to GrepCode? Check out our FAQ X