Author: chirino
Date: Fri Sep 1 11:11:13 2006
New Revision: 439408
URL: http://svn.apache.org/viewvc?rev=439408&view=rev
Log:
Latest export from confluence
Modified:
incubator/activemq/site/weblogic-integration.html
Modified: incubator/activemq/site/weblogic-integration.html
URL:
http://svn.apache.org/viewvc/incubator/activemq/site/weblogic-integration.html?rev=439408&r1=439407&r2=439408&view=diff
==============================================================================
--- incubator/activemq/site/weblogic-integration.html (original)
+++ incubator/activemq/site/weblogic-integration.html Fri Sep 1 11:11:13 2006
@@ -365,7 +365,7 @@
<H4><A name="WebLogicIntegration-ActiveMQasaWebLogicApplication"></A>ActiveMQ
as a WebLogic Application</H4>
-<P>The easiest type of WebLogic application to configure with all the needed
ActiveMQ libraries and configuration and not much else is a web application.
The JARs go in <TT>WEB-INF/lib/</TT> and config files typically in
<TT>WEB-INF/</TT>. The only necessary configuration for the web application
itself is to install a listener that will start and stop ActiveMQ when the web
application is started and stopped. There are also a couple optional classes
that can be used to integrate ActiveMQ with WebLogic's management and
security systems. Additionally, in this example, a simple web page included in
the WAR will be available whenever ActiveMQ is running, so a simple HTTP
request can determine whether the ActiveMQ module has been started.</P>
+<P>The easiest type of WebLogic application to configure with all the needed
ActiveMQ libraries and configuration and not much else is a web application.
The JARs go in <TT>WEB-INF/lib/</TT> and config files typically in
<TT>WEB-INF/</TT>. The only necessary configuration for the web application
itself is to install a listener that will start and stop ActiveMQ when the web
application is started and stopped. There are also a couple optional classes
that can be used to integrate ActiveMQ with WebLogic's security system.
Additionally, in this example, a simple web page included in the WAR will be
available whenever ActiveMQ is running, so a simple HTTP request can determine
whether the ActiveMQ module has been started.</P>
<H4><A name="WebLogicIntegration-ManagementOptions"></A>Management Options</H4>
@@ -384,7 +384,7 @@
</UL>
-<P>The sample below includes an optional class that lets ActiveMQ hook into
the WebLogic runtime MBeanServer. This means ActiveMQ MBeans will appear
alongside WebLogic MBeans (and even JVM MBeans if they are enabled). This
means management clients will access ActiveMQ MBeans through the normal
WebLogic listen port (e.g. 7001) rather than using a dedicated JMX port, though
IIOP must be enabled for this to work. However, note that this is optional,
and you can skip this class and use one of the other approaches (JVM or
embedded MBeanServer) to expose the ActiveMQ MBeans.</P>
+<P>The sample below includes an optional configuration block that lets
ActiveMQ hook into the WebLogic runtime MBeanServer. This means ActiveMQ
MBeans will appear alongside WebLogic MBeans (and even JVM MBeans if they are
enabled). With this approach, management clients will access ActiveMQ MBeans
through the normal WebLogic listen port (e.g. 7001) rather than using a
dedicated JMX port, though IIOP must be enabled for this to work. However,
note that this is optional, and you can skip that configuration block and use
one of the other approaches (JVM or embedded MBeanServer) to expose the
ActiveMQ MBeans.</P>
<H4><A name="WebLogicIntegration-SecurityOptions"></A>Security Options</H4>
@@ -406,7 +406,7 @@
<LI>In order to start ActiveMQ when the web application is deployed,
the <TT>web.xml</TT> includes a context listener for Spring, and the Spring
<TT>applicationContext.xml</TT> file loads the ActiveMQ broker and points it to
the ActiveMQ configuration file (which as mentioned above, is stored in a
directory on the class path).</LI>
<LI>Within ActiveMQ:
<UL>
- <LI>A management plugin causes ActiveMQ to register all its JMX
MBeans with the WebLogic JMX MBeanServer</LI>
+ <LI>A configuration block in the ActiveMQ configuration file
causes ActiveMQ to register all its JMX MBeans with the WebLogic JMX
MBeanServer</LI>
<LI>A security plugin causes all clients to authenticate
against the WebLogic security realm</LI>
<LI>The security plugin also reads the name of a WebLogic group
from the ActiveMQ configuration file, and requires that any client must be a
member of that group (when WebLogic processed the login, it must have created a
principal for that group for the user)</LI>
<LI>The ActiveMQ configuration file also identifies a network
listen port that ActiveMQ will listen on for JMS clients. Any clients must
include the server's hostname and this listen port in their connect
URL.</LI>
@@ -473,41 +473,13 @@
<P>Additionally, to build the custom security plugins, the WebLogic
<TT>server/lib/weblogic.jar</TT> is presently required at compile time.</P>
-<P>Of these, Derby could be omitted if ActiveMQ was configured to not use a
database for persistence or to use a separate database for persistence. The
WebLogic JAR is needed only at build time (it's provided by the server at
runtime). Spring could be omitted if a different strategy was used to start
and stop ActiveMQ when the web app was started or stopped (a little custom code
could replace this dependency). The rest are probably unavoidable, unless
ActiveMQ changes its dependencies in a future version.</P>
+<P>Of these, Derby could be omitted if ActiveMQ was configured to not use a
database for persistence or to use a separate database (e.g. a WebLogic
database pool) for persistence. The WebLogic JAR is needed only at build time
(it's provided by the server at runtime). Spring could be omitted if a
different strategy was used to start and stop ActiveMQ when the web app was
started or stopped (a little custom code could replace this dependency). The
rest are probably unavoidable, unless ActiveMQ changes its dependencies in a
future version.</P>
<H5><A name="WebLogicIntegration-WebLogicIntegrationCode"></A>WebLogic
Integration Code</H5>
-<P>There are several custom classes used for this example. We'll show in
a minute how to configure ActiveMQ to use these. Note that these are all
optional – if you don't want to leverage WebLogic's MBeanServer
or security realm, you can skip these.</P>
+<P>There are two custom classes used for this example. We'll show in a
minute how to configure ActiveMQ to use these. Note that these are optional
– if you don't want to leverage WebLogic's security realm, you
can skip these.</P>
-<P>The first lets ActiveMQ installed its JMX MBeans into the WebLogic runtime
MBeanServer:</P>
-
-<P><B>ActiveMQToWebLogicManagement.java</B></P>
-
-<P>This class overrides the ActiveMQ default MBeanServer lookup behavior (in
the ActiveMQ class <TT>ManagementContext</TT> to prefer the WebLogic runtime
MBeanServer.</P>
-
-<DIV class="code"><DIV class="codeContent">
-<PRE class="code-java">/**
- * Makes ActiveMQ favor the WebLogic runtime MBeanServer
- */
-<SPAN class="code-keyword">public</SPAN> class ActiveMQToWebLogicManagement
<SPAN class="code-keyword">extends</SPAN> ManagementContext {
- <SPAN class="code-keyword">protected</SPAN> <SPAN
class="code-keyword">synchronized</SPAN> MBeanServer findMBeanServer() {
- <SPAN class="code-keyword">try</SPAN> {
- Context ctx = <SPAN class="code-keyword">new</SPAN>
InitialContext();
- MBeanServer server = (MBeanServer) ctx.lookup(<SPAN
class="code-quote">"java:comp/env/jmx/runtime"</SPAN>);
- <SPAN class="code-keyword">if</SPAN>(server != <SPAN
class="code-keyword">null</SPAN>) {
- <SPAN class="code-object">System</SPAN>.out.println(<SPAN
class="code-quote">"ACTIVEMQ Found WebLogic MBeanServer"</SPAN>);
- <SPAN class="code-keyword">return</SPAN> server;
- }
- } <SPAN class="code-keyword">catch</SPAN> (NamingException e) {
- e.printStackTrace();
- }
- <SPAN class="code-object">System</SPAN>.out.println(<SPAN
class="code-quote">"ACTIVEMQ Did not find WebLogic
MBeanServer"</SPAN>);
- <SPAN class="code-keyword">return</SPAN> <SPAN
class="code-keyword">super</SPAN>.findMBeanServer();
- }
-}</PRE>
-</DIV></DIV>
-
-<P>The next class makes ActiveMQ use the WebLogic security realm for
authentication, and lets you specify a single WebLogic group to use for
authorization (only members of that group can access ActiveMQ, though group
members have full access to ActiveMQ).</P>
+<P>The first class makes ActiveMQ use the WebLogic security realm for
authentication, and lets you specify a single WebLogic group to use for
authorization (only members of that group can access ActiveMQ, though group
members have full access to ActiveMQ).</P>
<P><B>ActiveMQToWebLogicSecurity.java</B></P>
@@ -553,7 +525,7 @@
}</PRE>
</DIV></DIV>
-<P>Finally, the last class is the authentication filter used by the class
above to authenticate all logins against the WebLogic default security
realm.</P>
+<P>The second class is the authentication filter used by the class above to
authenticate all logins against the WebLogic default security realm.</P>
<P><B>ActiveMQWebLogicAuthenticationFilter.java</B></P>
@@ -681,10 +653,32 @@
<SPAN class="code-tag"><bean class=<SPAN
class="code-quote">"org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"</SPAN>/></SPAN>
<broker useJmx=<SPAN class="code-quote">"true"</SPAN>
brokerName=<SPAN class="code-quote">"MyBroker"</SPAN>
useShutdownHook=<SPAN class="code-quote">"false"</SPAN>
- managementContext=<SPAN
class="code-quote">"#WebLogicManagement"</SPAN> plugins=<SPAN
class="code-quote">"#WebLogicSecurity"</SPAN>>
+ plugins=<SPAN
class="code-quote">"#WebLogicSecurity"</SPAN>>
+
+ <SPAN class="code-tag"><SPAN class="code-comment"><!-- Register all
ActiveMQ MBeans with the WebLogic runtime MBeanServer --></SPAN></SPAN>
+ <SPAN class="code-tag"><managementContext></SPAN>
+ <SPAN class="code-tag"><managementContext></SPAN>
+ <SPAN class="code-tag"><MBeanServer></SPAN>
+ <SPAN class="code-tag"><bean class=<SPAN
class="code-quote">"org.springframework.jndi.JndiObjectFactoryBean"</SPAN>
xmlns=""></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"jndiName"</SPAN> value=<SPAN
class="code-quote">"java:comp/env/jmx/runtime"</SPAN> /></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"lookupOnStartup"</SPAN> value=<SPAN
class="code-quote">"true"</SPAN> /></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"expectedType"</SPAN> value=<SPAN
class="code-quote">"javax.management.MBeanServer"</SPAN> /></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></MBeanServer></SPAN>
+ <SPAN class="code-tag"></managementContext></SPAN>
+ <SPAN class="code-tag"></managementContext></SPAN>
+
<SPAN class="code-tag"><persistenceAdapter></SPAN>
+ <SPAN class="code-tag"><SPAN class="code-comment"><!-- By default,
use an embedded Derby database --></SPAN></SPAN>
<journaledJDBC journalLogFiles=<SPAN
class="code-quote">"5"</SPAN>
dataDirectory=<SPAN
class="code-quote">"/server/bea/weblogic920/domains/jms/activemq-data"</SPAN>/>
+ <!-- Use this with the WebLogicDataSource below to use a WebLogic
+ database connection pool instead of the embedded Derby database
+ <journaledJDBC journalLogFiles=<SPAN
class="code-quote">"5"</SPAN>
+ dataDirectory=<SPAN
class="code-quote">"/server/bea/weblogic920/domains/jms/activemq-data"</SPAN>
+ dataSource=<SPAN
class="code-quote">"#WebLogicDataSource"</SPAN> />
+
+ -->
<SPAN class="code-tag"></persistenceAdapter></SPAN>
<SPAN class="code-tag"><transportConnectors></SPAN>
@@ -692,13 +686,18 @@
<SPAN class="code-tag"></transportConnectors></SPAN>
<SPAN class="code-tag"></broker></SPAN>
- <bean id=<SPAN class="code-quote">"WebLogicManagement"</SPAN>
- class=<SPAN
class="code-quote">"com.example.activemq.weblogic.ActiveMQToWebLogicManagement"</SPAN>
/>
-
<bean id=<SPAN class="code-quote">"WebLogicSecurity"</SPAN>
class=<SPAN
class="code-quote">"com.example.activemq.weblogic.ActiveMQToWebLogicSecurity"</SPAN>>
<SPAN class="code-tag"><property name=<SPAN
class="code-quote">"authorizedGroup"</SPAN> value=<SPAN
class="code-quote">"ActiveMQUsers"</SPAN> /></SPAN>
<SPAN class="code-tag"></bean></SPAN>
+
+<!-- Uncomment and configure this if you want to use a WebLogic database
+ connection pool for persistent messages
+ <bean id=<SPAN class="code-quote">"WebLogicDataSource"</SPAN>
+ class=<SPAN
class="code-quote">"org.springframework.jndi.JndiObjectFactoryBean"</SPAN>>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"jndiName"</SPAN> value=<SPAN
class="code-quote">"db/pool/jndi/name"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+-->
<SPAN class="code-tag"></beans></SPAN></PRE>
</DIV></DIV>
@@ -710,10 +709,32 @@
<SPAN class="code-tag"><bean class=<SPAN
class="code-quote">"org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"</SPAN>/></SPAN>
<broker useJmx=<SPAN class="code-quote">"true"</SPAN>
brokerName=<SPAN class="code-quote">"FirstBroker"</SPAN>
useShutdownHook=<SPAN class="code-quote">"false"</SPAN>
- managementContext=<SPAN
class="code-quote">"#WebLogicManagement"</SPAN> plugins=<SPAN
class="code-quote">"#WebLogicSecurity"</SPAN>>
+ plugins=<SPAN
class="code-quote">"#WebLogicSecurity"</SPAN>>
+
+ <SPAN class="code-tag"><SPAN class="code-comment"><!-- Register all
ActiveMQ MBeans with the WebLogic runtime MBeanServer --></SPAN></SPAN>
+ <SPAN class="code-tag"><managementContext></SPAN>
+ <SPAN class="code-tag"><managementContext></SPAN>
+ <SPAN class="code-tag"><MBeanServer></SPAN>
+ <SPAN class="code-tag"><bean class=<SPAN
class="code-quote">"org.springframework.jndi.JndiObjectFactoryBean"</SPAN>
xmlns=""></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"jndiName"</SPAN> value=<SPAN
class="code-quote">"java:comp/env/jmx/runtime"</SPAN> /></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"lookupOnStartup"</SPAN> value=<SPAN
class="code-quote">"true"</SPAN> /></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"expectedType"</SPAN> value=<SPAN
class="code-quote">"javax.management.MBeanServer"</SPAN> /></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></MBeanServer></SPAN>
+ <SPAN class="code-tag"></managementContext></SPAN>
+ <SPAN class="code-tag"></managementContext></SPAN>
+
<SPAN class="code-tag"><persistenceAdapter></SPAN>
+ <SPAN class="code-tag"><SPAN class="code-comment"><!-- By default,
use an embedded Derby database --></SPAN></SPAN>
<journaledJDBC journalLogFiles=<SPAN
class="code-quote">"5"</SPAN>
dataDirectory=<SPAN
class="code-quote">"/server/bea/weblogic920/domains/jms/activemq-b1-data"</SPAN>/>
+ <!-- Use this with the WebLogicDataSource below to use a WebLogic
+ database connection pool instead of the embedded Derby database
+ <journaledJDBC journalLogFiles=<SPAN
class="code-quote">"5"</SPAN>
+ dataDirectory=<SPAN
class="code-quote">"/server/bea/weblogic920/domains/jms/activemq-b1-data"</SPAN>
+ dataSource=<SPAN
class="code-quote">"#WebLogicDataSource"</SPAN> />
+
+ -->
<SPAN class="code-tag"></persistenceAdapter></SPAN>
<SPAN class="code-tag"><transportConnectors></SPAN>
@@ -727,13 +748,18 @@
<SPAN class="code-tag"></networkConnectors></SPAN>
<SPAN class="code-tag"></broker></SPAN>
- <bean id=<SPAN class="code-quote">"WebLogicManagement"</SPAN>
- class=<SPAN
class="code-quote">"com.example.activemq.weblogic.ActiveMQToWebLogicManagement"</SPAN>
/>
-
<bean id=<SPAN class="code-quote">"WebLogicSecurity"</SPAN>
class=<SPAN
class="code-quote">"com.example.activemq.weblogic.ActiveMQToWebLogicSecurity"</SPAN>>
<SPAN class="code-tag"><property name=<SPAN
class="code-quote">"authorizedGroup"</SPAN> value=<SPAN
class="code-quote">"ActiveMQUsers"</SPAN> /></SPAN>
<SPAN class="code-tag"></bean></SPAN>
+
+<!-- Uncomment and configure this if you want to use a WebLogic database
+ connection pool for persistent messages
+ <bean id=<SPAN class="code-quote">"WebLogicDataSource"</SPAN>
+ class=<SPAN
class="code-quote">"org.springframework.jndi.JndiObjectFactoryBean"</SPAN>>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"jndiName"</SPAN> value=<SPAN
class="code-quote">"db/pool/jndi/name"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+-->
<SPAN class="code-tag"></beans></SPAN></PRE>
</DIV></DIV>
@@ -745,10 +771,32 @@
<SPAN class="code-tag"><bean class=<SPAN
class="code-quote">"org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"</SPAN>/></SPAN>
<broker useJmx=<SPAN class="code-quote">"true"</SPAN>
brokerName=<SPAN class="code-quote">"SecondBroker"</SPAN>
useShutdownHook=<SPAN class="code-quote">"false"</SPAN>
- managementContext=<SPAN
class="code-quote">"#WebLogicManagement"</SPAN> plugins=<SPAN
class="code-quote">"#WebLogicSecurity"</SPAN>>
+ plugins=<SPAN
class="code-quote">"#WebLogicSecurity"</SPAN>>
+
+ <SPAN class="code-tag"><SPAN class="code-comment"><!-- Register all
ActiveMQ MBeans with the WebLogic runtime MBeanServer --></SPAN></SPAN>
+ <SPAN class="code-tag"><managementContext></SPAN>
+ <SPAN class="code-tag"><managementContext></SPAN>
+ <SPAN class="code-tag"><MBeanServer></SPAN>
+ <SPAN class="code-tag"><bean class=<SPAN
class="code-quote">"org.springframework.jndi.JndiObjectFactoryBean"</SPAN>
xmlns=""></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"jndiName"</SPAN> value=<SPAN
class="code-quote">"java:comp/env/jmx/runtime"</SPAN> /></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"lookupOnStartup"</SPAN> value=<SPAN
class="code-quote">"true"</SPAN> /></SPAN>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"expectedType"</SPAN> value=<SPAN
class="code-quote">"javax.management.MBeanServer"</SPAN> /></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+ <SPAN class="code-tag"></MBeanServer></SPAN>
+ <SPAN class="code-tag"></managementContext></SPAN>
+ <SPAN class="code-tag"></managementContext></SPAN>
+
<SPAN class="code-tag"><persistenceAdapter></SPAN>
+ <SPAN class="code-tag"><SPAN class="code-comment"><!-- By default,
use an embedded Derby database --></SPAN></SPAN>
<journaledJDBC journalLogFiles=<SPAN
class="code-quote">"5"</SPAN>
dataDirectory=<SPAN
class="code-quote">"/server/bea/weblogic920/domains/jms/activemq-b2-data"</SPAN>/>
+ <!-- Use this with the WebLogicDataSource below to use a WebLogic
+ database connection pool instead of the embedded Derby database
+ <journaledJDBC journalLogFiles=<SPAN
class="code-quote">"5"</SPAN>
+ dataDirectory=<SPAN
class="code-quote">"/server/bea/weblogic920/domains/jms/activemq-b2-data"</SPAN>
+ dataSource=<SPAN
class="code-quote">"#WebLogicDataSource"</SPAN> />
+
+ -->
<SPAN class="code-tag"></persistenceAdapter></SPAN>
<SPAN class="code-tag"><transportConnectors></SPAN>
@@ -762,13 +810,18 @@
<SPAN class="code-tag"></networkConnectors></SPAN>
<SPAN class="code-tag"></broker></SPAN>
- <bean id=<SPAN class="code-quote">"WebLogicManagement"</SPAN>
- class=<SPAN
class="code-quote">"com.example.activemq.weblogic.ActiveMQToWebLogicManagement"</SPAN>
/>
-
<bean id=<SPAN class="code-quote">"WebLogicSecurity"</SPAN>
class=<SPAN
class="code-quote">"com.example.activemq.weblogic.ActiveMQToWebLogicSecurity"</SPAN>>
<SPAN class="code-tag"><property name=<SPAN
class="code-quote">"authorizedGroup"</SPAN> value=<SPAN
class="code-quote">"activemq"</SPAN> /></SPAN>
<SPAN class="code-tag"></bean></SPAN>
+
+<!-- Uncomment and configure this if you want to use a WebLogic database
+ connection pool for persistent messages
+ <bean id=<SPAN class="code-quote">"WebLogicDataSource"</SPAN>
+ class=<SPAN
class="code-quote">"org.springframework.jndi.JndiObjectFactoryBean"</SPAN>>
+ <SPAN class="code-tag"><property name=<SPAN
class="code-quote">"jndiName"</SPAN> value=<SPAN
class="code-quote">"db/pool/jndi/name"</SPAN>/></SPAN>
+ <SPAN class="code-tag"></bean></SPAN>
+-->
<SPAN class="code-tag"></beans></SPAN></PRE>
</DIV></DIV>
@@ -875,7 +928,7 @@
<DIV id="site-footer">
Added by <A
href="http://goopen.org/confluence/users/viewuserprofile.action?username=ammulder">Aaron
Mulder</A>,
last edited by <A
href="http://goopen.org/confluence/users/viewuserprofile.action?username=ammulder">Aaron
Mulder</A> on Sep 01, 2006
- (<A
href="http://goopen.org/confluence/pages/diffpages.action?pageId=13349&originalId=13365">view
change</A>)
+ (<A
href="http://goopen.org/confluence/pages/diffpages.action?pageId=13349&originalId=13369">view
change</A>)
(<A
href="http://goopen.org/confluence/pages/editpage.action?pageId=13349">edit
page</A>)
</DIV>