import org.springframework.security.providers.UsernamePasswordAuthenticationToken;
@SuppressWarnings("unchecked")
+/** Integrates Spring Security with ActiveMQ security.*/
public class ActiveMqSecurityBrokerPlugin extends BrokerPluginSupport {
-// private final static Log log = LogFactory
-// .getLog(ActiveMqSecurityBrokerPlugin.class);
+ // private final static Log log = LogFactory
+ // .getLog(ActiveMqSecurityBrokerPlugin.class);
private AuthenticationManager authenticationManager;
private String systemUsername = InternalAuthentication.DEFAULT_SYSTEM_USERNAME;
import org.springframework.security.GrantedAuthority;
import org.springframework.security.context.SecurityContext;
+/** An ActiveMQ security context compatible with Spring Security. */
public class ActiveMqSpringSecurityContext extends
org.apache.activemq.security.SecurityContext {
@Override
public Set<?> getPrincipals() {
- return new HashSet<GrantedAuthority>(Arrays
- .asList(springSecurityContext.getAuthentication()
+ return new HashSet<GrantedAuthority>(
+ Arrays.asList(springSecurityContext.getAuthentication()
.getAuthorities()));
}
import org.springframework.jms.connection.CachingConnectionFactory;
import org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter;
+/** An ActiveMQ connection factory managing secure connections. */
public class SecuredActiveMqConnectionFactory implements ConnectionFactory,
InitializingBean, DisposableBean {
import javax.swing.JPasswordField;
import javax.swing.JTextField;
+/**
+ * Small Swing-based UI to pass user/name and password. TODO better integrate
+ * with JAAS callbacks.
+ */
public class UserPasswordDialog extends JDialog implements ActionListener {
private static final long serialVersionUID = -9052993072210981198L;
private static String OK = "ok";