|
Oracle Fusion Middleware Java API Reference for Oracle TopLink 11g Release 1 (11.1.1) E28847-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
org.eclipse.persistence.sdo.helper.SDOHelperContext
public class SDOHelperContext
Purpose:
Responsibilities:
Nested Class Summary | |
---|---|
private static class |
SDOHelperContext.ApplicationAccessWLS |
static class |
SDOHelperContext.MyNotificationFilter INTERNAL: This class will be handed in as a parameter when adding a JBoss notification listener. |
private static class |
SDOHelperContext.MyNotificationListener INTERNAL: Inner class used to catch application re-deployment. |
Field Summary | |
---|---|
private static java.util.concurrent.ConcurrentHashMap<java.lang.Object,java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.String>> |
aliasMap |
private static SDOHelperContext.ApplicationAccessWLS |
applicationAccessWLS |
private static java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.ClassLoader> |
appNameToClassLoaderMap |
private static ApplicationResolver |
appResolver |
protected CopyHelper |
copyHelper |
private static int |
COUNTER_LIMIT |
protected DataFactory |
dataFactory |
protected DataHelper |
dataHelper |
protected EqualityHelper |
equalityHelper |
private static java.lang.String |
GLOBAL_HELPER_IDENTIFIER |
private static java.util.concurrent.ConcurrentHashMap<java.lang.Object,java.util.concurrent.ConcurrentHashMap<java.lang.String,HelperContext>> |
helperContexts |
private java.lang.String |
identifier |
private static boolean |
isAppResolverSet |
private static java.lang.String |
JBOSS_CLASSLOADER_NAME |
private static java.lang.String |
JBOSS_DEFAULT_DOMAIN_NAME |
private static java.lang.String |
JBOSS_EAR |
private static int |
JBOSS_EAR_OFFSET |
private static java.lang.String |
JBOSS_ID_KEY |
private static int |
JBOSS_IDENTIFIER |
private static java.lang.String |
JBOSS_JAR |
private static java.lang.String |
JBOSS_SERVICE_CONTROLLER |
private static int |
JBOSS_TRIM_COUNT |
private static java.lang.String |
JBOSS_TYPE_STOP |
private static java.lang.String |
JBOSS_VFSFILE |
private static int |
JBOSS_VFSFILE_OFFSET |
private static java.lang.String |
JBOSS_VFSZIP |
private static int |
JBOSS_VFSZIP_OFFSET |
private static java.lang.String |
JBOSS_WAR |
private static javax.management.MBeanServer |
jbossMBeanServer |
private static java.lang.String |
OC4J_CLASSLOADER_NAME |
private java.util.Map<java.lang.String,java.lang.Object> |
properties |
protected TypeHelper |
typeHelper |
private static java.util.WeakHashMap<java.lang.ClassLoader,java.util.WeakHashMap<java.lang.String,java.lang.ref.WeakReference<HelperContext>>> |
userSetHelperContexts |
private static java.lang.String |
WAS_APP_COLON |
private static java.lang.String |
WAS_CLASSLOADER_NAME |
private static java.lang.String |
WAS_CLOSE_BRACKET |
private static java.lang.String |
WAS_NEWLINE |
private static java.lang.String |
WLS_ACTIVE_VERSION_STATE |
private static java.lang.String |
WLS_APP_RUNTIMES |
private static java.lang.String |
WLS_APPLICATION_NAME |
private static java.lang.String |
WLS_APPLICATION_NAME_GET_METHOD_NAME |
private static java.lang.String |
WLS_CLASSLOADER_NAME |
private static java.lang.String |
WLS_CONTEXT_LOOKUP |
private static java.lang.String |
WLS_ENV_CONTEXT_LOOKUP |
private static java.lang.String |
WLS_EXECUTE_THREAD |
private static java.lang.String |
WLS_EXECUTE_THREAD_GET_METHOD_NAME |
private static int |
WLS_IDENTIFIER |
private static java.lang.String |
WLS_MBEAN_SERVER |
private static java.lang.Class[] |
WLS_PARAMETER_TYPES |
private static java.lang.String |
WLS_RUNTIME_SERVICE |
private static java.lang.String |
WLS_SERVER_RUNTIME |
private static java.lang.String |
WLS_SERVICE_KEY |
private static java.lang.String |
WLS_THREADPOOL_RUNTIME |
private static javax.management.MBeanServer |
wlsMBeanServer |
private static javax.management.ObjectName |
wlsThreadPoolRuntime |
protected XMLHelper |
xmlHelper |
protected XSDHelper |
xsdHelper |
Constructor Summary | |
---|---|
SDOHelperContext() Create a local HelperContext. |
|
SDOHelperContext(java.lang.ClassLoader aClassLoader) Create a local HelperContext. |
|
SDOHelperContext(java.lang.String identifier) Create a local HelperContext with the given identifier. |
|
SDOHelperContext(java.lang.String identifier, java.lang.ClassLoader aClassLoader) Create a local HelperContext with the given identifier. |
Method Summary | |
---|---|
static void |
addAlias(java.lang.String identifier, java.lang.String alias) Add an alias to identifier pair to the alias Map for the current application. |
private static void |
addJBossNotificationListener() INTERNAL: The listener will handle application re-deployment. |
private static void |
addWLSNotificationListener(java.lang.String applicationName) INTERNAL: Adds a notification listener to the ApplicationRuntimeMBean instance with "ApplicationName" attribute equals to 'mapKey.applicationName'. |
ExternalizableDelegator.Resolvable |
createResolvable() Create and return a new ExternalizableDelegator.Resolvable instance based on this helper context. |
ExternalizableDelegator.Resolvable |
createResolvable(java.lang.Object target) Create and return a new ExternalizableDelegator.Resolvable instance based on this helper context and a given target. |
private static java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.String> |
getAliasMap() INTERNAL: Returns the map of alias' to identifiers for the current application. |
private static java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.String> |
getAliasMap(java.lang.Object mapKey) INTERNAL: Returns the map of alias' to identifiers for the current application. |
private static java.lang.String |
getApplicationNameFromJBossClassLoader(java.lang.String loaderToString) Attempt to get the application name (archive file name) based on a given JBoss classloader. |
private static java.lang.String |
getApplicationNameFromWASClassLoader(java.lang.ClassLoader loader) Attempt to return the WAS application name based on a given class loader. |
(package private) static java.util.concurrent.ConcurrentMap<java.lang.String,HelperContext> |
getContextMap() Returns the map of helper contexts, keyed on Identifier, for the current application |
private static MapKeyLookupResult |
getContextMapKey(java.lang.ClassLoader classLoader, java.lang.String classLoaderName) INTERNAL: This method will return the MapKeyLookupResult instance to be used to store/retrieve the global helper context for a given application. |
private static MapKeyLookupResult |
getContextMapKeyForJBoss(java.lang.ClassLoader loader) Attempt to return a MapKeyLookupResult instance wrapping the archive file name and application loader based on a given JBoss classloader. |
private static MapKeyLookupResult |
getContextMapKeyForWAS(java.lang.ClassLoader loader) Attempt to return a MapKeyLookupResult instance wrapping the application name and application loader based on a given WAS classloader. |
CopyHelper |
getCopyHelper() Return the CopyHelper instance for this helper context. |
DataFactory |
getDataFactory() Return the DataFactory instance for this helper context. |
DataHelper |
getDataHelper() Return the DataHelper instance for this helper context. |
EqualityHelper |
getEqualityHelper() Return the EqualityHelper instance for this helper context. |
private static java.lang.Object |
getExecuteThread() INTERNAL: This convenience method will look up a WebLogic execute thread from the runtime MBean tree. |
static HelperContext |
getHelperContext() INTERNAL: Return the helper context for a given key. |
static HelperContext |
getHelperContext(java.lang.String identifier) Return the local helper context associated with the given identifier, or create one if it does not already exist. |
static HelperContext |
getHelperContext(java.lang.String identifier, java.lang.ClassLoader classLoader) Return the local helper context with the given identifier, or create one if it does not already exist. |
java.lang.String |
getIdentifier() Return the unique label for this HelperContext. |
private static java.lang.Object |
getMapKey() INTERNAL: Return the key to be used for Map lookups based in the current thread's context loader. |
private java.util.Map<java.lang.String,java.lang.Object> |
getProperties() Lazily initialize the Map of user properties. |
java.lang.Object |
getProperty(java.lang.String name) Return the value stored in the properties Map for a given name, or null if an entry for name does not exist. |
TypeHelper |
getTypeHelper() Return the TypeHelper instance for this helper context. |
private static HelperContext |
getUserSetHelperContext(java.lang.String identifier, java.lang.ClassLoader key) INTERNAL: Retrieve the HelperContext for a given ClassLoader from the Thread HelperContext map. |
private static javax.management.MBeanServer |
getWLSMBeanServer() Lazy load the WebLogic MBeanServer instance. |
XMLHelper |
getXMLHelper() Return the XMLHelper instance for this helper context. |
XSDHelper |
getXSDHelper() Return the XSDHelper instance for this helper context. |
static boolean |
hasHelperContext(java.lang.String identifier) Return true if a HelperContext corresponding to this identifier or alias already exists, else false. |
protected void |
initialize(java.lang.ClassLoader aClassLoader) The underlying helpers for this instance will be instantiated in this method. |
static boolean |
isApplicationResolverSet() Indicates if a call to setApplicationResolver has been made. |
private static boolean |
jBossClassLoaderHasArchiveFileInfo(java.lang.ClassLoader loader) Indicates if a given JBoss class loader contains an archive file name; i.e. is an application loader. |
void |
makeDefaultContext() ADVANCED Promote this helper context to be the default or global one. |
static void |
putHelperContext(java.lang.ClassLoader key, HelperContext value) INTERNAL: Put a ClassLoader/HelperContext key/value pair in the Thread HelperContext map. |
static void |
putHelperContext(HelperContext ctx) Replaces the provided helper context in the map of identifiers to helper contexts for this application. ctx.getIdentifier() will be used to obtain the identifier value. |
static void |
removeHelperContext(java.lang.ClassLoader key) INTERNAL: Remove a ClassLoader/HelperContext key/value pair from the Thread HelperContext map. |
static void |
removeHelperContext(java.lang.String identifier, java.lang.ClassLoader key) INTERNAL |
void |
reset() Reset the Type,XML and XSD helper instances. |
private static void |
resetHelperContext(java.lang.String key) ADVANCED: Remove the HelperContext for the application associated with a given key, if it exists in the map. |
static void |
setApplicationResolver(ApplicationResolver aResolver) ADVANCED: Used to set an ApplicationResolver instance that will be used to retrieve info pertaining to a given application, such as the application name, in the case where our logic fails. |
void |
setProperty(java.lang.String name, java.lang.Object value) Add a name/value pair to the properties Map. |
private static boolean |
wasClassLoaderHasApplicationName(java.lang.ClassLoader loader) Indicates if a given WAS class loader contains a application name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected CopyHelper copyHelper
protected DataFactory dataFactory
protected DataHelper dataHelper
protected EqualityHelper equalityHelper
protected XMLHelper xmlHelper
protected TypeHelper typeHelper
protected XSDHelper xsdHelper
private java.lang.String identifier
private java.util.Map<java.lang.String,java.lang.Object> properties
private static java.util.concurrent.ConcurrentHashMap<java.lang.Object,java.util.concurrent.ConcurrentHashMap<java.lang.String,HelperContext>> helperContexts
private static java.util.concurrent.ConcurrentHashMap<java.lang.Object,java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.String>> aliasMap
private static java.util.WeakHashMap<java.lang.ClassLoader,java.util.WeakHashMap<java.lang.String,java.lang.ref.WeakReference<HelperContext>>> userSetHelperContexts
private static java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.ClassLoader> appNameToClassLoaderMap
private static java.lang.String OC4J_CLASSLOADER_NAME
private static java.lang.String WLS_CLASSLOADER_NAME
private static java.lang.String WAS_CLASSLOADER_NAME
private static java.lang.String JBOSS_CLASSLOADER_NAME
private static java.lang.String GLOBAL_HELPER_IDENTIFIER
private static final int WLS_IDENTIFIER
private static final int JBOSS_IDENTIFIER
private static final int COUNTER_LIMIT
private static SDOHelperContext.ApplicationAccessWLS applicationAccessWLS
private static javax.management.MBeanServer wlsMBeanServer
private static javax.management.ObjectName wlsThreadPoolRuntime
private static final java.lang.String WLS_ENV_CONTEXT_LOOKUP
private static final java.lang.String WLS_CONTEXT_LOOKUP
private static final java.lang.String WLS_RUNTIME_SERVICE
private static final java.lang.String WLS_SERVICE_KEY
private static final java.lang.String WLS_APP_RUNTIMES
private static final java.lang.String WLS_SERVER_RUNTIME
private static final java.lang.String WLS_THREADPOOL_RUNTIME
private static final java.lang.String WLS_EXECUTE_THREAD
private static final java.lang.String WLS_MBEAN_SERVER
private static final java.lang.String WLS_EXECUTE_THREAD_GET_METHOD_NAME
private static final java.lang.String WLS_APPLICATION_NAME
private static final java.lang.String WLS_APPLICATION_NAME_GET_METHOD_NAME
private static final java.lang.String WLS_ACTIVE_VERSION_STATE
private static final java.lang.Class[] WLS_PARAMETER_TYPES
private static final java.lang.String WAS_NEWLINE
private static final java.lang.String WAS_APP_COLON
private static final java.lang.String WAS_CLOSE_BRACKET
private static javax.management.MBeanServer jbossMBeanServer
private static java.lang.String JBOSS_SERVICE_CONTROLLER
private static java.lang.String JBOSS_TYPE_STOP
private static java.lang.String JBOSS_ID_KEY
private static final java.lang.String JBOSS_DEFAULT_DOMAIN_NAME
private static final java.lang.String JBOSS_VFSZIP
private static final java.lang.String JBOSS_VFSFILE
private static final java.lang.String JBOSS_EAR
private static final java.lang.String JBOSS_JAR
private static final java.lang.String JBOSS_WAR
private static final int JBOSS_VFSZIP_OFFSET
private static final int JBOSS_VFSFILE_OFFSET
private static final int JBOSS_EAR_OFFSET
private static final int JBOSS_TRIM_COUNT
private static ApplicationResolver appResolver
private static boolean isAppResolverSet
Constructor Detail |
---|
public SDOHelperContext()
public SDOHelperContext(java.lang.String identifier)
identifier
- The unique label for this HelperContext.public SDOHelperContext(java.lang.ClassLoader aClassLoader)
aClassLoader
- This class loader will be used to find static instance classes.public SDOHelperContext(java.lang.String identifier, java.lang.ClassLoader aClassLoader)
identifier
- The unique label for this HelperContext.aClassLoader
- This class loader will be used to find static instance classes.Method Detail |
---|
public static void setApplicationResolver(ApplicationResolver aResolver)
aResolver
- the ApplicationResolver instance that will be used to retrieve info pertaining to a given application. Note that null is considered a valid set operation.SDOException
- if more than one call is made to this method in an active server instance.public static boolean isApplicationResolverSet()
protected void initialize(java.lang.ClassLoader aClassLoader)
aClassLoader
-public void reset()
public CopyHelper getCopyHelper()
public DataFactory getDataFactory()
public DataHelper getDataHelper()
public EqualityHelper getEqualityHelper()
public TypeHelper getTypeHelper()
public XMLHelper getXMLHelper()
public XSDHelper getXSDHelper()
public ExternalizableDelegator.Resolvable createResolvable()
public ExternalizableDelegator.Resolvable createResolvable(java.lang.Object target)
target
-public static void putHelperContext(java.lang.ClassLoader key, HelperContext value)
key
- class loadervalue
- helper contextprivate static HelperContext getUserSetHelperContext(java.lang.String identifier, java.lang.ClassLoader key)
key
- class loaderpublic static void removeHelperContext(java.lang.ClassLoader key)
key
- class loaderpublic static void removeHelperContext(java.lang.String identifier, java.lang.ClassLoader key)
identifier
- the specific identifier of the HelperContext to be removed. "" for a Global helperkey
- the ClassLoader associated with the HelperContext to be removedpublic static HelperContext getHelperContext()
public static HelperContext getHelperContext(java.lang.String identifier)
identifier
- the identifier or alias to use for lookup/creationpublic static HelperContext getHelperContext(java.lang.String identifier, java.lang.ClassLoader classLoader)
static java.util.concurrent.ConcurrentMap<java.lang.String,HelperContext> getContextMap()
public static void putHelperContext(HelperContext ctx)
ctx
- the HelperContext to be added to the context Map for the current applicationprivate static void resetHelperContext(java.lang.String key)
private static java.lang.Object getMapKey()
private static MapKeyLookupResult getContextMapKey(java.lang.ClassLoader classLoader, java.lang.String classLoaderName)
private static javax.management.MBeanServer getWLSMBeanServer()
private static java.lang.Object getExecuteThread()
private static void addWLSNotificationListener(java.lang.String applicationName)
applicationName
-private static void addJBossNotificationListener()
public void makeDefaultContext()
private static java.lang.String getApplicationNameFromWASClassLoader(java.lang.ClassLoader loader)
loader
-private static MapKeyLookupResult getContextMapKeyForWAS(java.lang.ClassLoader loader)
loader
-private static boolean wasClassLoaderHasApplicationName(java.lang.ClassLoader loader)
loader
-private static java.lang.String getApplicationNameFromJBossClassLoader(java.lang.String loaderToString)
loaderToString
- the toString of the loader being processedprivate static MapKeyLookupResult getContextMapKeyForJBoss(java.lang.ClassLoader loader)
loader
-private static boolean jBossClassLoaderHasArchiveFileInfo(java.lang.ClassLoader loader)
loader
-public java.lang.String getIdentifier()
public static boolean hasHelperContext(java.lang.String identifier)
identifier
- the alias or identifier used to lookup a helper contextpublic static void addAlias(java.lang.String identifier, java.lang.String alias)
identifier
- assumed to be a key in the helper context Mapalias
- the alias to be associated with identifierprivate static java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.String> getAliasMap()
private static java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.String> getAliasMap(java.lang.Object mapKey)
mapKey
- application name or classloader used to lookup the alias mapprivate java.util.Map<java.lang.String,java.lang.Object> getProperties()
public void setProperty(java.lang.String name, java.lang.Object value)
name
- the name of the propertyvalue
- the value of the propertypublic java.lang.Object getProperty(java.lang.String name)
name
- the name of the property to be returned
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |