/**
* Instantiates a new Identity adapter.
* @return the new identity adapter
*/
protected IdentityAdapter newIdentityAdapter() {
IdentityAdapter identityAdapter = null;
try {
String adapterClassName = getIdentityConfiguration().getAdapterClassName();
if (adapterClassName.length() == 0) {
throw new ConfigurationException(
"The identity adapter class name was not properly configured.");
} else {
Class<?> clsAdapter = Class.forName(adapterClassName);
Object objAdapter = clsAdapter.newInstance();
if (objAdapter instanceof IdentityAdapter) {
identityAdapter = (IdentityAdapter) objAdapter;
identityAdapter.setApplicationConfiguration(this);
} else {
throw new ConfigurationException(
"The identity adapter class name is invalid: " + adapterClassName);
}
}
} catch (Throwable t) {
identityAdapter = new UnconfiguredIdentityAdapter();
identityAdapter.setApplicationConfiguration(this);
LogUtil.getLogger().log(Level.SEVERE,
"Unable to create a new IdenityAdapter.", t);
}
return identityAdapter;
}