Class InstanceIdFactoryBean

java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<String>
org.kuali.rice.ksb.impl.bus.InstanceIdFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<String>, org.springframework.beans.factory.InitializingBean

public class InstanceIdFactoryBean extends org.springframework.beans.factory.config.AbstractFactoryBean<String>
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 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 KSBConstants.Config.INSTANCE_ID configuration parameter which should always have a value.

Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Field Summary

    Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

    logger

    Fields inherited from interface org.springframework.beans.factory.FactoryBean

    OBJECT_TYPE_ATTRIBUTE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
     
     
    protected String
     
    void
    setInstanceId(String instanceId)
     

    Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

    afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • InstanceIdFactoryBean

      public InstanceIdFactoryBean()
  • Method Details

    • setInstanceId

      public void setInstanceId(String instanceId)
    • createInstance

      protected String createInstance() throws Exception
      Specified by:
      createInstance in class org.springframework.beans.factory.config.AbstractFactoryBean<String>
      Throws:
      Exception
    • loadInstanceIdFromConfig

      protected String loadInstanceIdFromConfig()
    • getObjectType

      public Class<String> getObjectType()
      Specified by:
      getObjectType in interface org.springframework.beans.factory.FactoryBean<String>
      Specified by:
      getObjectType in class org.springframework.beans.factory.config.AbstractFactoryBean<String>