Methods Summary |
---|
protected javax.resource.spi.ManagedConnectionFactory | getMcf()
if (mcf == null)
{
try
{
mcf = (ManagedConnectionFactory) server.getAttribute(
managedConnectionFactoryName,
"ManagedConnectionFactory");
}
catch (Exception e)
{
log.error("The ConnectionManager mbean: " + managedConnectionFactoryName
+ " specified in a ConfiguredIdentityLoginModule could not be found."
+ " ConnectionFactory will be unusable!");
if( Boolean.TRUE != ignoreMissigingMCF )
{
throw new IllegalArgumentException("Managed Connection Factory not found: "
+ managedConnectionFactoryName);
}
} // end of try-catch
if (log.isTraceEnabled())
{
log.trace("mcfname: " + managedConnectionFactoryName);
}
} // end of if ()
return mcf;
|
protected javax.management.MBeanServer | getServer()
return server;
|
public void | initialize(javax.security.auth.Subject subject, javax.security.auth.callback.CallbackHandler handler, java.util.Map sharedState, java.util.Map options)
super.initialize(subject, handler, sharedState, options);
String name = (String) options.get("managedConnectionFactoryName");
try
{
managedConnectionFactoryName = new ObjectName(name);
}
catch (MalformedObjectNameException mone)
{
throw new IllegalArgumentException("Malformed ObjectName: " + name);
}
if (managedConnectionFactoryName == null)
{
throw new IllegalArgumentException("Must supply a managedConnectionFactoryName!");
}
Object flag = options.get("ignoreMissigingMCF");
if( flag instanceof Boolean )
ignoreMissigingMCF = (Boolean) flag;
else if( flag != null )
ignoreMissigingMCF = Boolean.valueOf(flag.toString());
server = MBeanServerLocator.locateJBoss();
getMcf();
|
public boolean | login()Return false if there is no mcf, else return super.login(). Override
to provide custom authentication.
if (mcf == null)
{
return false;
}
return super.login();
|
public boolean | logout()
removeCredentials();
return super.logout();
|
protected void | removeCredentials()This removes the javax.security.auth.login.name and
javax.security.auth.login.password settings from the sharteState map
along with any PasswordCredential found in the PrivateCredentials set
sharedState.remove("javax.security.auth.login.name");
sharedState.remove("javax.security.auth.login.password");
SubjectActions.removeCredentials(subject, mcf);
|