public final class JCOBridge extends JCHandler
JCOBridge class represents the main entry point to interact with
CLR context.
Some examples on its use are on https://github.com/masesgroup/JCOReflector
| Modifier and Type | Method and Description |
|---|---|
void |
AddPath(String path)
Adds a path where the wrapper searches for CLR assemblies
|
JCAssembly |
AddReference(String assemblyName)
Adds a reference to a CLR assembly
|
static IJCGraphicContainer |
CreateContainer(Component comp)
Returns a reference to a newly created
IJCGraphicContainer instance |
static IJCGraphicContainer |
CreateContainer(String className)
Returns a reference to a newly created
IJCGraphicContainer instance |
static JCOBridge |
CreateNew()
Create a new instance of
JCOBridge . |
static Object |
GetCLRGlobal(String key)
Get previously registered CLR global
Object. |
static String |
getCLRRID()
This method is used to get the Rid to use.
|
JCControl |
GetControl(String type)
Returns an instance of
JCControl which reference a graphical CLR
Object |
static Boolean |
getCoreCLREnableDesktop()
This method is used to get if Desktop features are requested.
|
static String |
getCoreCLRVersion()
This method is used to get the framework to be used: valid values are 8
(Default) and 9.
|
JCEnum |
GetEnum(String type)
Returns a reference to a CLR Enum
|
static String[] |
getFilteredArgs()
This method is used to get the arguments from command-line filtered from the
arguments related to JCOBridge
|
static boolean |
getGlobalize()
This method is used to get the Globalize value.
|
JCJControl |
GetJControl(String type)
Returns an instance of
JCJControl which reference a graphical CLR
Object |
static Object |
GetJVMGlobal(String key)
Get previously registered JVM global
Object. |
static String |
getLicensePath()
This method is used to get the path where is located the JCOBridge license.
|
static String |
getNativePath()
This method is used to get the path where to load JCOBridge runtime library.
|
static String |
getScopeOn()
This method is used to get the ScopeOn value.
|
static String |
getScopeOnVersion()
This method is used to get the ScopeOn Version value.
|
JCType |
GetType(String type)
Returns a reference to a CLR Type
|
static void |
Initialize()
Initialize the library for .NET with default parameters.
|
static void |
Initialize(String[] args)
Initialize the library for .NET.
|
static void |
InitializeFromRemote(String licencePath,
boolean globalize)
Initialize the library from CLR.
|
static boolean |
isCLRHostingProcess()
This method is used to get information about the hosting process.
|
static void |
Load()
This method is used to loads the CLR/JVM Wrapper library.
|
static void |
LoadWrapper(String libraryName)
This method is used to loads the CLR/JVM Wrapper library.
|
Object |
NewObject(JCType type,
Object... params)
Returns a reference to a newly created CLR Object
|
Object |
NewObject(String type,
Object... params)
Returns a reference to a newly created CLR Object
|
void |
RegisterEventLog(IJCEventLog logger)
Register an instance of
IJCEventLog for debug logging purpose. |
static void |
RegisterJVMGlobal(String key,
Object obj)
Register the object into the global JVM mapper.
|
static void |
setCLRRID(String rid)
This method is used to set the Rid to use.
|
static void |
setCoreCLREnableDesktop(Boolean value)
This method is used to set if Desktop features are requested.
|
static void |
setCoreCLRVersion(String clrApp)
This method is used to set the framework to be used: valid values are 8
(Default) and 9.
|
static void |
setGlobalize(boolean globalize)
This method is used to set the Globalize value.
|
static void |
setLicensePath(String path)
This method is used to set the path where is located the JCOBridge license.
|
static void |
setNativePath(String path)
This method is used to set the path where to load JCOBridge runtime library.
|
static void |
setScopeOn(String value)
This method is used to set the ScopeOn value.
|
static void |
setScopeOnVersion(String value)
This method is used to set the ScopeOn Version value.
|
static void |
SetWrapperPath(String path)
This method is used to set the path where is located the CLR/JVM Wrapper
library.
|
static void |
UnregisterJVMGlobal(String key)
Unregister the object from the global JVM mapper.
|
getReferencepublic static String[] getFilteredArgs()
public static String getNativePath()
public static void setNativePath(String path)
path - The path to use to load JCOBridge runtime.public static String getLicensePath()
public static void setLicensePath(String path)
path - The path where is located the JCOBridge license.public static String getCLRRID()
public static void setCLRRID(String rid)
rid - The Rid to use. Searched autmatically, using some system infos.
Set it to override searched value.public static String getCoreCLRVersion()
public static void setCoreCLRVersion(String clrApp)
clrApp - The framework to be used: valid values are 8 (Default) and 9.public static Boolean getCoreCLREnableDesktop()
public static void setCoreCLREnableDesktop(Boolean value)
value - true if Desktop features are requested.public static String getScopeOn()
public static void setScopeOn(String value)
value - the ScopeOn value.public static String getScopeOnVersion()
public static void setScopeOnVersion(String value)
value - the ScopeOn Version value.public static boolean getGlobalize()
public static void setGlobalize(boolean globalize)
globalize - Set to false to do not globalize the .NET core instance.public static boolean isCLRHostingProcess()
public static void SetWrapperPath(String path)
Note: Do not use directly.
path - The path to use to search the CLR/JVM Wrapper library. It can be
absolute or relative.public static void Load()
throws IOException
Note: Do not use directly.
IOException - in case of errorpublic static void LoadWrapper(String libraryName) throws IOException
Note: Do not use directly.
libraryName - The name of the native wrapper library to loadIOException - in case of errorpublic static void Initialize()
throws JCNativeException,
JCException,
IOException
Parameters can be set into the environment variable named
JCOBRIDGE_JVM_SETTINGS within a string.
Each parameter shall be separated by && in the following
form:
PARAM1&&PARAM2&&PARAM3
JCNativeException - If something happens within CLR contextJCException - Something happened at library levelIOException - If something happens with filesystempublic static void Initialize(String[] args) throws IOException, JCException
Parameters can be set into the environment variable named
JCOBRIDGE_JVM_SETTINGS within a string.
Each parameter shall be separated by && in the following
form:
PARAM1&&PARAM2&&PARAM3
args - Arguments from command lineIOException - If something happens with filesystemJCException - Something happended during initializationpublic static void InitializeFromRemote(String licencePath, boolean globalize) throws JCNativeException, IOException
Note: Do not use directly.
licencePath - The path to the license fileglobalize - The globalize valueJCNativeException - if something happens within CLR contextIOException - if something happens with filesystempublic static JCOBridge CreateNew() throws JCNativeException
JCOBridge .JCOBridgeJCNativeException - if something happens within CLR contextpublic static void RegisterJVMGlobal(String key, Object obj) throws JCNativeException
key - The key to identify the registered Objectobj - The Object to registerJCNativeException - if something happens within CLR contextpublic static void UnregisterJVMGlobal(String key) throws JCNativeException
key - The key to identify the registered ObjectJCNativeException - if something happens within CLR contextpublic static Object GetJVMGlobal(String key) throws JCNativeException
Object.key - The key to use to get back the object from JVM global contextObjectJCNativeException - if something happens within CLR contextpublic static Object GetCLRGlobal(String key) throws JCNativeException
Object.key - The key to use to get back the object from CLR global contextObjectJCNativeException - if something happens within CLR contextpublic static IJCGraphicContainer CreateContainer(Component comp)
IJCGraphicContainer instancecomp - The Component to be integrated into UIIJCGraphicContainerpublic static IJCGraphicContainer CreateContainer(String className) throws InstantiationException, IllegalAccessException, ClassNotFoundException, JCException
IJCGraphicContainer instanceclassName - The class name of the object to be integrated into UI or a
class implementing IJCGraphicContainerIJCGraphicContainerIllegalAccessException - if the class or its nullary constructor is not
accessible.InstantiationException - if this Class represents an abstract
class, an interface, an array class, a
primitive type, or void; or if the class has
no nullary constructor; or if the
instantiation fails for some other reason.ClassNotFoundException - if the class cannot be locatedJCException - if the the parameter is not valid to build an
instance of IJCGraphicContainerpublic void RegisterEventLog(IJCEventLog logger) throws JCNativeException
IJCEventLog for debug logging purpose.logger - The IJCEventLog instanceJCNativeException - if something happens within CLR contextpublic void AddPath(String path) throws JCNativeException
path - The path to addJCNativeException - if something happens within CLR contextpublic JCAssembly AddReference(String assemblyName) throws JCNativeException
assemblyName - The assembly to referenceJCAssembly instance to the newly referenced CLR AssemblyJCNativeException - if something happens within CLR contextpublic JCType GetType(String type) throws JCNativeException
type - The type to searchJCType instance to the newly referenced CLR TypeJCNativeException - if something happens within CLR contextpublic JCEnum GetEnum(String type) throws JCNativeException
type - The enum type to searchJCEnum instance to the newly referenced CLR EnumJCNativeException - if something happens within CLR contextpublic JCControl GetControl(String type) throws JCNativeException
JCControl which reference a graphical CLR
Objecttype - The graphical CLR Object to searchJCControl instance to the newly referenced graphical CLR
ObjectJCNativeException - if something happens within CLR contextpublic JCJControl GetJControl(String type) throws JCNativeException
JCJControl which reference a graphical CLR
Objecttype - The graphical CLR Object to searchJCJControl instance to the newly referenced graphical CLR
ObjectJCNativeException - if something happens within CLR contextpublic Object NewObject(String type, Object... params) throws JCNativeException
type - The type of the object to createparams - Optional parameters to use in CLR object instantiationJCObject for all other typesJCNativeException - if something happens within CLR contextpublic Object NewObject(JCType type, Object... params) throws JCNativeException
type - The JCType of the object to createparams - Optional parameters to use in CLR object instantiationJCObject for all other typesJCNativeException - if something happens within CLR context