Fields Summary |
---|
public static final String | APPLICATION_AUTHORIZATIONFor database resources, this says the application will log in. |
public static final String | CONTAINER_AUTHORIZATIONFor database resources this says the container will log in. |
public static final String | RESOURCE_SHAREABLE |
public static final String | RESOURCE_UNSHAREABLE |
private static final String | URL_RESOURCE_TYPE |
private static final String | CONNECTOR_RESOURCE_TYPE |
private static final String | MAIL_RESOURCE_TYPE |
private static final String | JDBC_RESOURCE_TYPE |
private static final String | ORB_RESOURCE_TYPE |
private static final String | WEBSERVICE_CONTEXT_TYPE |
private String | rType |
private com.sun.enterprise.deployment.ResourcePrincipal | resourcePrincipal |
private MailConfiguration | mailConfiguration |
private String | authorization |
private DataSource | dataSource |
private String | sharingScope |
private List | runtimeProps |
boolean | createTablesAtDeploy |
boolean | dropTablesAtUndeploy |
String | databaseVendorName |
Properties | schemaGeneratorProperties |
private static final com.sun.enterprise.util.LocalStringManagerImpl | localStrings |
static final Logger | _logger |
Methods Summary |
---|
public void | addProperty(NameValuePairDescriptor newProp)Add a new runtime property to this cmp resource
if (runtimeProps==null) {
runtimeProps = new ArrayList();
}
runtimeProps.add(newProp);
|
public void | checkType()checks the given class type. throws an IllegalArgumentException
if bounds checking
if the class of type "type" does not exist
if (rType != null) {
Class typeClass = null;
// is it loadable ?
try {
// Bug fix 4850684: for resource-refs that are user-defined classes,
// the classloader used to load them cannot be the one associated
// with the application deployed, since the classloader instance
// would have no idea about classes not included in app
// for e.g connector module with res-ref that points to the
// ConnectionFactory class of a resource adapter
typeClass = Class.forName(rType, true,
Thread.currentThread().getContextClassLoader());
} catch (Throwable t) {
if (this.isBoundsChecking()) {
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptiontypenotallowedpropertytype",
"{0} is not an allowed property value type",
new Object[] {rType}));
} else {
return;
}
}
}
|
public boolean | equals(java.lang.Object object)Equality on name.
if (object instanceof ResourceReference) {
ResourceReference resourceReference = (ResourceReference) object;
return resourceReference.getName().equals(this.getName());
}
return false;
|
public java.lang.String | getAuthorization()Return the authorization type of this resource. The default value
is APPLICATION_AUTHORIZATION
if (this.authorization == null) {
this.authorization = APPLICATION_AUTHORIZATION;
}
return this.authorization;
|
public java.lang.String | getDatabaseVendorName()
return databaseVendorName;
|
public java.lang.String | getInjectResourceType()
return rType;
|
public javax.sql.DataSource | getJDBCDataSource()Lookup the datasource from the namespace based on the JNDI name.
if ( dataSource == null ) {
try {
// Get JDBC DataSource for database
javax.naming.Context ctx = new javax.naming.InitialContext();
// cache the datasource to avoid JNDI lookup overheads
dataSource = (DataSource)ctx.lookup(getJndiName());
} catch ( Exception ex ) { }
}
return dataSource;
|
public java.lang.String | getJndiName()Return the JNDI name of this resource reference.
String jndiName = super.getValue();
return (jndiName != null && ! jndiName.equals("")) ?
jndiName : getMappedName();
|
public MailConfiguration | getMailConfiguration()Return the mail configuration details of thsi resource or null.
return this.mailConfiguration;
|
public java.util.Iterator | getProperties()
if (runtimeProps==null) {
return null;
}
return runtimeProps.iterator();
|
public com.sun.enterprise.deployment.ResourcePrincipal | getResourcePrincipal()Return the identity used to authorize this resource.
return this.resourcePrincipal;
|
public java.util.Properties | getSchemaGeneratorProperties()
return schemaGeneratorProperties;
|
public java.lang.String | getSharingScope()Return the res-sharing-scope of this resource reference.
if ( sharingScope == null ) {
return "";
}
return sharingScope;
|
public java.lang.String | getType()Return the type of the resource.
return rType;
|
public boolean | isContainerAuthorization()Return true of this resource reference is expecting the container
to authorize the resource.
return this.getAuthorization().equals(CONTAINER_AUTHORIZATION);
|
public boolean | isCreateTablesAtDeploy()
return createTablesAtDeploy;
|
public boolean | isDropTablesAtUndeploy()
return dropTablesAtUndeploy;
|
public boolean | isJDBCResource()
return this.getType().equals(JDBC_RESOURCE_TYPE);
|
public boolean | isJMSConnectionFactory()Return true if this resource is a JMS connection factory.
String myType = this.getType();
return
( myType.equals("javax.jms.QueueConnectionFactory") ||
myType.equals("javax.jms.TopicConnectionFactory") );
|
public boolean | isMailResource()Return true if this resource is to a JavaMail session object.
//START OF IASRI 4650786
// return (this.getMailConfiguration() != null);
return this.getType().equals(MAIL_RESOURCE_TYPE);
//END OF IASRI 4650786
|
public boolean | isORB()
return this.getType().equals(ORB_RESOURCE_TYPE);
|
public boolean | isResolved()Does this resource references have a JNDI name.
return true;
|
public boolean | isResourceConnectionFactory()Return true if this resource is a CCI connection factory.
return this.getType().equals(CONNECTOR_RESOURCE_TYPE);
|
public boolean | isURLResource()Return true if this resource is a URL object.
return this.getType().equals(URL_RESOURCE_TYPE);
|
public boolean | isWebServiceContext()
return this.getType().equals(WEBSERVICE_CONTEXT_TYPE);
|
public void | print(java.lang.StringBuffer toStringBuffer)Returns a formatted string representing my state.
StringBuffer sb = toStringBuffer;
sb.append("Res-Ref-Env-Property: ");
sb.append(super.getName());
sb.append("@");
sb.append(getType());
sb.append("@");
sb.append(getDescription());
if (this.isResolved()) {
sb.append(" resolved as: jndi: ");
sb.append(getJndiName());
sb.append("@res principal: ");
sb.append(getResourcePrincipal());
sb.append("@mail: ");
sb.append(getMailConfiguration());
}
if (runtimeProps!=null) {
for (Iterator itr = runtimeProps.iterator();itr.hasNext();) {
sb.append("\nPropery : ");
sb.append(itr.next());
}
} else {
sb.append("\nNo Runtime properties");
}
sb.append("\nDatabase Vendor : " + databaseVendorName);
sb.append("\nCreate Tables at Deploy : " + createTablesAtDeploy);
sb.append("\nDelete Tables at Undeploy : " + dropTablesAtUndeploy);
if (schemaGeneratorProperties!=null) {
sb.append("\nSchema Generator Properties : ");
sb.append(schemaGeneratorProperties);
}
|
public void | setAuthorization(java.lang.String authorization)Sets the authorization type of this resource.
this.authorization = authorization;
|
public void | setCreateTablesAtDeploy(boolean createTablesAtDeploy)Sets whether if automatic creation of tables for the CMP Beans is
done at deployment time
this.createTablesAtDeploy = createTablesAtDeploy;
|
public void | setDatabaseVendorName(java.lang.String vendorName)Sets the database vendor name
this.databaseVendorName = vendorName;
|
public void | setDropTablesAtUndeploy(boolean dropTablesAtUndeploy)Sets whether if automatic creation of tables for the CMP Beans is
done at deployment time
this.dropTablesAtUndeploy = dropTablesAtUndeploy;
|
public void | setInjectResourceType(java.lang.String resourceType)
rType = resourceType;
|
public void | setJndiName(java.lang.String jndiName)Set the JNDI name of this resource reference.
super.setValue(jndiName);
|
public void | setMailConfiguration(MailConfiguration mailConfiguration)Sets the mail configuration information for this reference.
this.mailConfiguration = mailConfiguration;
|
public void | setResourcePrincipal(com.sun.enterprise.deployment.ResourcePrincipal resourcePrincipal)Sets the identity used to authorize this resource.
this.resourcePrincipal = resourcePrincipal;
|
public void | setSchemaGeneratorProperties(java.util.Properties props)Sets the override properties for the schema generation
schemaGeneratorProperties = props;
|
public void | setSharingScope(java.lang.String ss)Set the res-sharing-scope of this resource reference.
sharingScope = ss;
|
public void | setType(java.lang.String type)Sets the type of this resource.
rType = type;
|