# Class ResourceRef

java.lang.Object
javax.naming.Reference
org.apache.naming.AbstractRef
org.apache.naming.ResourceRef

All Implemented Interfaces:
  `Serializable, Cloneable`

public class ResourceRef extends AbstractRef
Represents a reference address to a resource.

See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`AUTH`
Auth address type.
`static final String`
`DEFAULT_FACTORY`
Default factory for this reference.
`static final String`
`DESCRIPTION`
Description address type.
`static final String`
`SCOPE`
Scope address type.
`static final String`
`SINGLETON`
Is this resource a singleton

### Fields inherited from class Reference

`addrs, classFactory, classFactoryLocation, className`

## Constructor Summary

Constructors
Constructor
Description
`ResourceRef(String resourceClass, String description, String scope, String auth, boolean singleton)`
Resource Reference.
`ResourceRef(String resourceClass, String description, String scope, String auth, boolean singleton, String factory, String factoryLocation)`
Resource Reference.

## Method Summary

Modifier and Type
Method
Description
`protected String`
`getDefaultFactoryClassName()`
Returns the default factory class name.

### Methods inherited from class AbstractRef

`getFactoryClassName, toString`

### Methods inherited from class Reference

`add, add, clear, clone, equals, get, get, getAll, getClassName, getFactoryClassLocation, hashCode, remove, size`

### Methods inherited from class Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### DEFAULT_FACTORY

public static final String DEFAULT_FACTORY
Default factory for this reference.

See Also:
  - Constant Field Values

### DESCRIPTION

public static final String DESCRIPTION
Description address type.

See Also:
  - Constant Field Values

### SCOPE

public static final String SCOPE
Scope address type.

See Also:
  - Constant Field Values

### AUTH

public static final String AUTH
Auth address type.

See Also:
  - Constant Field Values

### SINGLETON

public static final String SINGLETON
Is this resource a singleton

See Also:
  - Constant Field Values

## Constructor Details

### ResourceRef

public ResourceRef(String resourceClass, String description, String scope, String auth, boolean singleton)
Resource Reference.

Parameters:
  `resourceClass` - Resource class
  `description` - Description of the resource
  `scope` - Resource scope
  `auth` - Resource authentication
  `singleton` - Is this resource a singleton (every lookup should return the same instance rather than a new instance)?

### ResourceRef

public ResourceRef(String resourceClass, String description, String scope, String auth, boolean singleton, String factory, String factoryLocation)
Resource Reference.

Parameters:
  `resourceClass` - Resource class
  `description` - Description of the resource
  `scope` - Resource scope
  `auth` - Resource authentication
  `singleton` - Is this resource a singleton (every lookup should return the same instance rather than a new instance)?
  `factory` - The possibly null class name of the object's factory.
  `factoryLocation` - The possibly null location from which to load the factory (e.g. URL)

## Method Details

### getDefaultFactoryClassName

protected String getDefaultFactoryClassName()
Description copied from class: `AbstractRef`
Returns the default factory class name.

Specified by:
  `getDefaultFactoryClassName` in class `AbstractRef`
Returns:
  the default factory class name