|
|
Accessing your own Java classesYou can access your own Java classes from inside the Metamerge Integrator framework, as long as it contains public classes and methods. These libraries must be packaged into a .jar (or .zip) files and should be placed in your own subdirectory of the Metamerge jars directory: Metamerge Integrator will find them there. (You can also use the the CLASSPATH environment variable or the Java runtime environment extension folder, but both these methods are discouraged. These methods will only let you call Metamerge classes from within your own classes if the loader happened to have loaded the Metamerge classes before your own). If you are running the Server from the Admin Tool, you will have to restart the Admin Tool before it knows about new classes in the jars directory (and subdirectories). After having put the jar-files in the jars/ subdirectory, you need to assign a name to an instance of the class so you can refer to it from within the Integrator. The easiest way (classes with a default constructor)Use the Java Libraries tab under the Configuration of the Admin Tool. This will only work if your class has a default constructor (a constructor that does not take arguments). When adding a library, you must specify two parameters: the script object name (the name of the scripting object which will be an instance of your java class) and the java class name. For example, you could have a Script Object Name being "mycls" while the Java Class would be my.java.classname. The mycls object would be available wherever the system object is available, as the system object is really an instance of the com.architech.function.userFunctions2 java class. Classes without default constructor or that you want to instantiate yourself.In case you do not want to use the Java libraries tab (because you want to instantiate your class at a specific point of execution or your class does not have a default constructor) 1Scripting in Javascript1.1 Using a standard class (e.g which name starts with "java.")Assuming you want to use the standard java.io.FileReader
1.2 Using non-standard classes (e.g a user class)
2 Scripting in languages without new java.*
|
|
|