Package org.glassfish.resources.api
Interface JavaEEResource
-
- All Known Implementing Classes:
AdministeredObjectResource
,CustomResource
,ExternalJndiResource
,JavaEEResourceBase
,MailBean
public interface JavaEEResource
Interface representing J2EE Resource info.- Author:
- Kenneth Saks
-
-
Field Summary
Fields Modifier and Type Field Description static int
CONNECTOR_RESOURCE
static int
CUSTOM_RESOURCE
static int
EXTERNAL_JNDI_RESOURCE
static int
JDBC_CONNECTION_POOL
static int
JDBC_DRIVER
static int
JDBC_RESOURCE
static int
JDBC_XA_RESOURCE
static int
JMS_CNX_FACTORY
static int
JMS_DESTINATION
Resource Typesstatic int
MAIL_RESOURCE
static int
PMF_RESOURCE
static int
RESOURCE_ADAPTER
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addProperty(ResourceProperty property)
Add a property.String
getDescription()
Gets description of the resourceSet
getProperties()
Set containing elements of type ResourceProperty.ResourceProperty
getProperty(String propertyName)
Get a property with the given name.ResourceInfo
getResourceInfo()
Resource Info.int
getType()
Resource type.boolean
isEnabled()
Checks whether the resource is enabled.JavaEEResource
makeClone(ResourceInfo resourceInfo)
Create a new resource with the given name that has the same attribute and property settings as the invoked object.boolean
removeProperty(ResourceProperty property)
Remove a property.void
setDescription(String value)
Sets description of the resourcevoid
setEnabled(boolean value)
Sets whether the resource is enabled.
-
-
-
Field Detail
-
JMS_DESTINATION
static final int JMS_DESTINATION
Resource Types- See Also:
- Constant Field Values
-
JMS_CNX_FACTORY
static final int JMS_CNX_FACTORY
- See Also:
- Constant Field Values
-
JDBC_RESOURCE
static final int JDBC_RESOURCE
- See Also:
- Constant Field Values
-
JDBC_XA_RESOURCE
static final int JDBC_XA_RESOURCE
- See Also:
- Constant Field Values
-
JDBC_DRIVER
static final int JDBC_DRIVER
- See Also:
- Constant Field Values
-
CONNECTOR_RESOURCE
static final int CONNECTOR_RESOURCE
- See Also:
- Constant Field Values
-
RESOURCE_ADAPTER
static final int RESOURCE_ADAPTER
- See Also:
- Constant Field Values
-
JDBC_CONNECTION_POOL
static final int JDBC_CONNECTION_POOL
- See Also:
- Constant Field Values
-
PMF_RESOURCE
static final int PMF_RESOURCE
- See Also:
- Constant Field Values
-
EXTERNAL_JNDI_RESOURCE
static final int EXTERNAL_JNDI_RESOURCE
- See Also:
- Constant Field Values
-
CUSTOM_RESOURCE
static final int CUSTOM_RESOURCE
- See Also:
- Constant Field Values
-
MAIL_RESOURCE
static final int MAIL_RESOURCE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getResourceInfo
ResourceInfo getResourceInfo()
Resource Info. Immutable.- Returns:
-
getType
int getType()
Resource type. Defined above. Immutable.- Returns:
-
getProperties
Set getProperties()
Set containing elements of type ResourceProperty. Actual property names are resource type specific.- Returns:
- Shallow copy of resource property set. If resource has 0 properties, empty set is returned.
-
addProperty
void addProperty(ResourceProperty property)
Add a property. Underlying set is keyed by property name. The new property overrides any existing property with same name.- Parameters:
property
-
-
removeProperty
boolean removeProperty(ResourceProperty property)
Remove a property. Underlying set is keyed by property name.- Parameters:
property
-- Returns:
- true if property was removed, false if property was not found
-
getProperty
ResourceProperty getProperty(String propertyName)
Get a property with the given name.- Parameters:
propertyName
-- Returns:
- ResourceProperty or null if not found.
-
makeClone
JavaEEResource makeClone(ResourceInfo resourceInfo)
Create a new resource with the given name that has the same attribute and property settings as the invoked object.- Parameters:
resourceInfo
-- Returns:
-
setEnabled
void setEnabled(boolean value)
Sets whether the resource is enabled.A resource can exist but be disabled, in which case references if an application is deployed that references it will deploy without errors, but when it is looked up a
NamingException
will be thrown- Parameters:
value
-
-
isEnabled
boolean isEnabled()
Checks whether the resource is enabled.A resource can exist but be disabled, in which case references if an application is deployed that references it will deploy without errors, but when it is looked up a
NamingException
will be thrown- Returns:
-
setDescription
void setDescription(String value)
Sets description of the resource- Parameters:
value
-
-
getDescription
String getDescription()
Gets description of the resource- Returns:
-
-