arrow_back history picture_as_pdf This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ~~NOTRANS~~ ~~Title: Object Injection~~ 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> public interface IInjectObject { public String getDefaultName(); public void init(ISession pSession); } </file> To inject the object, simply put the configuration in config.xml: The injection is <file xml> <?xml version="1.0" encoding="UTF-8"?> <application> ... <!-- inject in every LCO --> <inject class="com.package.app.MyClass" name="myClass"/> <!-- inject in specific LCO --> <inject ...> <allow instanceof="com.sibvisions.rad.server.MasterSession"/> <allow lifecyclename="com.package.app.screen.User"/> </inject> </application> </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: <file bash> com.package.app.MyInjectObject </file> Be sure that MyInjectObject **implements IInjectObject.**