Global binding support

EAServer 6.0.2 supports global-level name bindings. These are useful when components run outside of a context; for example, before an EJB is invoked, you can use global bindings inside static initializers to perform work. Any name binding—combination of a logical name and its referenced object—can be global. Global bindings are server-level properties.

StepsDefining global bindings

  1. In the Management Console, expand the Configuration Files folder. If default-application-servers-user.xml already exists, select it, then skip to step 4.

  2. Highlight the Configuration Files folder, and choose Add.

  3. Run the Add wizard and specify default-application-servers-user.xml as the name for the new file.

  4. In the right pane, inside the configure target, add the binding definition to the script, then click Apply. For example:

    <target name="configure">
    
       <setProperties applicationServer="serverName" merge="true">
          <bind name="java:comp/env/jdbc/portaldb" dataSource="portaldb"/> 
       </setProperties>
    
    </target>
    

    where serverName is the name of the server. See information about using Ant configuration scripts in the Automated Configuration Guide.

  5. For the changes to take effect:

    1. In the left pane, select default-application-servers-user.xml, right-click, and select Run Ant Configure.

    2. Select the server, right-click, and select Refresh.

    The name binding displays on the server’s Name Bindings pane. The sample code in step 4 creates this name binding:

    Bind name

    Bind object

    java:comp/env/jdbc/portaldb

    com.sybase.djc.sql.DataSource:portaldb