Interface Resources

All Superinterfaces:
org.jvnet.hk2.config.ConfigBeanProxy

public interface Resources extends org.jvnet.hk2.config.ConfigBeanProxy
Applications can lookup resources registered in the server. These can be through portable JNDI names (eg: resource-ref in standard deployment descriptors like ejb-jar.xml, web.xml etc.) or by doing direct lookup.

Each of the resource has valid target for defining the resource-ref (eg: JdbcResource can be referred from Server, Cluster, Stand Alone Instance, ServerResource can be referred from Server, Cluster, Stand Alone Instance, Config)

  • Method Summary

    Modifier and Type
    Method
    Description
    default <T extends Resource>
    T
    getResourceByName(Class<T> type, org.glassfish.api.naming.SimpleJndiName name)
     
    Returns a list of Resources like Custom Resource Or External Jndi Resource Or Jdbc Resource Or Mail Resource Or Admin Object Resource Or Connector Resource Or Resource Adapter Config Or Jdbc Connection Pool Or Connector Connection Pool.
    default <T> Collection<T>
     

    Methods inherited from interface org.jvnet.hk2.config.ConfigBeanProxy

    createChild, deepCopy, getParent, getParent
  • Method Details

    • getResources

      List<Resource> getResources()
      Returns a list of Resources like Custom Resource Or External Jndi Resource Or Jdbc Resource Or Mail Resource Or Admin Object Resource Or Connector Resource Or Resource Adapter Config Or Jdbc Connection Pool Or Connector Connection Pool.

      This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the customResource Or ExternalJndiResource Or JdbcResource Or MailResource Or AdminObjectResource Or ConnectorResource Or ResourceAdapterConfig Or JdbcConnectionPool Or ConnectorConnectionPool.

      For example, to add a new item, do as follows:

          get(CustomResource Or ExternalJndiResource Or JdbcResource Or MailResource Or AdminObjectResource Or
          ConnectorResource Or ResourceAdapterConfig Or JdbcConnectionPool Or ConnectorConnectionPool).add(newItem);
       

      Any subtype(s) of resource is allowed.

    • getResources

      default <T> Collection<T> getResources(Class<T> type)
    • getResourceByName

      default <T extends Resource> T getResourceByName(Class<T> type, org.glassfish.api.naming.SimpleJndiName name)