Class SharedContextFactory

java.lang.Object
org.openspaces.pu.container.jee.SharedContextFactory
All Implemented Interfaces:
ClusterInfoAware, org.springframework.beans.factory.FactoryBean

public class SharedContextFactory extends Object implements org.springframework.beans.factory.FactoryBean, ClusterInfoAware
A helper to construct web context path. Allows to set the context that will be used.

setUnique(boolean) (which defaults to true) controls if the context created will be unique between other instances of the same web application. If set to true, the context created will be in the format of [context] + [suffix] + ClusterInfo.getRunningNumberOffset1(). If set to false, will simply return the context.

Author:
kimchy
  • Constructor Details

    • SharedContextFactory

      public SharedContextFactory()
  • Method Details

    • setContext

      public void setContext(String context)
    • setUnique

      public void setUnique(boolean unique)
    • setSeparator

      public void setSeparator(String separator)
    • setClusterInfo

      public void setClusterInfo(ClusterInfo clusterInfo)
      Description copied from interface: ClusterInfoAware
      Sets the cluster information.

      Note, the cluster information is obtained externally from the application context which means that this feature need to be supported by specific containers (and is not supported by plain Spring application context). This means that beans that implement ClusterInfoAware should take into account the fact that the cluster info provided might be null.

      Specified by:
      setClusterInfo in interface ClusterInfoAware
      Parameters:
      clusterInfo - The cluster information to be injected
    • getObject

      public Object getObject() throws Exception
      Specified by:
      getObject in interface org.springframework.beans.factory.FactoryBean
      Throws:
      Exception
    • getObjectType

      public Class getObjectType()
      Specified by:
      getObjectType in interface org.springframework.beans.factory.FactoryBean
    • isSingleton

      public boolean isSingleton()
      Specified by:
      isSingleton in interface org.springframework.beans.factory.FactoryBean