GlassFish in Production

Currently I have deployed three web applications in production
using GlassFish for my company Galileo Indonesia:

  1. GIWS.
    Galileo Indonesia Web Service is a web service that expose Galileo XML
    Select API as a standard web service.

    What is XML Select API? XML Select API is an API to interact with
    Galileo GDS (Global Distribution Service) application. We can
    display availability, display fare and book
    reservation in Galileo GDS using XML Select API. In XML Select API you
    send your request in XML to HCM (Host Connection Manager)
    using Microsoft DCOM. The HCM will translate your XML
    request into proprietary protocol and sending it to GDS. GDS
    response to your request is send to HCM using proprietary protocol. The
    HCM will translate the response into XML and send it to your
    application. To encapsulate XML API I use EJB3 stateful session bean
    and com4j.
    Why using stateful session bean? Because XML Select API consist of
    stateless and statefull API. To use com4j in GlassFish you must put
    com4.jar in  <GlassFish

    To expose XML Select API as SOAP Web
    Service we need XSD
    and WSDL.
    Since XML Select API is created before XSD becomes standard there is no
    XSD for XML Select. To solve this I use Trang
    to generate XSD from XML Select documentation and examples. After
    generated the XSD is refined further manually by reading the
    documentation and testing. Using NetBeans wizard I generated WSDL based
    upon the XSD. Based upon the WSDL using NetBeans Wizard I generated
    stub code for web service. Finally I code the implementation of the web
    service by calling XML Select SFSB. The
    implementation code is simply stripping the SOAP header from web
    service and feed the XML request to XML Select API. After XML Select
    responded I replace XML Select header with standard SOAP header.

    For security I use custom handler
    in JAX-WS.
    Using custom handler I check SOAP header for user name and password.
    Based on this user name, password and web services accessed I do
    authentication and authorization checking.

    Frameworks and library used in this application are: JSF, Spring Framework,
    iBatis, RichFaces,
    and Quartz.

    This application developed using NetBeans
    and deployed to GlassFish.
    Since this application needs XML Select and Microsoft DCOM the
    application is deployed to GlassFish running on top of Windows
    2003 Server
    . To run GlassFish as a Windows service I am using
    EE 5 SDK
    . I use GlassFish Java EE bundle from Java EE SDK
    download. When installing Java EE 5 SDK I just have to choose checkbox
    install as Windows Service to install GlassFish as Windows Service.

    application contains a lot of classes generated by JAX-WS
    therefore in development I have to increase GlassFish PermGen memory
    setting by using -XX:PermSize=256m and -XX:MaxPermSize=256m JVM options.

  2. GalileoIM.
    GalileoIM is a web application that can be used by travel agent to send
    booking information to their customer using Short Message Service.

    Galileo IM is one of many applications built using web services
    provided by GIWS. Other application that is built using GIWS is Galileo IBE
    (Internet Booking Engine).

    To send SMS I use SMSLib.
    However I am not using SMSLib in form of jar file. SMSLib lacks
    intensive logging and error checking needed by my application. So I
    modified SMSLib source to add intensive logging and error checking. I
    use SMSLib by utilizing SMSServer class. In servlet context listener I
    run  SMSServer in a separate thread to monitor database.
    Whenever GalileoIM wanted to send SMS it just have to write to the
    database monitored by SMSServer.

    can send SMS using 2 way: 

    1. By using web browser accessing the web
    2. By putting booking file in certain queue and
      note with certain format in the booking file. To accomodate the second
      way I monitor the travel agent queue using periodic task run using

    Frameworks and library used in this application is the same as GIWS
    with the addition of SMSLib. 

    application can not be updated using undeploy and deploy method using
    GlassFish web console because this application uses Java Comm API to
    access serial port. To update the application I have to undeploy the
    application, restart GlassFish and deploy the updated version.

  3. Galileo
    Galileo Club is a web application to manage point reward program from
    Galileo Indonesia. This application counts number of booking segments
    produced by Galileo Indonesia travel agents. Every night the
    application checks active booking file in Galileo Indonesia PCC.
    Booking segments creation and cancellation are recorded. To do this I
    use Quartz scheduler calling an EJB3 stateless session beans. Because
    the batch process runs very long I have to use multi threading
    programming for optimization. Since the batch process needs maximum
    speed I do not use GIWS from Galileo Club. I embed some code from GIWS
    into Galileo Club.

    this application I migrated from Spring based architecture into EJB3
    based architecture. This application uses EJB3 and JPA to replace
    Spring and iBatis. I also use Optimus library from PrimeFaces
    to eliminate JSF navigation in XML. To display chart in this
    application I use Chart

Techniques I use in my application to enhance managebility by GlassFish:

  1. Use logging with certain pattern for integration
    with GlassFish log viewer. I prefix my log information by
    using APP0001 where APP is my application identity and 0001 a log
    number. A pattern like this  is recognized by GlassFish as
    Message Id.
  2. Overiding toString method of classes that is stored in
    session. This way I can see session information from user who is
    logging on the application.
  3. Activate monitoring capability of GlassFish so we can see
    resource usage of our application.