Oracle GlassFish Server 3.0.1 Application Development Guide


To create a custom resource that provides Java primitives to applications, follow these steps:

  1. Set the custom resource's factory class to org.glassfish.resources.custom.factory.PrimitivesAndStringFactory.

  2. Set the custom resource's resource type to one of the following or its fully qualified wrapper class name equivalent:

    • int

    • integer

    • long

    • double

    • float

    • char

    • character

    • short

    • byte

    • boolean

    • String

  3. Create a property in the custom resource named value and give it the value needed by the application.

    For example, If the application requires a double of value 22.1, create a property with the name value and the value 22.1.