To create a custom resource that provides URL instances to applications, follow these steps:
Set the custom resource's factory class to org.glassfish.resources.custom.factory.URLFactory.
Choose which of the following constructors to use:
URL(protocol, host, port, file)
URL(protocol, host, file)
Define properties according to the chosen constructor.
For example, for the first constructor, define properties named protocol, host, port, and file. Example values might be http, localhost, 8085, and index.html, respectively.
For the third constructor, define a property named spec and assign it the value of the entire URL.