|Home | Products | Documents | Downloads | Purchase | Support | Company | Partners | Contact |
EasyEJB

Table of Contents



Overview

EasyEJB (SuperPeekPoke) is an EJB  tool for monitoring EJB (Enterprise JavaBeans). It is a monitor and management tool. It allows you to do the following things visually:

No programming is required. Your keyboard is necessary if you want input values for poking.

The result of Peeking is displayed on the PeekKaleidoscope Panel, which consists of:

See EasyEJB tour for an example.

EasyEJB can peek and poke the following beans:

  • Entity bean
  • Stateful session bean
  • Stateless session bean
  • EasyEJB lists all available JNDI names and all available methods for you to choose. You do not need the source code of target EJBs for PeekPoking.

    EasyEJB supports EJB 1.1, 2.0-2.1 (EJB2) and 3.0 (EJB3). EasyEJB uses standard features of EJB, so it works for all J2EE servers. 
     
    EasyEJB is formerly called SuperPeekPoke. Only the commercial name is changed. The internal name is still SuperPeekPoke. 

    Prerequisite

    There is no requisite for your EJBs. Your EJBs do not need to code anything special for EasyEJB.

    Note: Client jar files are needed. Please see EJB stubs are needed for details.
     
    See Prerequisite in Installation for general Prerequisite.

     

    Connect to application server using native (RMI-IIOP) protocol

    This is the desired way to connect application server for J2EE tools. It uses JNDI properties to connect the application server directly. The protocol is RMI over IIOP. For example, WebLogic uses t3 protocol which is an implementation of RMI-IIOP. 

    SuperArch uses built-in security of J2EE server for the connection. SuperArch provides connectivity to J2EE/EJB server/container through ../arch/SuperArch.html#Envoy:

    Connect to application server through HTTP tunneling

    If the network between the application server and the client is not trusted one or the firewall does not allow RMI-IIOP protocol, throuth HTTP/HTTPS tunneling is a viable solution.

    Note: HTTP/HTTPS does not replace native protocols. If the process is to access EJB, the "real" protocol is still RMI-IIOP. If the process is to access database, the "real" protocol is whatever the database access protocol is. HTTP/HTTPS is an extra protocol on top of the native protocol, adding extra overhead.

     

     

    PeekPoke-able methods

    Peek-able methods are methods of the remote interface of EJBs whose return data type is not void.  Getter methods are the natural candidates. The purpose of this type of methods is for getting values from EJBs. For example:

          double getBalance( );

          int getNumberOfTransaction( );

    EasyEJB extends support to any remote method which returns a value.

    EasyEJB uses peek-able methods to peek.

    Poke-able methods are methods of the remote interface of EJBs. Any method can be a poke-able method.  Setter methods are the natural candidates. The purpose of these methods is passing values onto EJBs. For example:

         void  setZipCode(String zipCode);

         void  reset( );

         double deposit(double amount);  // return balance

    EasyEJB extends support to any remote methods.

    EasyEJB uses poke-able methods to poke.

    The definition of peek-able and poke-able methods is for the peek operation and the poke operation only.

    Not PeekPoke-able methods will not show on the Add Peek Panel or Add Poke Panel.

    If the method in question expects an argument list, you need to key in them. Arbitrary objects (except for Vector, Hashtable and alike) are supported. See the Assign Argument Panel for detail.

    Note: Peek-able methods may have side effects of poking. Poke-able methods may actually just peek. You must know the consequence of your call.
     
     

    Access privilege

    You need specific privileges to peek and poke. The privilege is specified by Deployment Descriptor of target EJBs and your J2EE server. This is required by J2EE servers, not by EasyEJB. Acelet-Scheduler is a monitoring tool, not a hacker tool.
     
     

    Pace

    Pace is the period between two peek operations in seconds.

    EasyEJB tries to peek the EJB repeatedly, but sometimes it can not get all data within a peek cycle (for example, the server is down or the network traffic is too heavy). When that happens, the monitor process stops. A time-out error message window will pop up.

    When Peek stops, you can press Refresh button to restart the peek process. You may want to set a bigger pace value from Preference Panel.
     
      EJB stubs are needed

    Acelet-Scheduler communicates to EJBs through client jars, which contain home classes, remote classes and stubs.

    These client side classes must be included on the CLASSPATH , so EasyEJB can talk to your EJBs. These client side classes must match (be the same version) the running EJBs on the J2EE server . These client side classes can be in either class file format or jar file format.
     
    Note: some application servers, such as WebLogic, can automatically download stubs of EJBs. In that case, you do not have to put stubs on the local CLASSPATH.

    Note: You may see some of your EJBs on the JNDI Tree Panel, but not on JNDI name list on EJB Panel. In that case, most likely, your EJB's stubs are not on the CLASSPATH. JNDI Tree Panel tries to find all JNDI names without touch the corresponding objects, so even there is no stub, the name still can be listed there. But on the EJB Panel, EasyEJB needs to inspect the object which the JNDI name points to. If the stub is not available, errors may occur, so the name can not be listed on the JNDI name list box of the EJB Panel.

    What is stub

    Stubs are Java classes which are generated when you deploy your EJB to the application server. During the deployment, you prepare EJB classes, remote interfaces and home classes in a jar file. These classes are source code classes. When you compile using RMI compiler or deploy the jar, the application server utility generates corresponding binary classes and stubs and put all of them into your jar file. The jar file with stubs is called client jar or simply stub.

    If you want to see what stubs look like, you can exam xxxSuperLogging.jar which is on directory <Acelet-Scheduler-home>/beanbox. xxx here denote to the name of your application server, for example, websphere. If you open the jar file (for example, use command line tool 

    jar -tf 

    You will see some files like:

    com/acelet/logging/SuperLoggingEJB_43nqjk_EOImpl_812_WLStub.class

    or

    com/acelet/logging/EJSRemoteStatelessSuperLogging_7a24cdfd.class

    They are stubs. These generated files usually have funny names. (Note: jBoss does not have generated stubs, in that case, only binary class are needed).

    How to get stub

    Stubs are generated when you RMI compile or deploy you EJBs. If the EJBs are deployed by other people, you can get these stubs using the console of your application server.

    WebSphere

    1. Expand Applications on the left side of the console.
    2. Click on Enterprise Applications.
    3. Choose the application on the right side.
    4. Click on Export button on the right side.
    5. You will see a panel titled Export Application EAR files
    6. Click on Save, then select a temporary directory to save it.
    7. The saved file is an EAR file. Open a command line window and unzip it to get the jar file.
    8. Open the jar file to see if the funny name files are there.
    9. Now, you can put the jar file on the CLASSPATH.

     

    Data input

    Many methods of EJBs require argument lists. You need to provide these argument lists. There are two way to assign these argument lists: keyboard input and dynamic argument input. See Data input facilities for details.

    Note: For EJB constructors, the DynamicArgument is called once when the EJB is constructed. For remote methods, the DynamicArgument is called each time when the method is called.
     

    DynamicArgument class is designed for this purpose. You need to code your own class which inherits from DynamicArgument. You specify your business logic in method getArgumentArray( ). EasyEJB will call getArgumentArray( ) at run time to get dynamic values.

    Example: the following class generates a random Integer value:

    import java.util.Random;

    public class RandomIntDynamicArgument extends DynamicArgument {

      static Random random = new Random( );

      public Object[] getArgumentArray( ) throws InvalidArgumentException {

        int value = random.nextInt(10);

        Integer integer = new Integer(value);

        Object[] argumentArray = new Object[1];

        argumentArray[0] = integer;

        return argumentArray;

      }

    }

    Note: You need to put your implementation of DynamicArgument on the CLASSPATH. If you use SuperSchedulerLibrary.jar on the server side, you need to put your DynamicArgument on the CLASSPATH of your J2EE server as well.

     

    Hibernation

    EasyEJB is hibernate-able. See Hibernation for details.

     


       © Copyright Acelet Corporation. All rights reserved.