User Tools

Site Tools


Introduction to Custom Code

If you have Java programming experience, there are example source codes available on request to help to get you started writing custom code in EASA. If you are interested, send us an email at support@easasoftware.com.

Why Use Custom Code?

Custom code can be used to create special scalar or list object values that come from external sources or to run additional tasks. For instance, the custom code can connect to web service and return values based on the current web service information. Sample source files of this type of example are provided in

src/com/easa/examples/soap/scalar

in which you will see the example GetQuote class which returns stock market values of different stocks. Other examples include new data processing methods, such as the Beta and Gamma functions or random number generation. Some data processing examples are provided in

src/com/easa/examples/dor

Custom code can be written to perform custom actions on the client, for example, to show a new GUI component, such as a calendar-like date entry, or to run third party software. Examples of custom actions can be seen in

src/com/easa/examples/actions

Custom code can be used to define new compute server configurations that use protocols not currently supported by EASA, such as RMI or Corba. A simple example of a custom compute server is available in

src/com/easa/examples/compute/ComputeServerAdapter.java.

Getting Started with Custom Code

Once you have decided that you need to write custom code to extend EASA, there is a 10 step procedure that you can follow as part of your custom code development. These steps are as follows:

  1. Review the available interface documentation to better understand the coding requirements. (Creating Custom Objects)

  2. Download the EASA Java interfaces file (easa-com.jar) to compile with your code. (Compiling Custom Code)

  3. Write your Java code and compile it into new classes. (Compiling Custom Code)

  4. Test your code manually before adding your new classes to the EASA Server. (Manual Testing)

  5. Place your new classes in a jar file and upload them onto the EASA Server. (Uploading Custom Code Files)

  6. Add your jar file to your local EASA Client installation under EASA client/custom. (Testing in EASA)

  7. Test your custom code within EASA by adding the appropriate Custom Object using the new class name. (Testing in EASA)

  8. Update the appropriate property file to include your new class name. (Updating Properties Files)

  9. Update the EASA Server. (Updating the EASA Server)

After completing these steps, EASAPs can now be authored using Custom Objects that make use of your custom code. A detailed description of this procedure is provided in Custom Action Examples.

Dangers of Custom Code

Though the possibility for improving your EASA System through the use of custom code can be very powerful, the possible downside is that custom code can cause the EASA Server or the EASA Client to crash if coded in an unfriendly manner. For example, if custom code uses large amounts of memory, CPU or does not return when called, it is possible to stop the EASA Server working in some instances.

Other examples of where this might happen are memory leaks where custom code stores values in java.util.Lists or java.util.Maps without clearing them at the right time, or methods that connect to an external source and wait continuously if the source is not available.

If creating your own code, here are a list of suggested actions to limit the possibility for problems when implementing custom code:

  • Be familiar with best practices when coding for the Java platform.
  • Read all the information available on this page and in the Java documentation provided within EASA on the Custom Code page under the Configure tab in Administrator mode.
  • If possible, test your code on a test EASA Server system to ascertain the performance. Only after these steps have been completed should you start adding your custom code to a live production-level EASA Server.

Creating Custom Objects

There are specific types of custom objects that you can create within the EASA API and the structure and content of your custom code will be dictated in large part by which custom object you are creating.

The types of custom objects available in the EASA API are as follows:

  • Custom Scalar
  • Custom List
  • Custom Multi-List
  • Custom Action
  • Custom Process Action
  • Custom GUI
  • Custom Compute Server
  • Custom Menu
  • Custom Thread
  • Custom Servlet
  • Custom Authentication