GigaSpaces XAP 7.0 API

org.openspaces.pu.container.jee
Class SharedContextFactory

java.lang.Object
  extended by org.openspaces.pu.container.jee.SharedContextFactory
All Implemented Interfaces:
ClusterInfoAware, FactoryBean

public class SharedContextFactory
extends Object
implements 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 Summary
SharedContextFactory()
           
 
Method Summary
 Object getObject()
           
 Class getObjectType()
           
 boolean isSingleton()
           
 void setClusterInfo(ClusterInfo clusterInfo)
          Sets the cluster information.
 void setContext(String context)
           
 void setSeparator(String separator)
           
 void setUnique(boolean unique)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SharedContextFactory

public SharedContextFactory()
Method Detail

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 FactoryBean
Throws:
Exception

getObjectType

public Class getObjectType()
Specified by:
getObjectType in interface FactoryBean

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface FactoryBean

GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.