Adding Multiple Initial Context Factories
You can add multiple initial context factories in the newly created plug-in project.
Before you begin Newly created plug-in project is displayed on the
Project Explorer pane.
- Procedure
- Double-click the
Activator.javafile from thesrcfolder of the plug-in project.Activator.javafile is opened. By default, there aregetProvider()andgetProviders()methods are present in theActivator.javafile. - Uncomment the
getProviders()method. - Create another copy of the
CustomJMSProvider.javafile from thesrcfolder in the same folder. You can rename the copy file. - Double-click the newly copied file.
Newly created Java file is opened.
- In the
getInitialContextFactory()method, remove the existing context factory and add the name of an initial context factory that is to be supported. - Open the
Activator.javafile and create an object of a newly created class. - Add the object to the AbstractJMSProvider array.
- Expand the
OSGI-INFdirectory to see theCustomJMSProvider.xmlfile. - Create copy of the
CustomJMSProvider.xmlfile with the same name as given to the newly created copy of theCustomJMSProvider.javafile. - Double-click the newly created copy of the
CustomJMSProvider.xmlfile.Newly created XML file is opened. - Replace an existing class name with the new class name in the
<implementation class>attribute. - Expand the
MetaINFfolder to see theMANIFEST.MFfile. - Add an entry of the newly created XML file in the
service-implementattribute in the formOSGI-INF/<class name>.xml - Save all the open files.
Note: If you want to add more context factories, repeat the procedure.