<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Paco Gomez&apos;s Blog</title>
    <link rel="alternate" type="text/html" href="http://dev2dev.bea.com/blog/paco/" />
    <link rel="self" type="application/atom+xml" href="http://dev2dev.bea.com/blog/paco/atom.xml" />
   <id>tag:dev2dev.bea.com,2008:/blog/paco//26</id>
    <updated>2008-02-01T16:45:15Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 3.31</generator>
 
<entry>
    <title>Algorithmic Trading with WebLogic Event Server</title>
    <link rel="alternate" type="text/html" href="http://dev2dev.bea.com/blog/paco/archive/2008/01/algorithmic_tra.html" />
    <id>http://dev2dev.bea.com/blog/paco/archive/2008/01/algorithmic_tra.html</id>
    
    <published>2008-01-30T08:14:11Z</published>
    <updated>2008-02-01T16:45:15Z</updated>
    
    <summary>The Algorithmic Trading Demo for WebLogic Event Server is now available for download. See inside for details...</summary>
    <author>
        <name>paco</name>
        
    </author>
            <category term="Product: WebLogic Event Server" />
    
    <content type="html" xml:lang="en" xml:base="http://dev2dev.bea.com/blog/paco/">
        <![CDATA[<p>In previous <a href="http://en.wikipedia.org/wiki/Complex_event_processing">entries</a>, I have discussed technical aspects of <a href="http://dev2dev.bea.com/wlevent/">WebLogic Event Server</a> and some exciting applications (<a href="http://dev2dev.bea.com/pub/a/2007/11/location-based-events.html">1</a>, <a href="http://dev2dev.bea.com/blog/paco/archive/2007/11/gps_tracking_de.html">2</a>). In the next entries I will write about <a href="http://en.wikipedia.org/wiki/Algorithmic_trading">Algorithmic Trading</a>,&#160; probably the most common application in <a href="http://en.wikipedia.org/wiki/Complex_event_processing">Complex Event Processing</a>.</p>  <p>I've had the opportunity to work with the WebLogic Event Server Engineering Team to make available the Algorithmic Trading Demo on CodeShare. The purpose of this demo is to illustrate some techniques used in this field, also known as Algo Trading, and how they are implemented in WLEvS. Source code, application binary and a ready-to-run Event Server domain is available for download <a href="https://codesamples.projects.dev2dev.bea.com/servlets/Scarab/id/S406">here</a>.</p>  <p>&#160;</p>  <h3>Demo Description</h3>  <p>The Algorithmic Trading Demo implements common indicators used in automated trading. The application receives market data through a socket connection and calculates the following results:</p>  <ul>   <li>Percentage change. Detects when the price of a stock changes more than one percent. </li>    <li>Trend. Detects when the price of a stock fluctuates in one direction (up or down) more than two successive times. </li>    <li>VWAP (Volume Weighted Average Price), the ratio of the value traded to total volume traded. </li> </ul>  <p>These ratios are calculated and displayed in real time on a dashboard for a basket of symbols.</p>  <p>The dashboard also shows average latency and a distribution histogram of all latencies. The following is a screenshot of the dashboard:</p>  <p>&#160;</p>  <p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="911" alt="dashboard-1" src="http://dev2dev.bea.com/blog/paco/WindowsLiveWriter/AlgorithmicTradingwithWLEvS_77E4/dashboard-1_1.gif" width="789" border="0" /> </p>  <h3>How to Run the Example</h3>  <p>The demo is distributed as two zip files:</p>  <ol>   <li>&quot;wlevs20_domain_algo.zip&quot;, it contains the WLEvS server with the demo deployed, ready to run. </li>    <li>&#8220;algo_trading.zip&#8221;, it contains the Algorithmic Trading application code and the data feed application that sends market data to the server. The application is distributed as an Eclipse project that can be imported directly into an Eclipse Workspace. </li> </ol>  <p>WebLogic Event Server 2.0 needs to be previously installed in order to run the example. We are assuming &#8220;c:\bea&#8221; as BEA_HOME. If WLEvS has been installed on a different BEA_HOME, see the specific notes in the steps below.</p>  <p>Follow these steps to run the example:</p>  <ol>   <li>Unzip wlevs20_domain_algo.zip to %BEA_HOME%\user_projects\domains. </li>    <li>Unzip algo_trading.zip to %BEA_HOME%\user_projects\modules. </li>    <li>Start the data feed standalone application.      <ul>       <li>Open a command window </li>        <li>Change to %BEA_HOME%\user_projects\modules\algo_trading </li>        <li>Run startDataFeed </li>        <li>If BEA_HOME is not c:\bea, edit startDataFeed.cmd to specify a valid JAVA_HOME value. </li>     </ul>   </li>    <li>Start the WLEvS server with the Algorithmic Trading application      <ul>       <li>Open another command window </li>        <li>Change to %BEA_HOME%\user_projects\domains\wlevs20_domain_algo </li>        <li>Run startwlevs </li>        <li>If BEA_HOME is not c:\bea, edit startwlevs.cmd to specify valid JAVA_HOME, USER_INSTALL, BEA_HOME and WLEVS_DOMAIN_HOME values. </li>     </ul>   </li>    <li>Note: The data feed application can be started before or after WLEvS, with the same results. </li>    <li>At this point, the data feed application should be sending market data to the WLEvS server and the CPU utilization should go up. </li>    <li>On a browser window, open the following URL: <a href="http://localhost:9002/algo/dashboard.html">http://localhost:9002/algo/dashboard.html</a>. Push &quot;start&quot; button. </li> </ol>  <p>&#160;</p>  <p>I will be providing more technical details about the demo in futures entries.</p>  <p>&#160;</p>  <p>Technorati Tags: <a href="http://technorati.com/tag/CEP">CEP</a>, <a href="http://technorati.com/tag/WLEvS">WLEvS</a>, <a href="http://technorati.com/tag/Algo+Trading">Algo Trading</a></p>]]>
        
    </content>
</entry>
<entry>
    <title>GPS Tracking Demo for WLEvS</title>
    <link rel="alternate" type="text/html" href="http://dev2dev.bea.com/blog/paco/archive/2007/11/gps_tracking_de.html" />
    <id>http://dev2dev.bea.com/blog/paco/archive/2007/11/gps_tracking_de.html</id>
    
    <published>2007-11-28T17:52:18Z</published>
    <updated>2007-11-28T22:21:16Z</updated>
    
    <summary>Source code and binary of the GPS tracking demo for WLEvS and instructions on how to use it.</summary>
    <author>
        <name>paco</name>
        
    </author>
            <category term="Product: WebLogic Event Server" />
    
    <content type="html" xml:lang="en" xml:base="http://dev2dev.bea.com/blog/paco/">
        <![CDATA[<p>In my last article, <a href="http://dev2dev.bea.com/pub/a/2007/11/location-based-events.html">Location-based Information Processing with WebLogic Event Server and Web 2.0</a>, I described a WLEvS application that detects the proximity of a vehicle to a location. I have posted the source code and binary of the demo on <a href="https://codesamples.projects.dev2dev.bea.com/servlets/Scarab?id=S393">Dev2Dev's CodeShare</a>.</p>  <p>The demo is now self-contained. It runs entirely on WLEvS and just requires an Internet connection to display the map mashup.</p>  <h3>How it Works</h3>  <ol>   <li>WLEvS receives the GPS information stored on a file using a file adapter. </li>    <li>The processor determines if a position is near the target destination and generates an alert. </li>    <li>Positions and alerts are stored in memory on WLEvS application (Java Bean) </li>    <li>The same Java Bean is also a servlet that displays a JavaScript page. The page is a mashup of Yahoo! Maps and the data from WLEvS. </li> </ol>  <p>The dashboard is shown here:</p>  <p><a href="http://dev2dev.bea.com/blog/paco/WindowsLiveWriter/0cefb19e8dce_11A16/gps1_2.gif"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="429" alt="GPS Tracking with WLEvS Dashboard" src="http://dev2dev.bea.com/blog/paco/WindowsLiveWriter/0cefb19e8dce_11A16/gps1_thumb.gif" width="395" border="0" /></a> </p>  <p></p>  <h3>Installation</h3>  <ol>   <li>Download the <a href="https://codesamples.projects.dev2dev.bea.com/servlets/Scarab?id=S393">project</a> from CodeShare and unzip the file. The code is distributed as and Eclipse project. It can also be built from the command line. </li>    <li>Copy &quot;openmap.jar&quot; to the WLEvS domain directory </li>    <li>Modify &quot;startwlevs.cmd&quot; to add the previous file to the bootclasspath:      <pre>set BOOTCP=-Xbootclasspath/a:openmap.jar
&quot;%JAVA_HOME%\bin\java&quot; %BOOTCP% ...</pre>
  </li>

  <li>Start WLEvS </li>

  <li>Update &quot;setEnv.cmd&quot; (JAVA_HOME and ANT_HOME) and &quot;build\build.properties&quot; (wlevs.home) </li>

  <li>From another command window, build and install the application: 
    <pre>setEnv.cmd
build.cmd dist
build.cmd install</pre>
  </li>

  <li>Open a browser window to access the dashboard. Here is the URL: <a href="http://localhost:9002/gps" target="_blank">http://localhost:9002/gps</a> </li>

  <li>Click on &quot;Start Trip&quot; to start the demo. Click on &quot;Reset&quot; to bring the demo to the initial state. </li>
</ol>

<p>&#160;</p>

<h3>The Demo in Action</h3>

<p><embed src="http://www.youtube.com/v/fekGVv5Ha94&amp;rel=1" width="425" height="355" type="application/x-shockwave-flash" wmode="transparent" /></p>]]>
        
    </content>
</entry>
<entry>
    <title>Monitoring JRockit Through a Firewall</title>
    <link rel="alternate" type="text/html" href="http://dev2dev.bea.com/blog/paco/archive/2007/11/monitoring_jroc.html" />
    <id>http://dev2dev.bea.com/blog/paco/archive/2007/11/monitoring_jroc.html</id>
    
    <published>2007-11-14T20:02:10Z</published>
    <updated>2007-11-14T20:13:00Z</updated>
    
    <summary>The attached code enables a JRockit instance to be monitored through a firewall using any arbitrary ports for the Registry and RMI connections.</summary>
    <author>
        <name>paco</name>
        
    </author>
            <category term="Product: BEA JRockit" />
    
    <content type="html" xml:lang="en" xml:base="http://dev2dev.bea.com/blog/paco/">
        <![CDATA[JRockit provides powerful monitoring capabilities with a very low resource consumption. That makes very common monitoring production JRockit instances using JRockit Mission Control (JRMC). It is also common to have a firewall protecting the production servers, sometimes in between the servers and the workstation where JRMC runs. In those scenarios, there are two ports that need to be open in the firewall: RMI Registry and RMI Server. The RMI Registry is typically 1099 but the RMI Server port is by default generated dynamically (and randomly) on the JRockit server and sent to the client (JRMC). Without knowing in advance what port is going to be used, it is not possible to configure the firewall to allow RMI communication to the server, therefore JRMC cannot connect to the JRockit instance.<br/>
<br/>
A solution to this problem is to provide a configurable JMX Agent on the JRockit instance that uses a predefined port number for the RMI Server connection. The firewall can be configured to allow traffic through that predefined port. On the client, JRMC, we can specify the RMI port to be used to communicate with the RMI Server.<br/>
<br/>
This solution doesn't require any changes to the existing application code. It can be used to monitor JRockit with <a href="http://edocs.beasys.com/jrockit/tools/index.html">JRockit Mission Control</a> or any other JMX-compliant monitoring tool like <a href="http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html">JConsole</a> or <a href="http://www.wlshell.net/">wlshell</a>.<br/>
<br/>
The attached jar file contains the ConfigurableJMXAgent, a JMX agent that can be used to specify the port number of the RMI Registry and RMI Server. Four system properties can be configured:<br/>
<pre>
-Dconfig.registry.host=192.168.10.132
-Dconfig.registry.port=1099 
-Dconfig.rmi.host=192.168.10.132 
-Dconfig.rmi.port=9999
</pre>
With these values, the firewall needs to allow traffic on ports 1099 and 9999. The URL to be used on the client, JRMC, is:<br/>
<pre>
service:jmx:rmi://192.168.10.132:9999/jndi/rmi://192.168.10.132:1099/jmxrmi
</pre>
<br/>
The configurable JMX agent needs to be loaded by the JRockit server instance at startup. The following command line is provided as an example:<br/>
<pre>
java -Xmanagement:class=com.bea.misc.ConfigurableJMXAgent 
     -Xbootclasspath/a:config-agent.jar 
     -Dconfig.registry.host=192.168.10.132
     -Dconfig.registry.port=1099
     -Dconfig.rmi.host=192.168.10.132 
     -Dconfig.rmi.port=9999 
     -jar C:\bea\jrockit-realtime20_150_11\demo\jfc\Notepad\Notepad.jar
</pre>
The console will show the following messages:<br/>
<pre>
ConfigurableJMXAgent: Created with params = [config.registry.host=192.168.10.132, config.registry.port=1099, config.rmi.host=192.168.10.132, config.rmi.port=9999]
ConfigurableJMXAgent: Create RMI registry on port 1099
ConfigurableJMXAgent: Get the platform's MBean server
ConfigurableJMXAgent: Initialize the environment map
ConfigurableJMXAgent: Create an RMI connector server
ConfigurableJMXAgent: Start the RMI connector server
ConfigurableJMXAgent: Started, use the following URL to connect =  service:jmx:rmi://192.168.10.132:9999/jndi/rmi://192.168.10.132:1099/jmxrmi
[JRockit] Local management server started.
</pre>
<br/>
The server is now ready. Start JRockit Mission Control and specify the connection URL as shown in the following image:<br/><br/>
<img alt="jrmc.gif" src="http://dev2dev.bea.com/blog/paco/jrmc.gif" width="450" height="349" />
<br/>
That should do it. Happy monitoring!<br/>
<br/>
Links:<br/>
<a href="https://submit-codesamples.projects.dev2dev.bea.com/servlets/Scarab?id=CS209">Configurable JMX Agent source code and JAR binary</a><br/>
<a href="http://dev2dev.bea.com/jrockit/">BEA JRockit Product Center</a> on Dev2Dev<br/>
<a href="http://www.wlshell.net/">wlshell</a><br/>]]>
        
    </content>
</entry>
<entry>
    <title>HTTP Adapter for WLEvS</title>
    <link rel="alternate" type="text/html" href="http://dev2dev.bea.com/blog/paco/archive/2007/09/http_adapter_fo.html" />
    <id>http://dev2dev.bea.com/blog/paco/archive/2007/09/http_adapter_fo.html</id>
    
    <published>2007-09-11T17:37:05Z</published>
    <updated>2007-09-11T18:20:40Z</updated>
    
    <summary>The HTTP Adapter allows sending events to WLEvS using HTTP with a browser, ALSB, wget utility or any programming language with an HTTP API.</summary>
    <author>
        <name>paco</name>
        
    </author>
            <category term="Product: WebLogic Event Server" />
    
    <content type="html" xml:lang="en" xml:base="http://dev2dev.bea.com/blog/paco/">
        <![CDATA[<a href="http://edocs.bea.com/wlevs/docs20/index.html">WebLogic Event Server</a> provides an open and documented <a href="http://edocs.bea.com/wlevs/docs20/create_apps/adapters.html">API</a> to build adapters. Through an adapter, external applications can send events to WLEvS.<br/> 
<br/>
The <a href="https://submit-codesamples.projects.dev2dev.bea.com/servlets/Scarab?id=CS204">HTTP Adapter</a> for WebLogic Event Server allows sending events to WLEvS using HTTP Get or Post requests. Using this adapter, users can send events to WLEvS via a web browser, command line tools like <a href="http://www.gnu.org/software/wget/">wget</a>, Service Bus (<a href="http://edocs.bea.com/alsb/docs26/index.html">ALSB</a>) or any programming language with an HTTP API, like Java, .NET, C, JavaScript, Perl, Phyton, Ruby, etc.<br/> 
<br/>
Along with the adapter, I have provided a modified version of the HelloWorld application to illustrate the use of the HTTP Adapter.<br/>
<br/>
The HTTP adapter registers a servlet on the servlet engine included in WLEvS. It accepts HTTP get and post requests, extracts the parameter values and sends an event to the listener attached to it.<br/>
<br/>
Here is a sample HTTP/Get request that sends an event. The URL is:
<a href="http://localhost:9002/adapter?message=hello&number=123">http://localhost:9002/adapter?message=hello&number=123</a><br/>
<br/>
Using a browser to send an event:<br/>
<br/>
<img alt="wlevs_http_04.gif" src="http://dev2dev.bea.com/blog/paco/wlevs_http_04.gif" width="536" height="146" /><br/>
<br/>
Here is another example using <a href="http://www.gnu.org/software/wget/">wget</a>:<br/>
<br/>
<img alt="wlevs_http_05.gif" src="http://dev2dev.bea.com/blog/paco/wlevs_http_05.gif" width="590" height="49" /><br/>
<br/>
Here are the events processed by the HelloWorldHttp application:<br/>
<br/>
<img alt="wlevs_http_03.gif" src="http://dev2dev.bea.com/blog/paco/wlevs_http_03.gif" width="246" height="77" /><br/>
<br/>
Similar to the csvadapter, the HttpAdapter is configurable and generates any type of Event described in the EPN configuration file, for example:<br/>
<br/>
The adapter factory registered in the HttpAdapter bundle:<br/>
<pre>
&lt;osgi:service interface=&quot;com.bea.wlevs.ede.api.AdapterFactory&quot;&gt;
  &lt;osgi:service-properties&gt;
    &lt;prop key=&quot;type&quot;&gt;HttpAdapterProvider&lt;/prop&gt;
  &lt;/osgi:service-properties&gt;
  &lt;bean class=&quot;com.bea.wlevs.adapter.http.HttpAdapterFactoryImpl&quot; &gt;
    &lt;property name=&quot;httpService&quot; ref=&quot;jetty&quot;/&gt;
  &lt;/bean&gt;
&lt;/osgi:service&gt;
</pre>

The EPN configuration in the HelloWorldHttp application:<br/>
<pre>
&lt;wlevs:event-type-repository&gt;
  &lt;wlevs:event-type type-name=&quot;HelloWorldEvent&quot;&gt;
    &lt;wlevs:class&gt;com.bea.wlevs.event.example.helloworld.HelloWorldEvent&lt;/wlevs:class&gt;
  &lt;/wlevs:event-type&gt;
&lt;/wlevs:event-type-repository&gt;

&lt;wlevs:adapter id=&quot;httpAdapter&quot; provider=&quot;HttpAdapterProvider&quot; manageable=&quot;true&quot;&gt;
  &lt;wlevs:instance-property name=&quot;servletName&quot; value=&quot;/adapter&quot;/&gt;
  &lt;wlevs:instance-property name=&quot;eventTypeName&quot; value=&quot;HelloWorldEvent&quot;/&gt;
  &lt;wlevs:instance-property name=&quot;eventPropertyNames&quot; value=&quot;message,number&quot;/&gt;
&lt;/wlevs:adapter&gt;
</pre>

Some use cases and benefits include:<br/>
<ul>
<li>
This adapter can be used during development and testing to generate any type of events without having to create a custom adapter. It is a bit more interactive than the csvadapter as users can type the event data in the browser and send it immediately 
</li>
<li>
In addition to the browser, users can use the <a href="http://www.gnu.org/software/wget/">wget </a>utility on the command line and create shell scripts
</li>
<li>the http adapter can be used for performance testing with standard web testing tools like <a href="http://www.mercury.com/us/products/performance-center/loadrunner/">LoadRunner</a> or <a href="http://grinder.sourceforge.net/">Grinder</a>
</li>
<li><a href="http://www.mortbay.org/">jetty</a>, the servlet engine in WLEvS can be configured and tuned for multithread and performance
<li>easy to integrate with programs via HTTP GET/POST API (Java, .NET, JavaScript, C, Perl, Phyton, Ruby, etc)
</li>
<li>we can use <a href="http://edocs.bea.com/alsb/docs26/index.html">ALSB </a>in front of WLEvS and have, with little configuration, any <a href="http://edocs.bea.com/alsb/docs26/interopmatrix/matrix.html#wp1057971">protocol supported by ALSB</a> (MQ, ftp, file, etc) be able to talk to WLEvS. We just create an ALSB business service that uses HTTP GET to talk to WLEvS
</li>
</ul>
<br/>
Some useful links:<br/>
<a href="https://submit-codesamples.projects.dev2dev.bea.com/servlets/Scarab?id=CS204">HTTP Adapter for WLEvS</a><br/>
<a href="http://dev2dev.bea.com/wlevent/">WebLogic Event Server Product Center</a>
<br/>
<a href="http://dev2dev.bea.com/alservicebus/">AquaLogic Service Bus Product Center</a>
<br/>]]>
        
    </content>
</entry>
<entry>
    <title>WebLogic Event Server Administration</title>
    <link rel="alternate" type="text/html" href="http://dev2dev.bea.com/blog/paco/archive/2007/07/weblogic_event.html" />
    <id>http://dev2dev.bea.com/blog/paco/archive/2007/07/weblogic_event.html</id>
    
    <published>2007-07-26T08:40:32Z</published>
    <updated>2007-07-26T08:40:33Z</updated>
    
    <summary>This entry is an introduction to the new BEA WebLogic Event Server (WLEvS) administration. WLEvS exposes management operations through a standard JMX interface, including dynamic configuration of EPL rules for application processors. I will cover common management tasks related to server life cycle, EPL (Event Processing Language) rules and adapter MBeans. The examples are provided using wlshell.</summary>
    <author>
        <name>paco</name>
        
    </author>
            <category term="Product: WebLogic Event Server" />
    
    <content type="html" xml:lang="en" xml:base="http://dev2dev.bea.com/blog/paco/">
        <![CDATA[<strong>Configuration
</strong><br/>
<br/>
The management tasks described here are performed using <a href="http://edocs.bea.com/wlevs/docs20/index.html">WLEvS </a>version 2.0 and <a href="http://www.wlshell.net/">wlshell </a>version 2.1.0. The example used is the <a href="http://edocs.bea.com/wlevs/docs20/get_started/examples.html#wp1012226">HelloWorld </a>application, included with WLEvS. By default, this domain has the JMX services enabled.<br/>
<br/>
wlshell is a <a href="http://en.wikipedia.org/wiki/Domain-specific_programming_language">DSL </a>(Domain Specific Language) for JMX. It is a scripting shell fully compliant with the JMX specification, providing access to MBeans in a convenient manner. Since both WLEvS and wlshell are based on standard JMX, the products interoperate directly out of the box, without any customization. WLEvS also includes another utility, wlevs.Admin, to access the MBeans and work with EPL rules.<br/>
<br/>
On the machine running wlshell, it is not necessary to install WLEvS. The only requirements are the wlshell install files and a valid JDK or JRE (version 5 or 6). Please refer to the wlshell installation <a href="http://www.wlshell.net/v2/installation.html">documentation </a>and the section about using the <a href="http://www.wlshell.net/v2/jmxremote.html">JMXRemote </a>connector. wlshell can run on the same machine as WLEvS or remotely on another server.<br/>
<br/>
<strong>Connecting to WLEvS</strong><br/>
<br/>
We are going to start the HelloWorld WLEvS domain and wlshell. In wlshell, we use the "connect" command to connect to the WLEvS server, indicating the URL, user name and password, as shown here:
<br/>
<pre>
#connect
connect service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi wlevs wlevs

#change to wlevs domain
com.bea.wlevs:

#set keys
keys Type Name Application

#list current directory
ls

#show the explorer
explore
</pre><br/>
Here is a screenshot of those commands executed in wlshell:<br/>
<br/>
<img alt="wlevs-01.gif" src="http://dev2dev.bea.com/blog/paco/wlevs-01.gif" width="760" height="460" /><br/>
<br/>
We will be using the keys "Type, Name and Application" for the rest of the article, unless otherwise noted. The concept of "keys" is described in detail <a href="http://www.wlshell.net/v2/directories.html">here</a>.<br/>
<br/>
The explorer is shown below, displaying the MBean server URL, available JMX domains and all the MBeans registered on the "com.bea.wlevs" domain. The explorer is very convenient to browse the MBeans and see what attributes and operations are available.<br/><br/>
<img alt="wlevs-02.gif" src="http://dev2dev.bea.com/blog/paco/wlevs-02.gif" width="853" height="623" /><br/><br/>
<strong>Managing Server Life Cycle</strong><br/>
<br/>
The ServerRuntime MBean provides an operation to shutdown the server. The command to shutdown the server is:<br/>
<pre>
cd /ServerRuntime
invoke shutdown
</pre>
or simply:
<pre>
invoke /ServerRuntime/shutdown
</pre>]]>
        <![CDATA[<strong>Managing EPL Rules</strong><br/>
<br/>
Each Processor inside an Application has one corresponding MBean, which exposes EPL Rules management operations. The following screenshot shows the MBean for the "helloworldProcessor" in the "helloworld" application:<br/><br/>
<img alt="wlevs-03.gif" src="http://dev2dev.bea.com/blog/paco/wlevs-03.gif" width="855" height="625" /><br/><br/>
The following screenshot shows a sample interaction with the EPLProcessor MBean to add and delete EPL rules:<br/><br/>
<img alt="wlevs-04.gif" src="http://dev2dev.bea.com/blog/paco/wlevs-04.gif" width="1141" height="283" /><br/><br/>
The script used is:<br/>
<pre>
app = helloworld
cd /EPLProcessor/${app}Processor/$app

get AllRules
invoke getRule helloworldRule
invoke deleteRule helloworldRule
get AllRules
invoke addRule helloworldRule "select * from HelloWorldEvent retain 1 event"
get AllRules
</pre><br/>
<br/>
<strong>Accessing other MBeans
</strong><br/>
<br/>
WLEvS provides MBeans for many other components like streams and application adapters. We can access their attributes and operations in the same way with wlshell.<br/>
<br/>
As an example, the following script modifies dynamically the Message attribute of the "helloworldAdapter":<br/>
<pre>
cd /HelloWorldAdapterConfig/${app}Adapter/$app
get Message
set Message "Hi! the time is now: "
get Message
</pre>
<br/>
This is the wlshell output when executing the previous script:<br/><br/>
<img alt="wlevs-06.gif" src="http://dev2dev.bea.com/blog/paco/wlevs-06.gif" width="884" height="184" /><br/>
<br/>
The change takes effect immediately, as seen in the WLEvS console output:<br/><br/>
<img alt="wlevs-05.gif" src="http://dev2dev.bea.com/blog/paco/wlevs-05.gif" width="428" height="132" /><br/>
<br/>
<strong>Conclusion</strong><br/>
<br/>
WebLogic Event Server provides all the management operations through the standard JMX interface. JMX-compliant tools, like wlshell, can be used to effectively administer WLEvS. In this blog entry I have described some basic management tasks, using MBean attributes and operations. Additional administrative tasks can be done on other MBeans using the same techniques described here.<br/>
<br/>
<strong>References</strong><br/>
<br/>
    <ul> <a href="http://dev2dev.bea.com/wlevent/">WLEvS </a>- WebLogic Event Server Product Center</ul>
    <ul><a href="http://www.wlshell.net/">wlshell </a>- JMX scripting shell</ul>



]]>
    </content>
</entry>
<entry>
    <title>Configuring WebLogic Resources, a la wlshell</title>
    <link rel="alternate" type="text/html" href="http://dev2dev.bea.com/blog/paco/archive/2007/07/configuirng_web.html" />
    <id>http://dev2dev.bea.com/blog/paco/archive/2007/07/configuirng_web.html</id>
    
    <published>2007-07-20T08:00:43Z</published>
    <updated>2007-07-20T08:04:25Z</updated>
    
    <summary>In the second entry in the series, I will show how to modify a WebLogic Domain configuration with a simple example.</summary>
    <author>
        <name>paco</name>
        
    </author>
            <category term="Product: WebLogic Server" />
    
    <content type="html" xml:lang="en" xml:base="http://dev2dev.bea.com/blog/paco/">
        <![CDATA[In my previous <a href="http://dev2dev.bea.com/blog/paco/archive/2007/07/weblogic_10_as.html">entry</a>, I discussed about how to connect to an Admin Server and how the MBeans are organized in three MBean servers. Here I will explain how to make changes in a domain, creating a Managed Server as an example.<br/>
<br/>
All changes on the domain need to be done on the &quot;Edit&quot; MBean server and within the scope of a configuration session. The general process is as follows:<br/>
<br/>
1. start a configuration session<br/>
2. make changes to the configuration<br/>
3. save changes<br/>
4. activate changes<br/>
<br/>
The Configuration Manager MBean is used to manage a session. Since the name is quite long, I'll define a convenience variable with its name:
<pre>
#keys
keys Type Name
#Configuration Manager
cm = edit.com.bea:/weblogic.management.mbeanservers.edit.ConfigurationManagerMBean/ConfigurationManager
</pre>
The &quot;keys&quot; command is very important to be able to navigate the MBeans. There is a complete description of the <a href="http://www.wlshell.net/v2/commands.html#keys">command </a>and the <a href="http://www.wlshell.net/v2/directories.html">concept </a>behind it in the <b>wlshell</b> documentation.<br/>
<br/>
Also, I'm going to define some variables that I will use later in the script:
<pre>
#domain
domain=myDomain
#admin server
server=AdminServer
#managed server
ser=myServer01
</pre>
The first step can be done by calling the &quot;startEdit&quot; operation:
<pre>
############################################
#start change session
wm = 60000
tm = 120000
invoke $cm/startEdit $wm $tm
</pre>

Now I can make changes to the configuration. I'm going to create a Managed Server:
<pre>
############################################
#make changes
edit.com.bea:
cd /Domain/$domain
invoke createServer $ser

cd /Server/$ser
set ListenPort 7111
</pre>

You might remember that in WLS pre-9 I had to create an MBean to have a new resource, while here I use an MBean operation to create the resource, &quot;createServer&quot; in this case.<br/>
<br/>

Finally, steps three and four:
<pre>
############################################
#save and activate
keys Type Name
invoke $cm/save
invoke $cm/activate $tm
</pre>
The new Managed Server will now appear in the &quot;Edit&quot; and &quot;Domain&quot; MBean servers.<br/>
<br/>

The <b>wlshell</b> <a href="http://www.wlshell.net/v2/download.html">distribution</a> contains additional examples using WebLogic 9 and 10:<br/>
- create and delete a DataSource<br/>
- create and delete a JMS Server and JMS Queues<br/>
- create and delete a Managed Server<br/>
<br/>

I will cover some advance configuration topics in future entries, as well as other exciting new features of the shell.
]]>
        
    </content>
</entry>
<entry>
    <title>WebLogic 10, as seen through wlshell</title>
    <link rel="alternate" type="text/html" href="http://dev2dev.bea.com/blog/paco/archive/2007/07/weblogic_10_as.html" />
    <id>http://dev2dev.bea.com/blog/paco/archive/2007/07/weblogic_10_as.html</id>
    
    <published>2007-07-11T22:19:36Z</published>
    <updated>2007-07-11T22:20:11Z</updated>
    
    <summary>With the release of wlshell 2.1, WLS 9 and 10 are now fully supported by the shell. This is the first entry of a series showing how to use wlshell with the latest WebLogic Server versions. </summary>
    <author>
        <name>paco</name>
        
    </author>
            <category term="Product: WebLogic Server" />
            <category term="Role: Platform Admin" />
    
    <content type="html" xml:lang="en" xml:base="http://dev2dev.bea.com/blog/paco/">
        <![CDATA[<p>In this first entry of the series, I will show how to connect and browse a WebLogic domain configuration.</p>

<p>WebLogic Server 9 and 10 changed internally the JMX implementation, which is now based on JMX 1.2 and JMX Remote API 1.0. But the change most obvious to users is the way how MBeans are organized and used to manage a domain.</p>

<p>As in previous releases of <strong>wlshell</strong>, users can still connect using a simple URL:</p>

<pre>
connect localhost:7001 weblogic weblogic 
</pre>

<p>But the Administration Server has now three MBean servers: Domain, Edit and Runtime. When using the traditional URL (t3://host:port) <strong>wlshell</strong> connects to all MBean servers defined in that WebLogic server instance. It uses a prefix to differentiate between JMX domains defined in each MBean server. It prepends  &quot;domain.&quot;, &quot;edit.&quot; and &quot;runtime.&quot; to the names of the JMX domains defined in Domain, Edit and Runtime MBean servers respectively.</p>

<p>The explorer shows all the JMX domains available in the connection:<br />
<img alt="explore1.png" src="http://dev2dev.bea.com/blog/paco/explore1.png" width="347" height="248" /></p>

<p>The JMX domain &quot;domain.com.bea:&quot; gives you information about what is configured on the WLS domain:</p>

<p><img alt="shell1.png" src="http://dev2dev.bea.com/blog/paco/shell1.png" width="639" height="341" /></p>

<p>In the next entry, I will describe how to modify a WebLogic domain configuration.</p>

<p>Have fun!</p>

<p>Further reading:</p>

<p><a href="http://edocs.bea.com/wls/docs100/jmx/understandWLS.html">Understanding WebLogic Server MBeans</a></p>

<p><a href="http://www.wlshell.net"><strong>wlshell</strong> web site</a></p>

<p><a href="http://www.wlshell.net/v2/weblogic.html">Using <strong>wlshell</strong> with WebLogic</a></p>]]>
        
    </content>
</entry>
<entry>
    <title>Connecting ALSB to i5/OS and OS/400</title>
    <link rel="alternate" type="text/html" href="http://dev2dev.bea.com/blog/paco/archive/2006/12/connecting_alsb_1.html" />
    <id>http://dev2dev.bea.com/blog/paco/archive/2006/12/connecting_alsb_1.html</id>
    
    <published>2006-12-12T23:38:43Z</published>
    <updated>2006-12-15T19:10:27Z</updated>
    
    <summary>The ifiveos ALSB Transport allows direct calls from ALSB to i5/OS and OS/400 programs writen in RPG and other languages.</summary>
    <author>
        <name>paco</name>
        
    </author>
            <category term="Product: AquaLogic Service Bus" />
            <category term="Technology: Service-oriented Architecture" />
            <category term="Technology: Web Services" />
            <category term="Technology: XML" />
    
    <content type="html" xml:lang="en" xml:base="http://dev2dev.bea.com/blog/paco/">
        <![CDATA[<p>I Just posted the <strong>ifiveos</strong> ALSB Transport for i5/OS on Code Share.</p>

<p><a href="https://codesamples.projects.dev2dev.bea.com/servlets/Scarab?id=S306">
ifiveos ALSB Transport for i5/OS and OS/400</a>.</p>

<p><strong>ifiveos </strong> is a transport extension that I've developed using the ALSB Transport SDK. It uses the IBM Toolbox for Java (or the open source version, JTOpen) to connect to i5/OS and OS/400.</p>

<p>The <strong>ifiveos </strong>ALSB Transport supports outbound synchronous calls from ALSB to i5/OS programs, written in RPG and other languages. Business Services based on <strong>ifiveos </strong>accept XML messages in the XPCML specification and return XPCML documents. XPCML is an XML format describing program calls, input parameters and return values.</p>]]>
        
    </content>
</entry>
<entry>
    <title>Connecting ALSB with MQ</title>
    <link rel="alternate" type="text/html" href="http://dev2dev.bea.com/blog/paco/archive/2005/12/connecting_alsb.html" />
    <id>http://dev2dev.bea.com/blog/paco/archive/2005/12/connecting_alsb.html</id>
    
    <published>2005-12-02T21:18:26Z</published>
    <updated>2006-09-12T20:56:16Z</updated>
    
    <summary>A step-by-step guide to connect BEA AquaLogic Service Bus to WebSphere MQ.</summary>
    <author>
        <name>paco</name>
        
    </author>
            <category term="Product: AquaLogic Service Bus" />
            <category term="Technology: Service-oriented Architecture" />
    
    <content type="html" xml:lang="en" xml:base="http://dev2dev.bea.com/blog/paco/">
        <![CDATA[<p>
BEA AquaLogic Service Bus (<strong>ALSB</strong>) provides interoperability with WebSphere MQ. For example, you can configure a Web Service Proxy in ALSB that sends messages to a MQ queue. Then you can have Web Service Clients using that Web Service Proxy to integrate applications with MQ, without having to install any MQ software on the clients. The Web Service Proxy can also be part of a composite application.
</p><p>
<img alt="alsb_mq.jpg" src="http://dev2dev.bea.com/blog/paco/alsb_mq/alsb_mq.jpg" width="572" height="185" />
</p><p>
I have created a step-by-step guide to connect ALSB to MQ which can be found here: <a href="http://dev2dev.bea.com/blog/paco/alsb_mq/ConnectingALSBwithMQ.pdf">ConnectingALSBwithMQ</a>
</p><p>
The two main steps are:
</p><p>
1 Bind MQ JMS objects to ALSB's JNDI tree
<br />2 Configure the Business Service
</p><p>
I've also developed a small utility program, "ForeignJNDIHelper" to bind the foreign JMS objects to ALSB's JNDI tree. The utility can be downloaded here: <a href="http://dev2dev.bea.com/blog/paco/alsb_mq/foreignjndihelper.jar">foreignjndihelper</a>
</p>]]>
        
    </content>
</entry>
<entry>
    <title>How JMX Saved My Day</title>
    <link rel="alternate" type="text/html" href="http://dev2dev.bea.com/blog/paco/archive/2005/04/how_jmx_saved_m_1.html" />
    <id>http://dev2dev.bea.com/blog/paco/archive/2005/04/how_jmx_saved_m_1.html</id>
    
    <published>2005-04-02T04:23:13Z</published>
    <updated>2006-09-12T20:56:09Z</updated>
    
    <summary>Using JMX to overcome classloader restrictions.</summary>
    <author>
        <name>paco</name>
        
    </author>
            <category term="Product: WebLogic Portal" />
            <category term="Product: WebLogic Server" />
            <category term="Role: Architect" />
            <category term="Technology: Dev Toolbox" />
    
    <content type="html" xml:lang="en" xml:base="http://dev2dev.bea.com/blog/paco/">
        <![CDATA[<p>During one of my last proof of concepts, I was helping with the migration of a home grown portal to WebLogic Portal 8.1. One of the old features to reuse was usage tracking, integrating it with WebLogic Portal. The idea was to include a WLP behavior tracking tag in the portal JSPs and to persist the tracking data using the legacy code. The portal tag looks like this:</p>

<p>&lt;BehaviorTracking:displayContentEvent documentId="&lt;%=pageCtx.getTitle()%&gt;" documentType="PortalPage"/&gt;</p>

<p>WLP offers a pluggable architecture for adding custom listeners to events. My custom listener would call the legacy code to persist the tracking information. The listener implements the <a href="http://e-docs.bea.com/wlp/docs81/javadoc/com/bea/p13n/events/EventListener.html">com.bea.p13n.events.EventListener</a> interface and it is developed as a utility class packaged as a JAR file in the APP-INF/lib directory.</p>

<p>The legacy code to persist tracking data was located under the WEB-INF/lib directory of the portal Web Application. For several reasons that code was packaged in this way and we couldn't change it. This packaging and the standard <a href="http://e-docs.bea.com/wls/docs81/programming/classloading.html">classloader hierarchy </a>in an enterprise application made impossible to call the persisting function from the custom listener. </p>

<p>Having work with JMX extensively made me think I could use it to solve this dilemma. The JMX libraries are in the system classpath and the MBeanServer can be obtained from the JNDI tree. If any code running on the server can call MBeans, I could wrap the persisting functionality in a custom MBean and make it available for my custom event listener. </p>

<p>I developed the custom MBean and I registered on the MBeanServer from the Web Application, then I invoked one of its methods from the event listener loaded with the application classloader. The approach proved to be a good solution for the restrictions imposed by the classloaders, without having to configure custom classloader hierarchies. The added benefit was that the legacy persisting functionality was now manageable through JMX tools like <a href="http://www.wlshell.net">wlshell</a>.<br />
</p>]]>
        
    </content>
</entry>

</feed> 