@Generated(value="org.jomc.tools.SourceFileProcessor 1.5", comments="See http://www.jomc.org/jomc/1.5/jomc-tools-1.5") public class RuntimeInstance extends Instance implements RuntimeModelObject
Instance
.
any, clazz, dependencies, identifier, messages, name, properties, specifications, stateless
authors, createDate, deprecated, documentation, MODEL_PUBLIC_ID, modelVersion
Constructor and Description |
---|
RuntimeInstance()
Creates a new
RuntimeInstance instance. |
RuntimeInstance(Instance instance)
Creates a new
RuntimeInstance instance by deeply copying a given Instance instance. |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears shared runtime state.
|
void |
gc()
Handles shared runtime state.
|
Class<?> |
getJavaClass(ClassLoader classLoader)
Gets the Java class of the instance for a given class loader.
|
Class<?>[] |
getJavaClasses(ClassLoader classLoader)
Gets the Java classes of all specifications of the instance for a given class loader.
|
Constructor<?> |
getJavaConstructor(ClassLoader classLoader)
Gets the Java constructor to use for creating objects of the instance.
|
Method |
getJavaFactoryMethod(ClassLoader classLoader)
Gets the Java method to use for creating objects of the instance.
|
String |
getJavaFactoryMethodName()
Gets the name of the Java method to use for creating objects of the instance.
|
Class<?> |
getJavaProxyClass(ClassLoader classLoader)
Gets the Java proxy class for a given class loader.
|
JavaTypeName |
getJavaTypeName()
Gets the Java type name of the type referenced by the instance.
|
boolean |
isJavaClassAssignable(ClassLoader classLoader)
Gets a flag indicating the Java class of the instance is assignable to all Java classes of all specifications of
the instance.
|
clone, getAny, getAnyElement, getAnyElement, getAnyElements, getAnyElements, getAnyObject, getAnyObjects, getClazz, getDependencies, getDependencyObjects, getIdentifier, getMessageObjects, getMessages, getName, getProperties, getPropertyObjects, getSpecifications, isStateless, setClazz, setDependencies, setIdentifier, setMessages, setName, setProperties, setSpecifications, setStateless
getAnyElement, getAnyElement, getAnyElements, getAnyElements, getAnyObject, getAnyObjects, getAuthors, getCreateDate, getDocumentation, getModelVersion, isDeprecated, setAuthors, setCreateDate, setDeprecated, setDocumentation, setModelVersion
public RuntimeInstance(Instance instance)
RuntimeInstance
instance by deeply copying a given Instance
instance.instance
- The instance to copy.NullPointerException
- if instance
is null
.@Generated(value="org.jomc.tools.SourceFileProcessor 1.5", comments="See http://www.jomc.org/jomc/1.5/jomc-tools-1.5") public RuntimeInstance()
RuntimeInstance
instance.public Class<?> getJavaClass(ClassLoader classLoader) throws ModelObjectException, ClassNotFoundException
This method queries an internal cache for a result object to return for the given argument values. If no cached result object is available, this method queries the super-class for a result object to return and caches the outcome of that query for use on successive calls.
Note:
Method RuntimeModelObjects.clear()
must be used to synchronize the state of the
internal cache with the state of the class loader, should the state of the class loader change.
getJavaClass
in class Instance
classLoader
- The class loader to get the Java class from or null
, to get the Java class from the
platform's bootstrap class loader.ClassNotFoundException
- if the Java class is not found.ModelObjectException
- if parsing the name of the referenced type fails.Instance.getClazz()
,
RuntimeModelObjects.clear()
public Class<?>[] getJavaClasses(ClassLoader classLoader) throws ModelObjectException, ClassNotFoundException
This method queries an internal cache for a result object to return for the given argument values. If no cached result object is available, this method queries the super-class for a result object to return and caches the outcome of that query for use on successive calls.
Note:
Method RuntimeModelObjects.clear()
must be used to synchronize the state of the
internal cache with the state of the instance and class loader, should the state of the instance or class loader
change.
getJavaClasses
in class Instance
classLoader
- The class loader to get the Java classes from or null
, to get the Java classes from
the platform's bootstrap class loader.ClassNotFoundException
- if a Java class is not found.ModelObjectException
- if parsing a name of a referenced type fails.Instance.getSpecifications()
,
Specification.getClazz()
,
RuntimeModelObjects.clear()
public Constructor<?> getJavaConstructor(ClassLoader classLoader) throws ModelObjectException, ClassNotFoundException
This method queries an internal cache for a result object to return for the given argument values. If no cached result object is available, this method queries the super-class for a result object to return and caches the outcome of that query for use on successive calls.
Note:
Method RuntimeModelObjects.clear()
must be used to synchronize the state of the
internal cache with the state of the instance and class loader, should the state of the instance or class loader
change.
getJavaConstructor
in class Instance
classLoader
- The class loader to get the Java class from or null
, to get the Java class from the
platform's bootstrap class loader.null
, if that class
does not declare such a constructor, is abstract or is not public.ClassNotFoundException
- if the Java class is not found.ModelObjectException
- if parsing the name of the type referenced by the instance fails.getJavaClass(java.lang.ClassLoader)
,
RuntimeModelObjects.clear()
public String getJavaFactoryMethodName() throws ModelObjectException
This method queries an internal cache for a result object to return. If no cached result object is available, this method queries the super-class for a result object to return and caches the outcome of that query for use on successive calls.
Note:
Method clear()
must be used to synchronize the state of the internal cache with the
state of the instance, should the state of the instance change.
getJavaFactoryMethodName
in class Instance
null
, if no such
method name is supported.ModelObjectException
- if compiling the name of the instance to a JavaIdentifier
fails.Instance.getName()
,
clear()
public Method getJavaFactoryMethod(ClassLoader classLoader) throws ModelObjectException, ClassNotFoundException
This method queries an internal cache for a result object to return for the given argument values. If no cached result object is available, this method queries the super-class for a result object to return and caches the outcome of that query for use on successive calls.
Note:
Method RuntimeModelObjects.clear()
must be used to synchronize the state of the
internal cache with the state of the instance and class loader, should the state of the instance or class loader
change.
getJavaFactoryMethod
in class Instance
classLoader
- The class loader to get the Java class from or null
, to get the Java class from the
platform's bootstrap class loader.null
, if that class does not declare such a method.ClassNotFoundException
- if the Java class is not found.ModelObjectException
- if parsing the name of the type referenced by the instance fails.getJavaClass(java.lang.ClassLoader)
,
getJavaFactoryMethodName()
,
RuntimeModelObjects.clear()
public boolean isJavaClassAssignable(ClassLoader classLoader) throws ModelObjectException, ClassNotFoundException
This method queries an internal cache for a result object to return for the given argument values. If no cached result object is available, this method queries the super-class for a result object to return and caches the outcome of that query for use on successive calls.
Note:
Method RuntimeModelObjects.clear()
must be used to synchronize the state of the
internal cache with the state of the instance and class loader, should the state of the instance or class loader
change.
isJavaClassAssignable
in class Instance
classLoader
- The class loader to get the Java classes from or null
, to get the Java classes from
the platform's bootstrap class loader.true
, if the Java class of the instance is assignable to all Java classes of all specifications
of the instance; false
, if the Java class of the instance is not assignable to all Java classes of all
specifications of the instance.ClassNotFoundException
- if a Java class is not found.ModelObjectException
- if parsing a name of a referenced type fails.getJavaClass(java.lang.ClassLoader)
,
getJavaClasses(java.lang.ClassLoader)
,
RuntimeModelObjects.clear()
public Class<?> getJavaProxyClass(ClassLoader classLoader) throws ModelObjectException, ClassNotFoundException
This method queries an internal cache for a result object to return for the given argument values. If no cached result object is available, this method queries the super-class for a result object to return and caches the outcome of that query for use on successive calls.
Note:
Method RuntimeModelObjects.clear()
must be used to synchronize the state of the
internal cache with the state of the instance and class loader, should the state of the instance or class loader
change.
getJavaProxyClass
in class Instance
classLoader
- The class loader to get the Java proxy class for.classLoader
or null
, if the instance does not support a Java
proxy class.ClassNotFoundException
- if a Java class is not found.ModelObjectException
- if parsing a name of a referenced type fails.getJavaClasses(java.lang.ClassLoader)
,
RuntimeModelObjects.clear()
public JavaTypeName getJavaTypeName() throws ModelObjectException
This method queries an internal cache for a result object to return. If no cached result object is available, this method queries the super-class for a result object to return and caches the outcome of that query for use on successive calls.
Note:
Method clear()
must be used to synchronize the state of the internal cache with the
state of the instance, should the state of the instance change.
getJavaTypeName
in class Instance
null
, if the instance does not
reference a type.ModelObjectException
- if compiling the name of the referenced type to a JavaTypeName
fails.Instance.getJavaTypeName()
,
clear()
public void gc()
RuntimeModelObject
gc
in interface RuntimeModelObject
public void clear()
RuntimeModelObject
clear
in interface RuntimeModelObject
Copyright © 2005-2013 The JOMC Project. All Rights Reserved.