How should I implement the OSGi console into a Bundle?

强颜欢笑 提交于 2019-12-06 09:14:59

Take a look at the class org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider in bundle org.eclipse.osgi to see how the commands are implemented

Adding to what Tom said, this link might come in handy: http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/console/src/org/eclipse/osgi/framework/internal/core/FrameworkCommandProvider.java?view=markup&root=RT_Project.

I remember that it took me quite a while to find this class last time I needed to look into it. It might not be the newest version (I didn't check this), but it should be enough to give you a jump start. The CVS repository path btw is "/cvsroot/rt" on "dev.eclipse.org", module "org.eclipse.equinox/framework/bundles/org.eclipse.osgi".

Sorry for not adding this as a comment to Toms answer, but I do not have the permissions to do so it seems.

you can checke the org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider class and org.eclipse.core.runtime.internal.adaptor.EclipseCommandProvider class , you will see the command implement. and every Command can access by services with " (classobject=org.eclipse.osgi.framework.console.CommandProvider)" filter.

Use the OSGi Framework API, from the org.osgi.framework package. This is the API that the console itself invokes in order to implement those commands.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!