Building Your Event-Driven Architecture : Implementing Event-Driven Architecture with Software AG Products : Configuring NERV : Creating Custom NERV Component Bundles
Creating Custom NERV Component Bundles
You can create and initialize a custom NERV component bundle that will override the default NERV component defined using the Default JMS Provider configuration property in Command Central.
For more information about switching between the default and the custom NERV component definitions, see Switching Between Default and Custom NERV Logic.
To create a custom NERV component bundle
1. In Designer, create a plug-in project.
2. Remove all automatically generated files, except for the MANIFEST.MF file.
3. Add a MyBlueprint.xml file and a MyNERVComponent.xml file in the OSGI-INF/blueprint directory.
The resulting structure is as follows:
<project_root>\META-INF\MANIFEST.MF
<project_root>\OSGI-INF\blueprint\
   MyBlueprint.xml
<project_root>\OSGI-INF\blueprint\
   MyNERVComponent.xml
Note:  
You can also use the NERV Default Component Example wizard in Designer to create the project structure automatically.
4. Edit the MyBlueprint.xml file in the OSGI-INF/blueprint directory and reference the nervDefaultJMS component.
The result should be as follows:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<service id="nervDefaultJMSService"
interface="org.apache.camel.Component"
ref="nervDefaultJMS" depends-on="nervDefaultJMS">
<service-properties>
<entry key="componentId" value="nervDefaultJMS"/>
</service-properties>
</service>
</blueprint>
5. Edit the MyNERVComponent.xml file in the OSGI-INF/blueprint directory containing the beans necessary for creating your Camel component.
The result should be as follows:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean id="nervDefaultJMS"
class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory"
ref="defaultCachedConnectionFactory" />
<property name="destinationResolver"
ref="defaultDestinationResolver" />
</bean>
<bean id="defaultCachedConnectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory">
<property name="targetConnectionFactory"
ref="defaultConnectionFactory" />
<property name="sessionCacheSize" value="2000" />
<property name="cacheProducers" value="false" />
</bean>
<bean id="defaultConnectionFactory"
class="org.springframework.jndi.JndiObjectFactoryBean"
depends-on="defaultDestinationResolver">
<property name="jndiTemplate" ref="jndiTemplate" />
<property name="jndiName" ref="eventFactory" />
</bean>
<bean id="eventFactory" class="java.lang.String">
<constructor-arg value="EventFactory" />
</bean>
<bean id="defaultDestinationResolver"
class="com.softwareag.eda.jndi.NervResolver"
depends-on="jndiTemplate" init-method="init">
<property name="jndiTemplate" ref="jndiTemplate" />
<property name="classLoader">
<null />
</property>
</bean>
<bean id="jndiTemplate"
class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<map>
<entry key="java.naming.factory.initial"
value="com.pcbsys.nirvana.nSpace.NirvanaContextFactory" />
<entry key="java.naming.provider.url" value=
"nsp://localhost:9000" />
<entry key="com.webmethods.jms.naming.clientgroup"
value="admin" />
<entry key="connectionFactory" value-ref="eventFactory" />
</map>
</property>
</bean>
</beans>
6. Edit the MANIFEST.MF file in the META-INF directory. You must also add some import-package clauses to get the bundle to work properly in the Common Platform.
Below you can find an example of the edited MANIFEST.MF file:
Manifest-Version: 1.0
Bundle-Name: component.nervDefaultJMS
Bundle-Vendor: Software AG
Bundle-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Description: Software AG NERV Components Default Bundle
Import-Package: com.pcbsys.nirvana.nSpace;version=0,
com.softwareag.eda.jndi;version=0,
com.webmethods.jms.impl;version=0,
com.webmethods.jms.naming;version=0,
org.apache.camel;version=0,
org.apache.camel.component.jms;version=0,
org.springframework.jms.connection;version=0,
org.springframework.jms.support.destination;version=0,
org.springframework.jndi;version=0
Bundle-DocURL: http://www.softwareag.com
Bundle-SymbolicName: component.nervDefaultJMS
Implementation-Version: 1.0
7. Build your project using webMethods Asset Build Environment, and deploy it using webMethods Deployer.
For more information, see the PDF publication webMethods Deployer User’s Guide.
Copyright © 2016 - 2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback