If you are currently using Java CAPS 6, you can use all user-defined alerting capabilities as you are used to like in previous versions of Java CAPS. The NetBeans IDE already provides facilities that the user can leverage to send out user-defined alerts from his Java collaboration projects, or BPEL processes, etc. These alerts can be viewed from the
Java CAPS Enterprise Manager
, and also filtered and routed through multiple channels (JMS, SMTP, SNMP, etc.) by setting these channels and filters up from the Java CAPS Alert and SNMP Agent configurations through the standard Web interface.
Moreover, if you are a Java CAPS 6 customer, there are samples available that come with the Java CAPS 6 product that show you how to write your own client using not only Java, but also using any one of 26 different (at the time of this writing) JSR 223 scripting languages like Groovy, JRuby, PHP, etc.
If you are NOT a Java CAPS 6 customer, you can still use alerting capabilities available in the platform. You will however, not have pre-built Alert clients like the Java CAPS Enterprise Manager
, or the routing capabilities of the Java CAPS Alert Agent, or the Java CAPS SNMP Agent. But you can still retrieve the alerts from the system
using the Common Management and Monitoring API
. Once you retrieve alerts from the system, you can store it wherever you like if you so choose to and deal with the alerts appropriately as you deem fit.
Java CAPS Alert Agent and Java CAPS SNMP Agent documentation
- All documentation is available on the net on docs.sun.com.
- There is no change in Java CAPS 6.x as far as Alert and SNMP Agents go.
- You can see the documentation for the JavaCAPS Alert and SNMP Agents from here http://docs.sun.com/app/docs/coll/1607.3?l=en
.
- The Event Management Framework is embedded in the runtime.
- This Event management framework deals with all types of alerts - whether generated by the JBI Framework/System/Components, or user generated alerts (from the BPEL and Java alerter, etc.) from inside their composite application.
- If you are a Java CAPS customer, and are using the Java CAPS Enterprise Manager
, you can view these Alerts from the Java CAPS Enterprise Manager
.
- These alerts are stored in a database on the same server that runs the Java CAPS Enterprise Manager
, and are also routed to the Java CAPS Alert and SNMP Agents.
- From the Java CAPS Alert Agent you can configure your alerts to go out through either JMS Destinations, or sent out through email notifications (SMTP) or sent out as SNMP Traps.
- The Common Management and Monitoring API
has operations available as part of the Alert Management Service to retrieve these alerts.
- In fact the Java CAPS Enterprise Manager
uses this same Common Management and Monitoring API
to retrieve these alerts from the runtime.
- In addition to the samples available as part of the Java CAPS distribution CD, some of these code samples are also available here: http://wiki.open-esb.java.net/Wiki.jsp?page=ESBConsoleAlertReceptionAPIUsage
- If you are an Open ESB user, who does not own the Java CAPS Enterprise Manager
, once you retrieve the alerts from the system
using the Common Management and Monitoring API
, you can store it wherever you like if you so choose to and deal with the alerts appropriately as you deem fit.
The attached screen-shots from the Java CAPS 6 NetBeans IDE show how to generate a custom alert from a Java EE composite application. You can also do the same from your BPEL processes too.
- In the IDE, create an EJB Module project.
- Add a web service or session bean to the project.
- Add an operation.
- Go to the Source view.
- In the Palette window, click the Alerter icon and drag it into the operation method.
- A dialog box prompts you to specify details about the alert.
- Select the approriate type: Info, Warning, Minor, Major, Critical, Fatal, or Custom.
- In the Alert Message field, enter the message string.
- If you selected the Custom type, then you must also specify the alert code name and the severity.
- Click OK. The alerter code is added.
public class NewWebService {
private Alerter alerter = AlerterFactory.getAlerter();
/**
* Web service operation
*/
@WebMethod(operationName = "operation")
public String operation() {
alerter.warning("test warning", "EJBModule1");
//TODO write your implementation code here:
return null;
}
....
....
}
- Finish and deploy the application.
If the alert/message code is not set, then there is only one option available - select ALL Types for alert code.
The source path can be very coarse-grained - just select the host:port e.g.,
e51x|Server|<host>:<port>
You get ALL alerts from the matching the host:port.
Also note that the source path can also be very fine-grained where you can select down to the component (provided the Project, Deployment and component names are set), for e.g.,
e51x|Servers|<hostname>:<port>|Project1|Deployment1|CMap1|Service1
No the BPEL alerter allows you to only create alerts of severity type: critical, major, minor, warning, and info. Only the EJB alerter allows you to create custom alerts in addition to the others. For more about the BPEL alerter, see
http://wiki.open-esb.java.net/Wiki.jsp?page=BPELProcessLoggingAndAlerting
- The corresponding parameters are:
alerter.custom(messageCode, severity, message, deploymentName);
- In addition to the documentation available on this page, you can read more about alerting here:
- Java CAPS (the superset of Glassfish ESB) has a Java CAPS SNMP Agent which lets you send alerts as SNMP traps
- Java CAPS (the superset of Glassfish ESB) has a component called the Java CAPS Enterprise Manager
which - among other things - lets you see alert messages.
- Both the Java CAPS SNMP Agent, and the Java CAPS Enterprise Manager
are not part of OpenESB/Glassfish ESB
- Glassfish Enterprise Server (the Application Server used by Glassfish ESB) has the ability to generate SNMP traps for some messages produced by Glassfish - i.e., not alerts generated by Glassfish ESB components.
- Glassfish Enterprise Server (the Application Server used by Glassfish ESB) has a component called the Glassfish Enterprise Manager which lets you do some Performance Analysis and other nice things.
- The Glassfish Enterprise Manager and its SNMP trap generator are only available for Glassfish Enterprise Server. i.e., paying customers using Glassfish ESB or Glassfish.
- The Glassfish Enterprise Manager is totally different to the Java CAPS Enterprise Manager
. It is a pity that they have such similar names.
- The SNMP and Alert infrastructure of Glassfish Enterprise Server and Glassfish ESB are different things. Please dont confuse them.
- If you want to know more about Glassfish Enterprise Manager, the documentation is at http://docs.sun.com/app/docs/coll/1343.6
. See Performance Advisor and SNMP.
Back to to
How Tos
Number of visits: 10