Documentation

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
jvx:server:lco:inject_objects [2019/12/20 14:54]
admin created
jvx:server:lco:inject_objects [2020/06/26 12:53] (current)
cduncan
Line 1: Line 1:
 ~~NOTRANS~~ ~~NOTRANS~~
-~~Title: Object ​injection~~ +~~Title: Object ​Injection~~ 
-Sometimes ​it's important to add external objects in your running applicationwithout additional coding. We have an injection mechanism which is pretty simple. It's possible to inject custom Java objects or objects which implements the interface **IInjectObject**. The difference is that simple objects don't use an init method:+Occasionally, ​it's important to add external objects in your running application without additional coding. We have an injection mechanism which is pretty simple. It's possible to inject custom Java objects or objects which implements the interface **IInjectObject**. The difference is that simple objects don't use an init method:
  
 <file java> <file java>
Line 30: Line 30:
 </​file>​ </​file>​
  
-It's also possible to inject by ServiceLoader. Simply create a file with the name **com.sibvisions.rad.server.IInjectObject** in META-INF/​services,​ in your classpath. The file should contain one line per object:+It's also possible to inject by ServiceLoader. Simply create a file with the name **com.sibvisions.rad.server.IInjectObject** in **META-INF/​services**, in your classpath. The file should contain one line per object:
  
-<​file>​+<​file ​bash>
 com.package.app.MyInjectObject com.package.app.MyInjectObject
 </​file>​ </​file>​
  
-Be sure that MyInjectObject implements IInjectObject.+Be sure that MyInjectObject ​**implements IInjectObject.**
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information