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 on the
Activator.java file from the
src folder of the plug-in project.
Activator.java file is opened. By default, there are
getProvider()
andgetProviders()
methods are present in the Activator.java file. - Uncomment the
getProviders()
method. - Create another copy of the CustomJMSProvider.java file from the src folder 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 initial context factory that is to be supported. - Open the Activator.java file and create an object of newly created class.
- Add the object to the AbstractJMSProvider array.
- Expand the OSGI-INF directory to see CustomJMSProvider.xml file.
- Create copy of the CustomJMSProvider.xml file with the same name as given to the newly created copy of the CustomJMSProvider.java file.
- Double-click the newly created copy of the
CustomJMSProvider.xml file.
Newly created XML file is opened.
- Replace existing class name with the new class name in the
<implementation class>
attribute. - Expand MetaINF folder to see the MANIFEST.MF file.
- Add an entry of the newly created XML file in the
service-implement
attribute in the formOSGI-INF/<class name>.xml
- Save all the open files.
Note: If you want to add more context factories, repeat the procedure.